generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: create login test cases and update PR files (#37)
* test: create login test cases and update PR files * tests: fix env name for cypress variables * tests: cypress env vars attempt * tests: fix cypress env action * tests: cypress with react app env vars --------- Co-authored-by: Ricardo Campos <ricardo.campos@encora.com>
- Loading branch information
1 parent
1c62c92
commit 9d55c6f
Showing
13 changed files
with
112 additions
and
157 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
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
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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
describe('Login page test', () => { | ||
|
||
let loginPageData: { | ||
title: string, | ||
subtitle: string, | ||
description: string | ||
}; | ||
|
||
beforeEach(() => { | ||
cy.visit('/'); | ||
|
||
// Clear cookies and local storage | ||
cy.clearCookies({ log: true }) | ||
cy.clearLocalStorage({ log: true }) | ||
|
||
// Loading test data | ||
cy.fixture('login-page').then((ttls) => { | ||
loginPageData = ttls; | ||
}); | ||
|
||
}); | ||
|
||
it('login page is displayed and loads correctly', () => { | ||
cy.getByDataTest('landing-title').should('have.text', loginPageData.title); | ||
cy.getByDataTest('landing-subtitle').should('have.text', loginPageData.subtitle); | ||
cy.getByDataTest('landing-desc').should('have.text', loginPageData.description); | ||
}); | ||
|
||
it('navigate to the user form page IDIR', () => { | ||
cy.getByDataTest('landing-button__idir').click(); | ||
cy.get('#idirLogo').should('be.visible'); | ||
}); | ||
|
||
it('navigate to the user form page BCeID', () => { | ||
cy.getByDataTest('landing-button__bceid').click(); | ||
cy.get('#bceidLogo').should('be.visible'); | ||
}); | ||
|
||
it('try to access system using a link without user connected', () => { | ||
cy.visit('https://nrsparwebapp-test-app.apps.silver.devops.gov.bc.ca/dashboard'); | ||
cy.getByDataTest('landing-title').should('have.text', loginPageData.title); | ||
}); | ||
|
||
it.skip('log in with BCeID and validate if after timeout the user is disconnected', () => { | ||
cy.login(); | ||
cy.wait(1800000); //wait for 30 minutes 1800000 | ||
cy.getByDataTest('landing-title').should('have.text', loginPageData.title); | ||
}); | ||
|
||
it('log in with BCeID and validate user role', () => { | ||
cy.login(); | ||
cy.getByDataTest('header-button__user').click(); | ||
cy.get('.user-data').find('p').contains('IDIR: undefined'); | ||
}); | ||
|
||
it('log in with BCeID and validate user information', () => { | ||
cy.login(); | ||
cy.getByDataTest('header-button__user').click(); | ||
cy.get('.user-data').find('p').contains('NRS Load Test-3'); | ||
cy.get('.user-data').find('p').contains('nrpp_test@nrpp.compratech.com'); | ||
}); | ||
|
||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"title": "Welcome to SPAR", | ||
"subtitle": "Seed Planning and Registry Application", | ||
"description": "Register and storage your seed and meet your annual reforestation needs using SPAR" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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