diff --git a/cypress/e2e/notifications.cy.js b/cypress/e2e/notifications.cy.js index 75ff5fd8..8fd20b52 100644 --- a/cypress/e2e/notifications.cy.js +++ b/cypress/e2e/notifications.cy.js @@ -1,6 +1,6 @@ import { login } from "./helpers"; -describe("notifications.cy.js", () => { +describe("notification list page", () => { beforeEach(() => { cy.manageCommand("cypress_reset"); cy.manageCommand("create_default_notifications"); @@ -9,6 +9,7 @@ describe("notifications.cy.js", () => { it("can paginate notifications", () => { login("admin", "test"); cy.visit("/notifications"); + cy.wait(2000); cy.get('[data-cy="no-notifications"]').should("not.exist"); cy.get("[data-cy^=notification-idx-]").should("have.length", 7); @@ -21,8 +22,7 @@ describe("notifications.cy.js", () => { // We load additional 7 notifications cy.get('[data-cy="load-more-notifications"]').click(); - cy.get("[data-cy^=notification-idx-]").should("have.length", 13); - cy.get('[data-cy="load-more-notifications"]').should("not.exist"); + cy.get("[data-cy^=notification-idx-]").should("have.length", 14); for (let i = 0; i < 7; i++) { cy.get(`[data-cy=notification-idx-${i}]`).within(() => { @@ -109,6 +109,9 @@ describe("email notification settings", () => { cy.get('[data-cy="it-checkbox-USER_INTERACTION"]') .should("exist") .check({ force: true }); + cy.get('[data-cy="it-checkbox-USER_INTERACTION"]') + .should("exist") + .should("be.checked"); cy.reload(); cy.wait(1000); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index d884523d..8c7c5821 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -55,15 +55,17 @@ const _ = Cypress._; Cypress.Commands.add("manageCommand", (command, preCommand = "") => { const execCommand = `${preCommand} python server/manage.py ${command} --settings=config.settings.test_cypress`; console.log(execCommand); + // hack to add my asdf python instance to the path + // so I can run the test directly from within IntelliJ + let pythonPaths = [ + "/Users/daniel/workspace/vbv_lernwelt/.direnv/python-3.10.6/bin", + "/Users/eliabieri/iterativ/vbv_lernwelt/.direnv/python-3.10.6/bin", + ]; + let bashCommand = `PATH=${pythonPaths.join(":")}:$PATH && ${execCommand}`; return cy - .exec( - // hack to add my asdf python instance to the path - // so I can run the test directly from within IntelliJ - `PATH=/Users/daniel/workspace/vbv_lernwelt/.direnv/python-3.10.6/bin:$PATH && ${execCommand}`, - { - failOnNonZeroExit: false, - } - ) + .exec(`bash -c "${bashCommand}"`, { + failOnNonZeroExit: true, + }) .then((result) => { if (result.code) { throw new Error(`Execution of "${command}" failed