From b9e2af398a814f24944f38dee687125bd8c3f064 Mon Sep 17 00:00:00 2001 From: Volodymyr Petrov Date: Mon, 26 Dec 2022 19:45:52 +0200 Subject: [PATCH 01/37] improve serviceTypeDropdownOption selector --- .../cypress/pages/createConnectorPage.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/airbyte-webapp-e2e-tests/cypress/pages/createConnectorPage.ts b/airbyte-webapp-e2e-tests/cypress/pages/createConnectorPage.ts index f2ae7a529c4c..44bee2632352 100644 --- a/airbyte-webapp-e2e-tests/cypress/pages/createConnectorPage.ts +++ b/airbyte-webapp-e2e-tests/cypress/pages/createConnectorPage.ts @@ -1,4 +1,5 @@ const selectTypeDropdown = "div[data-testid='serviceType']"; +const getServiceTypeDropdownOption = (serviceName: string) => `div[data-testid='${serviceName}']`; const nameInput = "input[name=name]"; const hostInput = "input[name='connectionConfiguration.host']"; const portInput = "input[name='connectionConfiguration.port']"; @@ -9,10 +10,11 @@ const pokemonNameInput = "input[name='connectionConfiguration.pokemon_name']"; const schemaInput = "[data-testid='tag-input'] input"; const destinationPathInput = "input[name='connectionConfiguration.destination_path']"; -export const selectServiceType = (type: string) => { - cy.get(selectTypeDropdown).click(); - cy.get("div").contains(type).click(); -}; +export const selectServiceType = (type: string) => + cy + .get(selectTypeDropdown) + .click() + .within(() => cy.get(getServiceTypeDropdownOption(type)).click()); export const enterName = (name: string) => { cy.get(nameInput).clear().type(name); From 1d465f097a6dbe501b2e6add909ce5e77f835d4f Mon Sep 17 00:00:00 2001 From: Volodymyr Petrov Date: Tue, 27 Dec 2022 15:34:14 +0200 Subject: [PATCH 02/37] add test ids to PathPopout component(s) --- .../connection/CatalogTree/PathPopout.tsx | 19 +++++++++++++++++-- .../CatalogTree/PathPopoutButton.tsx | 4 +++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/airbyte-webapp/src/components/connection/CatalogTree/PathPopout.tsx b/airbyte-webapp/src/components/connection/CatalogTree/PathPopout.tsx index 3e1bae6df130..dfb6ffbdfbab 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/PathPopout.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/PathPopout.tsx @@ -19,6 +19,7 @@ interface PathPopoutBaseProps { paths: Path[]; pathType: "required" | "sourceDefined"; placeholder?: React.ReactNode; + id?: string; } interface PathMultiProps { @@ -36,12 +37,21 @@ interface PathProps { type PathPopoutProps = PathPopoutBaseProps & (PathMultiProps | PathProps); export const PathPopout: React.FC = (props) => { + const pathPopoutId = `${props.id}_pathPopout`; + if (props.pathType === "sourceDefined") { if (props.path && props.path.length > 0) { const text = props.isMulti ? props.path.map(pathDisplayName).join(", ") : pathDisplayName(props.path); return ( - {text}}> + + {text} + + } + > {text} ); @@ -74,8 +84,13 @@ export const PathPopout: React.FC = (props) => { }} placeholder={props.placeholder} components={props.isMulti ? { MultiValue: () => null } : undefined} + id={pathPopoutId} targetComponent={({ onOpen }) => ( - + {text} )} diff --git a/airbyte-webapp/src/components/connection/CatalogTree/PathPopoutButton.tsx b/airbyte-webapp/src/components/connection/CatalogTree/PathPopoutButton.tsx index b7c685c5870b..1af6d7af3e1c 100644 --- a/airbyte-webapp/src/components/connection/CatalogTree/PathPopoutButton.tsx +++ b/airbyte-webapp/src/components/connection/CatalogTree/PathPopoutButton.tsx @@ -10,16 +10,18 @@ import styles from "./PathPopoutButton.module.scss"; interface PathPopoutButtonProps { items?: string[]; onClick: React.MouseEventHandler; + testId?: string; } export const PathPopoutButton: React.FC> = ({ items = [], onClick, children, + testId, }) => ( +