forked from makersacademy/acebook-mern-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from abodian/fix-failing-cypress-post-tests
cypress making post e2e test passes
- Loading branch information
Showing
1 changed file
with
11 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
describe("Signing up", () => { | ||
describe("post function", () => { | ||
|
||
before(() => { | ||
cy.signup("[email protected]", "password", "John", "Smith") | ||
}) | ||
|
||
it("tests to see if the post button and box works properly", () => { | ||
// need to login in from the login page | ||
cy.visit('http://localhost:3000/signup'); | ||
cy.get('#email').click(); | ||
cy.get('#email').type('[email protected]'); | ||
cy.get('#password').type('password1234'); | ||
cy.get('#firstName').type('james'); | ||
cy.get('#lastName').type('james'); | ||
cy.get('#submit').click(); | ||
cy.get('form').submit(); | ||
cy.get('#email').click(); | ||
cy.get('#email').type('[email protected]'); | ||
cy.get('#password').type('password1234'); | ||
cy.get('#submit').click(); | ||
cy.get('form').submit(); | ||
cy.get('#message').click(); | ||
cy.visit('/login'); | ||
cy.get("#email").type("[email protected]"); | ||
cy.get("#password").type("password"); | ||
cy.get("#submit").click(); | ||
cy.get('#message').type('cypress test 2'); | ||
cy.get('#submit').click(); | ||
cy.url().should('contains', 'http://localhost:3000/posts'); | ||
cy.url().should('include', '/posts'); | ||
cy.get('#feed').should('contain', 'cypress test 2') | ||
}) | ||
}) |