2019-10-05 19:07:50 +02:00
|
|
|
// https://docs.cypress.io/api/introduction/api.html
|
2020-02-18 08:57:00 +01:00
|
|
|
import onBeforeLoad from "./browser-language";
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
describe("Homepage", () => {
|
|
|
|
it("Checks the footer", () => {
|
|
|
|
cy.visit("/", { onBeforeLoad });
|
|
|
|
cy.get("#mobilizon").find("footer").contains("The Mobilizon Contributors");
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-11-30 10:24:11 +01:00
|
|
|
cy.contains("About")
|
|
|
|
.should("have.attr", "href")
|
|
|
|
.and("eq", "https://joinmobilizon.org");
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
cy.contains("License")
|
|
|
|
.should("have.attr", "href")
|
2021-11-09 09:12:04 +01:00
|
|
|
.and("eq", "https://framagit.org/framasoft/mobilizon/blob/main/LICENSE");
|
2019-10-05 19:07:50 +02:00
|
|
|
});
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
it("Tries to register from the hero section", () => {
|
|
|
|
cy.visit("/", { onBeforeLoad });
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
cy.get(".hero-body").contains("Sign up").click();
|
|
|
|
cy.url().should("include", "/register/user");
|
2019-10-05 19:07:50 +02:00
|
|
|
});
|
2020-02-18 08:57:00 +01:00
|
|
|
it("Tries to register from the navbar", () => {
|
|
|
|
cy.visit("/", { onBeforeLoad });
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
cy.get("nav.navbar").contains("Sign up").click();
|
|
|
|
cy.url().should("include", "/register/user");
|
2019-10-05 19:07:50 +02:00
|
|
|
});
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
it("Tries to connect from the navbar", () => {
|
|
|
|
cy.visit("/", { onBeforeLoad });
|
2019-10-05 19:07:50 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
cy.get("nav.navbar").contains("Log in").click();
|
|
|
|
cy.url().should("include", "/login");
|
2019-10-05 19:07:50 +02:00
|
|
|
});
|
|
|
|
});
|