Skip to content

Commit 889338b

Browse files
authored
test(cypress): fix table vis tests to use the correct selector (#10905)
--------- Signed-off-by: Qxisylolo <[email protected]>
1 parent a1d2e7b commit 889338b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cypress/integration/core_opensearch_dashboards/opensearch_dashboards/apps/explore/06/rule_matching_vis_table.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const runCreateVisTests = () => {
3939

4040
it('should create a table visualization using a query with multiple fields', () => {
4141
const query = `source=${datasetName} | stats count() by category, response_time | head 10`;
42-
cy.explore.createVisualizationWithQuery(query, 'Table', datasetName, {
42+
cy.explore.createVisualizationWithQuery(query, 'table', datasetName, {
4343
shouldManualSelectChartType: true,
4444
});
4545

@@ -48,7 +48,7 @@ export const runCreateVisTests = () => {
4848

4949
it('should toggle column filter and the changes reflect immediately to the table visualization', () => {
5050
const query = `source=${datasetName} | stats count() by category, response_time | head 10`;
51-
cy.explore.createVisualizationWithQuery(query, 'Table', datasetName, {
51+
cy.explore.createVisualizationWithQuery(query, 'table', datasetName, {
5252
shouldManualSelectChartType: true,
5353
});
5454

@@ -69,7 +69,7 @@ export const runCreateVisTests = () => {
6969

7070
it('should add threshold coloring and reflect immediately to the table visualization', () => {
7171
const query = `source=${datasetName} | stats count() by category | head 5`;
72-
cy.explore.createVisualizationWithQuery(query, 'Table', datasetName, {
72+
cy.explore.createVisualizationWithQuery(query, 'table', datasetName, {
7373
shouldManualSelectChartType: true,
7474
});
7575

@@ -93,7 +93,7 @@ export const runCreateVisTests = () => {
9393

9494
it('should create data links that turn cell values into clickable links', () => {
9595
const query = `source=${datasetName} | stats count() by category | head 10`;
96-
cy.explore.createVisualizationWithQuery(query, 'Table', datasetName, {
96+
cy.explore.createVisualizationWithQuery(query, 'table', datasetName, {
9797
shouldManualSelectChartType: true,
9898
});
9999

cypress/utils/commands.explore.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ cy.explore.add('createVisualizationWithQuery', (query, chartType, datasetName, o
525525

526526
// Ensure chart type is correct
527527
cy.getElementByTestId('exploreChartTypeSelector').should('be.visible').click();
528-
cy.getElementByTestId(`exploreChartTypeSelector-${chartType}`).should('be.visible');
529-
528+
cy.get(`#${chartType}`).should('match', '[role="option"][aria-selected="true"]');
530529
cy.get('body').click(0, 0);
531530
});
532531

0 commit comments

Comments
 (0)