Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit e58b94f

Browse files
committed
basic login page check for elements test
1 parent b188f85 commit e58b94f

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import page from '../../pages/login';
2+
3+
describe('Login Page', () => {
4+
it('should show the header, login box , and all login box elements', () => {
5+
cy.visit('/login');
6+
cy.get(page.header).should('be.visible');
7+
cy.get(page.loginBox).should('be.visible');
8+
cy.get(page.email).should('be.visible');
9+
cy.get(page.password).should('be.visible');
10+
cy.get(page.login).should('be.visible');
11+
cy.get(page.forgotPassword).should('be.visible');
12+
cy.get(page.register).should('be.visible');
13+
cy.get(page.forgotPasswordLink).should('have.attr', 'href', '/reset');
14+
cy.get(page.registerLink).should('have.attr', 'href', '/register');
15+
});
16+
})

cypress/pages/login.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default {
2+
header: '.cd-login__header',
3+
loginBox: '.cd-login__box',
4+
email: 'input[type=email]',
5+
password: 'input[type=password]',
6+
login: 'input[type=submit]',
7+
register: '.cd-login__register',
8+
forgotPassword: '.cd-login__forgot-password',
9+
emailReqError: '.cd-login__email-req-err',
10+
emailFormatError: '.cd-login__email-format-err',
11+
passwordReqError: '.cd-login__password-req-err',
12+
loginFailed: '.cd-login__login-failed',
13+
registerLink: '.cd-login__register a',
14+
forgotPasswordLink: '.cd-login__forgot-password a',
15+
};

0 commit comments

Comments
 (0)