Skip to content

Commit

Permalink
Added testId and made some changes to test
Browse files Browse the repository at this point in the history
  • Loading branch information
antowaddle committed Jan 27, 2025
1 parent c46ad8c commit c2391d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions frontend/src/__tests__/cypress/cypress/pages/dataConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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();
Expand Down

0 comments on commit c2391d1

Please sign in to comment.