From c2391d1d98fd0b5a133e917a284b514a4b7dde8d Mon Sep 17 00:00:00 2001 From: Anthony Coughlin Date: Mon, 27 Jan 2025 15:29:19 +0000 Subject: [PATCH] Added testId and made some changes to test --- .../cypress/cypress/pages/dataConnection.ts | 12 ++++++++---- .../connections/testDataConnectionCreation.cy.ts | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/__tests__/cypress/cypress/pages/dataConnection.ts b/frontend/src/__tests__/cypress/cypress/pages/dataConnection.ts index a762b65fbf..f3e3f15f9e 100644 --- a/frontend/src/__tests__/cypress/cypress/pages/dataConnection.ts +++ b/frontend/src/__tests__/cypress/cypress/pages/dataConnection.ts @@ -2,12 +2,16 @@ import { Modal } from './components/Modal'; class DataConnectionModal extends Modal { constructor(edit = false) { - const title = edit ? 'Edit connection' : 'Add connection'; - super(title); + const titles = [ + edit ? 'Edit connection' : 'Add connection', + `${edit ? 'Edit' : 'Add'} data connection`, + ]; + + super(titles[0]); } - findTypeaheadMenuToggle() { - return cy.get('[aria-label="Typeahead menu toggle"]'); + findConnectionTypeDropdown() { + return this.find().findByTestId('connection-type-dropdown'); } findS3CompatibleStorageOption() { diff --git a/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/connections/testDataConnectionCreation.cy.ts b/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/connections/testDataConnectionCreation.cy.ts index 3ac269f4f2..22d482607e 100644 --- a/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/connections/testDataConnectionCreation.cy.ts +++ b/frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/connections/testDataConnectionCreation.cy.ts @@ -75,7 +75,7 @@ describe('Verify Data Connections - Creation and Deletion', () => { // Enter validate Data Connection details into the Data Connection Modal cy.step('Enter valid Data Connection details and verify creation'); - addDataConnectionModal.findTypeaheadMenuToggle().click(); + addDataConnectionModal.findConnectionTypeDropdown().click(); addDataConnectionModal.findS3CompatibleStorageOption().click(); addDataConnectionModal.findConnectionNameInput().type(s3Config.NAME); addDataConnectionModal.findConnectionDescriptionInput().type('S3 Bucket Connection'); @@ -85,12 +85,12 @@ describe('Verify Data Connections - Creation and Deletion', () => { addDataConnectionModal.findRegionInput().type(s3Config.REGION); addDataConnectionModal.findBucketInput().type(s3Config.NAME); addDataConnectionModal.findCreateButton().click(); + connectionsPage.getConnectionRow(s3Config.NAME).find().should('exist'); // Delete the Data Connection and confirm that the deletion was successful cy.step('Delete the Data Connection and verify deletion'); - connectionsPage.getConnectionRow(s3Config.NAME).find().should('exist'); connectionsPage.findKebabToggle().click(); - connectionsPage.findDeleteButton().click(); + connectionsPage.getConnectionRow(s3Config.NAME).findKebabAction('Delete').click(); deleteModal.shouldBeOpen(); deleteModal.findInput().type(s3Config.NAME); deleteModal.findSubmitButton().should('be.enabled').click();