generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORV2-3299: added additional test cases for IDIR and BCeID account (#1808
) Co-authored-by: cberg-aot <[email protected]> Co-authored-by: Praveen Raju <[email protected]>
- Loading branch information
1 parent
4fd1f4c
commit f0ce172
Showing
7 changed files
with
477 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
describe('Crud for trailer', () => { | ||
it('Should company info displayed', () => { | ||
// Retrieve the environment variables | ||
const username = Cypress.env('bceid_username'); | ||
const password = Cypress.env('bceid_password'); | ||
const manage_profiles_url = '/manage-profiles'; | ||
const update_trailer_url = Cypress.env('update_trailer_url'); | ||
const manage_vehicle_url = '/manage-vehicles'; | ||
const wait_time = Cypress.env('wait_time'); | ||
|
||
// Step 1: Visit the base URL | ||
cy.visit('/'); | ||
|
||
// Step 2: Find and click the login button by its idir | ||
cy.get('#login-bceid').click(); | ||
cy.wait(wait_time); | ||
|
||
// Step 3: Enter credentials | ||
cy.get('#user').type(username); | ||
cy.get('#password').type(password); | ||
cy.wait(wait_time); | ||
|
||
// Step 4: Submit the login form | ||
cy.get('[name="btnSubmit"]').click(); | ||
cy.wait(wait_time); | ||
|
||
// 1. Company info displayed – check | ||
cy.visit(manage_profiles_url); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('Doing Business As (DBA)') | ||
.next() // Select the next sibling | ||
.should('exist') // Ensure the next sibling exists | ||
.and('not.be.empty') // Ensure it's not empty | ||
.invoke('text') // Get the text content | ||
.should('not.match', /^\s*$/); // Ensure it is not just whitespace | ||
|
||
cy.contains('Company Mailing Address') | ||
.next() | ||
.should('exist') | ||
.and('not.be.empty') | ||
.invoke('text') | ||
.should('not.match', /^\s*$/); | ||
|
||
cy.contains('Company Contact Details') | ||
.next() | ||
.should('exist') | ||
.and('not.be.empty') | ||
.invoke('text') | ||
.should('not.match', /^\s*$/); | ||
|
||
cy.contains('Company Primary Contact') | ||
.next() | ||
.should('exist') | ||
.and('not.be.empty') | ||
.invoke('text') | ||
.should('not.match', /^\s*$/); | ||
|
||
// 2. Can update company info – check | ||
cy.contains('button', 'Edit').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('[name="alternateName"]').clear().type('onRouteBC Test 1'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('[name="mailingAddress.addressLine1"]').clear().type('123 Main Street'); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('button', 'Save').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
// 3. My information displayed – check | ||
cy.visit(manage_profiles_url); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('.tab__label', 'My Information').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('h3.css-jbf51a').should('exist') | ||
.next() | ||
.should('exist') | ||
.and('not.be.empty') | ||
.invoke('text') | ||
.should('not.match', /^\s*$/); | ||
|
||
|
||
// 4. Can update my info – check | ||
cy.contains('button', 'Edit').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('[name="firstName"]').clear().type('ORBC'); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('button', 'Save').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
// 5. Users displayed – check | ||
cy.contains('.tab__label', 'Add / Manage Users').should('exist').click(); | ||
cy.wait(wait_time); | ||
cy.contains('td', 'ORBCTST1').should('exist'); | ||
|
||
// 6. Can edit users – check | ||
cy.get('#actions-button').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.onroutebc-table-row-actions__menu-item').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('[name="phone1Extension"]').clear().type('1234'); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('button', 'Save').should('exist').click(); | ||
cy.wait(wait_time); | ||
|
||
// 7. User sort works - check | ||
cy.get('div.Mui-TableHeadCell-Content-Wrapper').contains('First Name').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('div.Mui-TableHeadCell-Content-Wrapper').contains('Last Name').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('div.Mui-TableHeadCell-Content-Wrapper').contains('User Group').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('div.Mui-TableHeadCell-Content-Wrapper').contains('Date Created').click(); | ||
cy.wait(wait_time); | ||
|
||
}); | ||
}); | ||
|
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,77 @@ | ||
describe('Login Test for OnRouteBC', () => { | ||
it('Should navigate to the login page, find the login button, and enter credentials', () => { | ||
// Retrieve the environment variables | ||
const username = Cypress.env('idir_username'); | ||
const password = Cypress.env('idir_password'); | ||
const home_url = '/idir/welcome'; | ||
const report_url = 'idir/reports'; | ||
const wait_time = Cypress.env('wait_time'); | ||
|
||
// Step 1: Visit the base URL | ||
cy.visit('/'); | ||
|
||
// Step 2: Find and click the login button by its idir | ||
cy.get('#login-idir').click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
// Step 3: Enter credentials | ||
cy.get('#user').type(username); | ||
cy.get('#password').type(password); | ||
cy.wait(wait_time); | ||
|
||
// Step 4: Submit the login form | ||
cy.get('[name="btnSubmit"]').click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
// Home page – check | ||
cy.visit(home_url); | ||
cy.wait(wait_time); | ||
|
||
// 1. Sticky sidebar appears – check | ||
cy.get('button.nav-button.nav-button--home.nav-button--active').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('button.nav-button.nav-button--report').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('button.nav-button.nav-button--bfct').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
// 2. Global search available – check | ||
cy.get('button.search-button').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
// Sticky sidebar | ||
// 1. Home button works – check | ||
cy.get('button.nav-button.nav-button--home').click(); | ||
cy.wait(wait_time); | ||
|
||
// 2. Report button works – check | ||
cy.get('button.nav-button.nav-button--report').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('button[aria-label="View Report"]').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.visit(report_url); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('span', 'Payment and Refund Detail').should('be.visible').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('button[aria-label="View Report"]').click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}); | ||
}); |
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,121 @@ | ||
describe('Login Test for OnRouteBC', () => { | ||
it('Should navigate to the login page, find the login button, and enter credentials', () => { | ||
// Retrieve the environment variables | ||
const username = Cypress.env('idir_username'); | ||
const password = Cypress.env('idir_password'); | ||
const home_url = '/idir/welcome'; | ||
const report_url = 'idir/reports'; | ||
const wait_time = Cypress.env('wait_time'); | ||
|
||
// Step 1: Visit the base URL | ||
cy.visit('/'); | ||
|
||
// Step 2: Find and click the login button by its idir | ||
cy.get('#login-idir').click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
// Step 3: Enter credentials | ||
cy.get('#user').type(username); | ||
cy.get('#password').type(password); | ||
cy.wait(wait_time); | ||
|
||
// Step 4: Submit the login form | ||
cy.get('[name="btnSubmit"]').click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
// Home page – check | ||
cy.visit(home_url); | ||
cy.wait(wait_time); | ||
|
||
// 1. Can search permits by permit number (checked with active and expired permits) – check | ||
cy.get('.search-button').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('input[type="text"]') | ||
.should('be.visible') | ||
.type('1'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.search-by__search').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.onroutebc-chip.permit-chip.permit-chip--expired').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.PrivateSwitchBase-input.MuiSwitch-input').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.contains('p', 'No records to display').should('exist'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.PrivateSwitchBase-input.MuiSwitch-input').click(); | ||
cy.wait(wait_time); | ||
|
||
// Can view permit pdf | ||
cy.get('.MuiTypography-root.MuiTypography-body2.MuiLink-root.MuiLink-underlineAlways.MuiLink-button.custom-action-link') | ||
.first() | ||
.click(); | ||
cy.wait(wait_time); | ||
|
||
// Can view receipt pdf | ||
cy.get('button#actions-button') | ||
.first() | ||
.click({force: true}); | ||
cy.wait(wait_time); | ||
|
||
cy.get('li[data-option-value="viewReceipt"]') | ||
.click({force: true}); | ||
cy.wait(wait_time); | ||
|
||
cy.visit(home_url); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.search-button').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('input[type="text"]') | ||
.should('be.visible') | ||
.type('1'); | ||
cy.wait(wait_time); | ||
|
||
cy.get('.search-by__search').click(); | ||
cy.wait(wait_time); | ||
|
||
cy.get('button#actions-button') | ||
.first() | ||
.click({force: true}); | ||
cy.wait(wait_time); | ||
|
||
cy.get('li[data-option-value="resend"]') | ||
.click({force: true}); | ||
cy.wait(wait_time); | ||
|
||
cy.get('input.PrivateSwitchBase-input[type="checkbox"]').eq(1).click({ force: true }); | ||
cy.wait(wait_time); | ||
|
||
cy.get('input[data-testid="input-email"]').type('[email protected]'); | ||
cy.wait(wait_time); | ||
|
||
// cy.get('button').contains('Resend').click(); | ||
// cy.wait(wait_time); | ||
|
||
// cy.get('button#actions-button') | ||
// .first() | ||
// .click({force: true}); | ||
// cy.wait(wait_time); | ||
|
||
// cy.get('li[data-option-value="resend"]') | ||
// .click({force: true}); | ||
// cy.wait(wait_time); | ||
|
||
// Can cancel the resend | ||
cy.get('button') | ||
.contains('Cancel') | ||
.click(); | ||
cy.wait(wait_time); | ||
|
||
|
||
}); | ||
}); |
Oops, something went wrong.