Skip to content

Commit

Permalink
Merge pull request #10 from abodian/fix-failing-cypress-post-tests
Browse files Browse the repository at this point in the history
cypress making post e2e test passes
  • Loading branch information
JamesJPaterson authored Feb 10, 2023
2 parents 2e6d054 + 2c837d8 commit e58a989
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions frontend/cypress/e2e/making_a_post.cy.js
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')
})
})

0 comments on commit e58a989

Please sign in to comment.