Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update cypress version #2288

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ module.exports = defineConfig({
},
baseUrl: "http://8-f48cf3a682-7fthvk.manager.dev.zesty.io:8080/",
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
testIsolation: false,
},
});
2 changes: 1 addition & 1 deletion cypress/e2e/schema/field.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ describe("Schema: Fields", () => {
cy.getBySelector(SELECTORS.FIELDS_LIST_NO_RESULTS).should("exist");

// Clear filter keyword
cy.get("@fieldListFilter").should("exist").clear();
cy.get("@fieldListFilter").should("exist").type("{selectall} {backspace}");
});

it("Can update a field", () => {
Expand Down
17 changes: 13 additions & 4 deletions cypress/e2e/settings/instance.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ describe("Instance", () => {
});

it("Developer", () => {
cy.get("[data-cy=SettingsNav]").contains("developer").click();
cy.getBySelector("InstanceSettingsTree")
.find(".MuiTreeItem-root")
.next()
.contains("Developer")
.click();
cy.get('[data-cy=SubApp] input[type="text"]')
.last()
.type("test test test")
.clear();

cy.get("[data-cy=SubApp] button").first().click({ force: true });
cy.get("#saveSettings").click({ force: true });

cy.get("#saveSettings").click({ force: true });
cy.contains(SAVED_MESSAGE).should("exist");
});

it("Contact Form", () => {
cy.get("[data-cy=SettingsNav]").contains("contact form").click();
cy.get("[data-cy=SubApp] input").first().type("fakeemail@example.com");
cy.getBySelector("InstanceSettingsTree")
.find(".MuiTreeItem-root")
.next()
.contains("Contact Form")
.click();
cy.get("[data-cy=SubApp] input").last().type("fakeemail@example.com");

cy.get("#saveSettings").click();
cy.contains(SAVED_MESSAGE).should("exist");
Expand Down
12 changes: 8 additions & 4 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import "./commands";
import "cypress-iframe";

// @see https://docs.cypress.io/api/cypress-api/cookies.html#Set-global-default-cookies
Cypress.Cookies.defaults({
preserve: Cypress.env("COOKIE_NAME"),
});
// Cypress.Cookies.defaults({
// preserve: Cypress.env("COOKIE_NAME"),
// });

// Turn off fail on console errors
Cypress.on("uncaught:exception", (err, runnable) => {
Expand All @@ -31,7 +31,11 @@ Cypress.on("uncaught:exception", (err, runnable) => {

// Before spec is ran
before(() => {
cy.login();
cy.session("COOKIE_NAME", cy.login, {
validate() {
cy.getCookies().should("have.length", 2);
},
});

// NOTE: we program the app to always select state from the store when available
// but often on an initial load that data is not present and deeply nested values will
Expand Down
Loading
Loading