Skip to content

Commit 5ffc880

Browse files
authored
Some updated for e2e tests (#9091)
1 parent 954929a commit 5ffc880

File tree

10 files changed

+72
-12
lines changed

10 files changed

+72
-12
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
declare global {
2+
namespace Cypress {
3+
interface Chainable {
4+
clearApp(): Chainable<Element>;
5+
6+
// sidebar
7+
8+
openSettings(): Chainable<Element>;
9+
}
10+
}
11+
}

airbyte-webapp-e2e-tests/cypress/support/commands/common.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ Cypress.Commands.add("deleteEntity", () => {
5555
cy.get("button[data-id='open-delete-modal']").click();
5656
cy.get("button[data-id='delete']").click();
5757
})
58+
59+
Cypress.Commands.add("clearApp", () => {
60+
indexedDB.deleteDatabase("firebaseLocalStorageDb");
61+
cy.clearLocalStorage();
62+
cy.clearCookies();
63+
});
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "./common";
2+
import "./sidebar";
23
import "./source";
34
import "./destination";
45
import "./connection";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Cypress.Commands.add("openSettings", () => {
2+
cy.get("nav a[href*='settings']").click();
3+
});

airbyte-webapp-e2e-tests/package-lock.json

Lines changed: 21 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-webapp-e2e-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"cypress": "^9.2.0",
23+
"typescript": "^4.5.4",
2324
"eslint-plugin-cypress": "^2.12.1"
2425
}
2526
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"include": ["./**/*.ts"],
3+
"exclude": [],
4+
"compilerOptions": {
5+
"baseUrl": "src",
6+
"target": "es5",
7+
"skipLibCheck": true,
8+
"esModuleInterop": true,
9+
"allowSyntheticDefaultImports": true,
10+
"strict": true,
11+
"forceConsistentCasingInFileNames": true,
12+
"module": "esnext",
13+
"moduleResolution": "node",
14+
"resolveJsonModule": true,
15+
"jsx": "react-jsx",
16+
"noFallthroughCasesInSwitch": true,
17+
"types": ["cypress"],
18+
"lib": ["es2015", "dom"],
19+
"isolatedModules": false,
20+
"allowJs": true,
21+
"noEmit": true
22+
}
23+
}

airbyte-webapp/src/components/SideMenu/SideMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type SideMenuItem = {
88
name: string | React.ReactNode;
99
indicatorCount?: number;
1010
component: React.ComponentType<any>;
11-
testId?: string;
11+
id?: string;
1212
};
1313

1414
export type CategoryItem = {
@@ -49,7 +49,7 @@ const SideMenu: React.FC<SideMenuProps> = ({ data, onSelect, activeItem }) => {
4949
)}
5050
{categoryItem.routes.map((route) => (
5151
<MenuItem
52-
testId={route.testId}
52+
id={route.id}
5353
key={route.path}
5454
name={route.name}
5555
isActive={activeItem?.endsWith(route.path)}

airbyte-webapp/src/components/SideMenu/components/MenuItem.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type IProps = {
55
name: string | React.ReactNode;
66
isActive?: boolean;
77
count?: number;
8-
testId?: string;
8+
id?: string;
99
onClick: () => void;
1010
};
1111

@@ -40,15 +40,9 @@ const Counter = styled.div`
4040
margin-left: 5px;
4141
`;
4242

43-
const MenuItem: React.FC<IProps> = ({
44-
count,
45-
isActive,
46-
name,
47-
testId,
48-
onClick,
49-
}) => {
43+
const MenuItem: React.FC<IProps> = ({ count, isActive, name, id, onClick }) => {
5044
return (
51-
<Item data-testid={testId} isActive={isActive} onClick={onClick}>
45+
<Item data-testid={id} isActive={isActive} onClick={onClick}>
5246
{name}
5347
{count ? <Counter>{count}</Counter> : null}
5448
</Item>

airbyte-webapp/src/packages/cloud/views/settings/CloudSettingsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const CloudSettingsPage: React.FC = () => {
7272
path: CloudSettingsRoutes.AccessManagement,
7373
name: <FormattedMessage id="settings.accessManagementSettings" />,
7474
component: UsersSettingsView,
75+
id: "workspaceSettings.accessManagementSettings",
7576
},
7677
{
7778
path: CloudSettingsRoutes.Notifications,

0 commit comments

Comments
 (0)