From b72bc25532d7bdc58cf74fa18d752654e42cf73b Mon Sep 17 00:00:00 2001 From: Anan Zhuang Date: Tue, 10 Jan 2023 13:50:38 -0800 Subject: [PATCH] Fix multiple submit bug Currently there are two submit type button in data source which cause cypress fail to find and click. In this PR, I switch to use data-test-subj to uniquely identify the btn. Issue Resolved: https://github.com/opensearch-project/opensearch-dashboards-functional-test/issues/439 Signed-off-by: Anan Zhuang --- .../opensearch-dashboards/apps/vis_type_table/embed.spec.js | 2 +- .../datasource-management-plugin/1_create_datasource.spec.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js index f8c50a3f7..b57d3cda6 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/vis_type_table/embed.spec.js @@ -32,7 +32,7 @@ const commonUI = new CommonUI(cy); * Test that table visualization can filter out value. Same as filter for value. */ -describe('table visualization basic functions', () => { +describe('table visualization in embedded mode', () => { const expectedData = [ '0', '1,059', diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js index e0228bf28..ca789318b 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/datasource-management-plugin/1_create_datasource.spec.js @@ -42,9 +42,13 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) { it('with no auth and all required inputs', () => { cy.get('[name="dataSourceTitle"]').type('test_noauth'); cy.get('[name="endpoint"]').type(OSD_TEST_DOMAIN_ENDPOINT_URL); +<<<<<<< HEAD cy.get('[data-test-subj="createDataSourceFormAuthTypeSelect"]').select( 'no_auth' ); +======= + cy.get('[for="no_auth"]').click(); +>>>>>>> Fix multiple submit bug cy.getElementByTestId('createDataSourceButton').click(); cy.location('pathname', { timeout: 6000 }).should(