Delete notifications before test
This commit is contained in:
parent
e6a5af56a8
commit
c715a462d9
|
|
@ -9,7 +9,6 @@ describe("notification list page", () => {
|
||||||
it("can paginate notifications", () => {
|
it("can paginate notifications", () => {
|
||||||
login("admin", "test");
|
login("admin", "test");
|
||||||
cy.visit("/notifications");
|
cy.visit("/notifications");
|
||||||
cy.wait(2000);
|
|
||||||
|
|
||||||
cy.get('[data-cy="no-notifications"]').should("not.exist");
|
cy.get('[data-cy="no-notifications"]').should("not.exist");
|
||||||
cy.get("[data-cy^=notification-idx-]").should("have.length", 7);
|
cy.get("[data-cy^=notification-idx-]").should("have.length", 7);
|
||||||
|
|
@ -22,7 +21,7 @@ describe("notification list page", () => {
|
||||||
|
|
||||||
// We load additional 7 notifications
|
// We load additional 7 notifications
|
||||||
cy.get('[data-cy="load-more-notifications"]').click();
|
cy.get('[data-cy="load-more-notifications"]').click();
|
||||||
cy.get("[data-cy^=notification-idx-]").should("have.length", 14);
|
cy.get("[data-cy^=notification-idx-]").should("have.length", 13);
|
||||||
|
|
||||||
for (let i = 0; i < 7; i++) {
|
for (let i = 0; i < 7; i++) {
|
||||||
cy.get(`[data-cy=notification-idx-${i}]`).within(() => {
|
cy.get(`[data-cy=notification-idx-${i}]`).within(() => {
|
||||||
|
|
@ -65,7 +64,6 @@ describe("notification popover", () => {
|
||||||
it("displays four notifications", () => {
|
it("displays four notifications", () => {
|
||||||
login("admin", "test");
|
login("admin", "test");
|
||||||
cy.visit("/");
|
cy.visit("/");
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
toggleNotificationPopover();
|
toggleNotificationPopover();
|
||||||
cy.get("[data-cy^=notification-idx-]").should("have.length", 4);
|
cy.get("[data-cy^=notification-idx-]").should("have.length", 4);
|
||||||
|
|
@ -74,7 +72,6 @@ describe("notification popover", () => {
|
||||||
it("can show all notifications", () => {
|
it("can show all notifications", () => {
|
||||||
login("admin", "test");
|
login("admin", "test");
|
||||||
cy.visit("/");
|
cy.visit("/");
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
toggleNotificationPopover();
|
toggleNotificationPopover();
|
||||||
cy.get('[data-cy="show-all-notifications"]').click({ force: true });
|
cy.get('[data-cy="show-all-notifications"]').click({ force: true });
|
||||||
|
|
@ -111,6 +108,7 @@ describe("email notification settings", () => {
|
||||||
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
|
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
|
||||||
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
|
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
|
||||||
|
|
||||||
|
cy.wait(500);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
|
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
|
||||||
"have.class",
|
"have.class",
|
||||||
|
|
@ -128,6 +126,7 @@ describe("email notification settings", () => {
|
||||||
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
|
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').click();
|
||||||
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
|
cy.get('[data-cy="it-checkbox-INFORMATION"]').click();
|
||||||
|
|
||||||
|
cy.wait(500);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
|
cy.get('[data-cy="it-checkbox-USER_INTERACTION"]').should(
|
||||||
"have.class",
|
"have.class",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ from vbv_lernwelt.notify.models import Notification
|
||||||
def command(create_completion):
|
def command(create_completion):
|
||||||
print("cypress reset data")
|
print("cypress reset data")
|
||||||
CourseCompletion.objects.all().delete()
|
CourseCompletion.objects.all().delete()
|
||||||
Notification.objects.all().mark_all_as_deleted()
|
Notification.objects.all().delete()
|
||||||
AssignmentCompletion.objects.all().delete()
|
AssignmentCompletion.objects.all().delete()
|
||||||
User.objects.all().update(language="de")
|
User.objects.all().update(language="de")
|
||||||
User.objects.all().update(additional_json_data={})
|
User.objects.all().update(additional_json_data={})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue