Skip to content

Commit

Permalink
🪟 🚦 E2E tests: clean up matchers (#20887)
Browse files Browse the repository at this point in the history
* improve serviceTypeDropdownOption selector

* add test ids to PathPopout component(s)

* add unique id's to table dropdowns

* extend submitButtonClick to support optional click options

* update dropdown(pathPopout) matchers

* add test-id to Overlay component

* remove redundant function brackets

* revert changes onSubmit button click

* fix dropDown overlay issue

* move all duplicated intercepters to beforeEach

* add test id's to Connections, Sources and Destinations tables

* add table helper functions

* update source page actions

* intercepter fixes

* update createTestConnection function with optional replication settings

* remove extra Connection name check

* replace "cypress-postgres" with "pg-promise" npm package

* update cypress config

* Revert "update createTestConnection function with optional replication settings"

This reverts commit 8e47c78.

* Revert "remove extra Connection name check"

This reverts commit dfb19c7.

* replace openSourceDestinationFromGrid with specific selector

* replace openSourceDestinationFromGrid with specific selector

* turn on test

* add test-id's

* fix selectors

* update test

* update test snapshots

* fix lost data-testid after resolve merge conflicts

* remove extra check

* move clickOnCellInTable helper to common.ts file

* remove empty line and comments

* fix dropdownType

* replace partial string check with exact

* extract interceptors and waiters to separate file

* fix selector for predefined PK

* fix selector

* add comment regarding dropdown
  • Loading branch information
dizel852 authored Jan 19, 2023
1 parent 4991e95 commit 7f33f39
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 143 deletions.
18 changes: 18 additions & 0 deletions airbyte-webapp-e2e-tests/cypress/commands/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ export const appendRandomString = (string: string) => {
const randomString = Math.random().toString(36).substring(2, 10);
return `${string} _${randomString}`;
};

/**
* Click on specific cell found by column name in desired table
* @param tableSelector - table selector
* @param columnName - column name
* @param connectName - cell text
*/
export const clickOnCellInTable = (tableSelector: string, columnName: string, connectName: string) => {
cy.contains(`${tableSelector} th`, columnName)
.invoke("index")
.then((value) => {
cy.log(`${value}`);
return cy.wrap(value);
})
.then((columnIndex) => {
cy.contains("tbody tr", connectName).find("td").eq(columnIndex).click();
});
};
6 changes: 6 additions & 0 deletions airbyte-webapp-e2e-tests/cypress/commands/interceptors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const interceptGetConnectionRequest = () => cy.intercept("/api/v1/web_backend/connections/get").as("getConnection")
export const waitForGetConnectionRequest = () => cy.wait("@getConnection");

export const interceptUpdateConnectionRequest = () =>
cy.intercept("/api/v1/web_backend/connections/update").as("updateConnection");
export const waitForUpdateConnectionRequest = () => cy.wait("@updateConnection", { timeout: 10000 });
Loading

0 comments on commit 7f33f39

Please sign in to comment.