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

Add some cypress tests #4

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"baseUrl": "http://localhost:3000"
}
40 changes: 40 additions & 0 deletions cypress/integration/sample_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
describe("The Home Page", () => {
it("successfully loads a spaces detail page", () => {
cy.visit("/"); // change URL to match your dev URL

cy.contains("Visit space").click();

cy.url().should("include", "/spaces/");
});

it("successfully logs in a user", () => {
cy.visit("/"); // change URL to match your dev URL

cy.contains("Login").click();

cy.get("#formBasicEmail").type("[email protected]");
cy.get("#formBasicPassword").type("1234");

cy.contains("Log in").click();

cy.get(".logged-in-nav-item").contains("[email protected]");
});

it("successfully creates in a user", () => {
const email = "domenico" + Date.now() + "@codaisseur.com";

cy.visit("/"); // change URL to match your dev URL

cy.contains("Login").click();

cy.contains("Click here to sign up").click();

cy.get("#formBasicEmail").type(email);
cy.get("#formBasicName").type("Dom");
cy.get("#formBasicPassword").type("1234");

cy.contains("Sign up").click();

cy.get(".logged-in-nav-item").contains(email);
});
});
Loading