Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
tiny test
  • Loading branch information
gary-walker committed Jul 10, 2024
1 parent f01f393 commit 79fbbb8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
21 changes: 15 additions & 6 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/// <reference types="cypress" />
describe('page', () => {
it('works', () => {
cy.visit('https://example.cypress.io')
})
})
import LoginPage from '../pages/pageObject.cy.js';

describe('Login Flow', () => {
it('should log in successfully', () => {
const loginPage = new LoginPage();
const email = "[email protected]";
const password = "password";

loginPage.visitSignInPage();
loginPage.fillEmail(email);
loginPage.fillPassword(password);
loginPage.clickLoginButton();
loginPage.isSignedIn();
});
});
30 changes: 30 additions & 0 deletions cypress/page/pageObject.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const emailInput = 'input[name="email"]';
const passwordInput = 'input[type="password"]';
const loginButton = '._flexButton_2u3cq_1._blue_2u3cq_42._outline_2u3cq_20';

class LoginPage {
visitSignInPage() {
const signInPageUrl = 'http://app.yourdocket.com/signin';
cy.visit(signInPageUrl);
cy.url().should('include', '/signin');
}

fillEmail(email) {
cy.get(emailInput).type(email);
}

fillPassword(password) {
cy.get(passwordInput).type(password);
}

clickLoginButton() {
cy.get(loginButton).first().click();
}

isSignedIn() {
cy.url().should('include', '/today');
}
}

export default LoginPage;

0 comments on commit 79fbbb8

Please sign in to comment.