1
0
mirror of synced 2026-01-05 21:02:13 -05:00
Files
airbyte/airbyte-webapp-e2e-tests/cypress/commands/common.ts
Lake Mossman 0ff7234504 make FE E2E tests more reliable (#16759)
* make tests more reliable

* switch back to localhost

* run test 100 times

* pass props through to Text element

* ensure names are unique from one test run to the next

* fix test result check
2022-09-17 11:21:44 -07:00

36 lines
981 B
TypeScript

export const submitButtonClick = () => {
cy.get("button[type=submit]").click();
};
export const updateField = (field: string, value: string) => {
cy.get("input[name='" + field + "']")
.clear()
.type(value);
};
export const openSettingForm = (name: string) => {
cy.get("div").contains(name).click();
cy.get("div[data-id='settings-step']").click();
};
export const deleteEntity = () => {
cy.get("button[data-id='open-delete-modal']").click();
cy.get("button[data-id='delete']").click();
};
export const clearApp = () => {
indexedDB.deleteDatabase("firebaseLocalStorageDb");
cy.clearLocalStorage();
cy.clearCookies();
};
export const fillEmail = (email: string) => {
cy.get("input[name=email]").type(email);
};
// useful for ensuring that a name is unique from one test run to the next
export const appendRandomString = (string: string) => {
const randomString = Math.random().toString(36).substring(2,10);
return string + " _" + randomString;
}