* 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 commit8e47c7837b. * Revert "remove extra Connection name check" This reverts commitdfb19c7dd4. * 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
29 lines
817 B
TypeScript
29 lines
817 B
TypeScript
import { clickOnCellInTable } from "commands/common";
|
|
|
|
const newSource = "button[data-id='new-source']";
|
|
const sourcesTable = "table[data-testid='sourcesTable']";
|
|
const sourceNameColumn = "Name";
|
|
|
|
export const goToSourcePage = () => {
|
|
cy.intercept("/api/v1/sources/list").as("getSourcesList");
|
|
cy.visit("/source");
|
|
cy.wait(3000);
|
|
};
|
|
|
|
export const openSourceDestinationFromGrid = (value: string) => {
|
|
cy.get("div").contains(value).click();
|
|
};
|
|
|
|
export const openSourceOverview = (sourceName: string) => {
|
|
clickOnCellInTable(sourcesTable, sourceNameColumn, sourceName);
|
|
};
|
|
|
|
export const openNewSourceForm = () => {
|
|
cy.wait("@getSourcesList").then(({ response }) => {
|
|
if (response?.body.sources.length) {
|
|
cy.get(newSource).click();
|
|
}
|
|
});
|
|
cy.url().should("include", `/source/new-source`);
|
|
};
|