-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate cypress tests and commands to TypeScript (#13091)
* Migrate cypress tests and commands to TypeScript * Cypress added plugins to tsconfig * Update cypress plugins file to .ts
- Loading branch information
Showing
22 changed files
with
153 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ yarn-error.log* | |
/cypress/screenshots | ||
/cypress/videos | ||
/cypress/fixtures | ||
/cypress/downloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { deleteEntity, fillTestLocalJsonForm, openDestinationPage, openNewDestinationForm, openSettingForm, submitButtonClick, updateField } from "./common"; | ||
|
||
export const createTestDestination = (name: string) => { | ||
cy.intercept("/api/v1/scheduler/destinations/check_connection").as("checkDestinationConnection"); | ||
cy.intercept("/api/v1/destinations/create").as("createDestination"); | ||
|
||
openNewDestinationForm(); | ||
fillTestLocalJsonForm(name); | ||
submitButtonClick(); | ||
|
||
cy.wait("@checkDestinationConnection"); | ||
cy.wait("@createDestination"); | ||
} | ||
|
||
export const updateDestination = (name: string, field: string, value: string) => { | ||
cy.intercept("/api/v1/destinations/check_connection_for_update").as("checkDestinationUpdateConnection"); | ||
cy.intercept("/api/v1/destinations/update").as("updateDestination"); | ||
|
||
openDestinationPage(); | ||
openSettingForm(name); | ||
updateField(field, value); | ||
submitButtonClick(); | ||
|
||
cy.wait("@checkDestinationUpdateConnection"); | ||
cy.wait("@updateDestination"); | ||
} | ||
|
||
export const deleteDestination = (name: string) => { | ||
openDestinationPage(); | ||
openSettingForm(name); | ||
deleteEntity(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const openSettings = () => { | ||
cy.get("nav a[href*='settings']").click(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
declare global { | ||
namespace Cypress { | ||
interface Chainable { | ||
clearApp(): Chainable<Element>; | ||
|
||
// sidebar | ||
|
||
openSettings(): Chainable<Element>; | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
airbyte-webapp-e2e-tests/cypress/integration/destination.spec.js
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
airbyte-webapp-e2e-tests/cypress/integration/destination.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createTestDestination, deleteDestination, updateDestination } from "commands/destination"; | ||
import { initialSetupCompleted } from "commands/workspaces"; | ||
|
||
describe("Destination main actions", () => { | ||
beforeEach(() => { | ||
initialSetupCompleted(); | ||
}); | ||
|
||
it("Create new destination", () => { | ||
createTestDestination("Test destination cypress"); | ||
|
||
cy.url().should("include", `/destination/`); | ||
}); | ||
|
||
it("Update destination", () => { | ||
createTestDestination("Test destination cypress for update"); | ||
updateDestination("Test destination cypress for update", "connectionConfiguration.destination_path", "/local/my-json"); | ||
|
||
cy.get("div[data-id='success-result']").should("exist"); | ||
cy.get("input[value='/local/my-json']").should("exist"); | ||
}); | ||
|
||
it("Delete destination", () => { | ||
createTestDestination("Test destination cypress for delete"); | ||
deleteDestination("Test destination cypress for delete"); | ||
|
||
cy.visit("/destination"); | ||
cy.get("div").contains("Test destination cypress for delete").should("not.exist"); | ||
}); | ||
}); |
9 changes: 6 additions & 3 deletions
9
...ts/cypress/integration/onboarding.spec.js → ...ts/cypress/integration/onboarding.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.