Skip to content

Commit

Permalink
[ci] Revise tests to improve tests stability
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 24, 2024
1 parent be5c611 commit 2bd0a7e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions client/cypress/e2e/02-test-admin-perform-wizard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe("globaLeaks setup wizard", () => {

cy.takeScreenshot("wizard/6");
cy.get('button[name="proceed"]').should('be.visible').click();

cy.waitForUrl("admin/home")
cy.logout();
});
Expand Down
11 changes: 6 additions & 5 deletions client/cypress/e2e/06-test-admin-configure-advanced.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ describe("admin disable submissions", () => {
cy.get('input[name="disable_submissions"]').should("be.visible").should("be.checked");
cy.logout();
cy.waitForUrl("/#/login")

cy.visit("/#/");
cy.get("#submissions_disabled").should("be.visible");

});
});

describe("admin enable submissions", () => {
it("should enable submission", () => {
cy.login_admin();
cy.waitForUrl("/#/admin/home")
cy.visit("/#/admin/settings")
cy.get('[data-cy="advanced"]').click().should("be.visible").click();

Expand All @@ -51,7 +50,6 @@ describe("admin enable submissions", () => {
describe("Should browser opens a pop while clicking the support icon", () => {
it("should open a pop-up modal", () => {
cy.login_admin();
cy.waitForUrl("/#/admin/home");
cy.visit("/#/admin/settings");
cy.get('[data-cy="advanced"]').click().should("be.visible").click();

Expand All @@ -74,7 +72,6 @@ describe("Should browser opens a pop while clicking the support icon", () => {

cy.get('#modal-action-cancel').should('be.visible').click();
cy.logout();
cy.waitForUrl('/login');
});
});

Expand All @@ -96,7 +93,6 @@ describe("Validating custom support url", () => {
.invoke("val")
.should("equal", "https://www.globaleaks.org/");
cy.logout();

});
});
describe("admin enable scoring system", () => {
Expand All @@ -116,9 +112,14 @@ describe("admin add and remove disclaimer", function () {
cy.visit("/#/admin/settings");
cy.get('textarea[name="nodeResolver.dataModel.disclaimer_text"]').type("disclaimer_text");
cy.get("#save_settings").click();

cy.logout();
cy.waitForUrl('/#/login');

cy.visit("/#/");
cy.get("#WhistleblowingButton").click();
cy.get('#modal-action-ok').click();

cy.login_admin();
cy.visit("/#/admin/settings");
cy.get('textarea[name="nodeResolver.dataModel.disclaimer_text"]').clear();
Expand Down
3 changes: 1 addition & 2 deletions client/cypress/e2e/09-test-simple-login.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
describe("configure simple login", () => {
it("should configure simple login", function () {
cy.login_admin();
cy.waitForUrl("/#/admin/home");
cy.visit("/#/admin/settings");
cy.get('[data-cy="advanced"]').click().should("be.visible").click();
cy.get('input[name="node.dataModel.simplified_login"]').click();
Expand All @@ -19,4 +18,4 @@ describe("configure simple login", () => {
cy.get("#save").click();
cy.logout();
});
});
});
4 changes: 3 additions & 1 deletion client/cypress/e2e/18-test-globaleaks-process.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ describe("globaleaks process", function () {

it("Recipient actions ", function () {
cy.login_receiver();
cy.waitForUrl("/#/recipient/home");

cy.visit("/#/recipient/reports");
cy.waitForUrl("/#/recipient/reports");
cy.takeScreenshot("/recipient/reports");

cy.get("#tip-0").should('be.visible').first().click();

Expand Down
2 changes: 2 additions & 0 deletions client/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ Cypress.Commands.add("takeScreenshot", (filename: string, locator?: string) => {
return cy.document().then((doc) => {
cy.viewport(1920, doc.body.scrollHeight);

cy.wait(1000);

cy.waitForPageIdle();

if (locator && locator !== ".modal") {
Expand Down
Binary file modified documentation/images/whistleblower/home.fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/images/whistleblower/receipt.fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/images/whistleblower/submission.fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bd0a7e

Please sign in to comment.