generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ORV2-3027: added new term overweight test case
ORV2-3027: added new term overweight test case
- Loading branch information
1 parent
e1a35c8
commit 3a66001
Showing
3 changed files
with
126 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,43 @@ jobs: | |
path: tests/cypress/videos/ | ||
overwrite: true | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | ||
|
||
new-term-overweight: | ||
name: (BCEID) New Term Overweight | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
working-directory: tests/ | ||
strategy: | ||
matrix: | ||
browser: [chrome, firefox, edge] | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: cypress-io/[email protected] | ||
name: Cypress run | ||
env: | ||
CYPRESS_baseUrl: https://${{ github.event.repository.name }}-${{ inputs.target || 'test' }}-frontend.apps.silver.devops.gov.bc.ca/ | ||
CYPRESS_bceid_username: ${{vars.BCEID_USERNAME}} | ||
CYPRESS_bceid_password: ${{secrets.BCEID_PASSWORD}} | ||
with: | ||
browser: ${{ matrix.browser }} | ||
config: pageLoadTimeout=10000,video=true | ||
spec: cypress/e2e/bceid-new-term-overweight.cy.js | ||
working-directory: tests | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: cypress-screenshots | ||
path: tests/cypress/screenshots/ | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: tests/cypress/videos/ | ||
overwrite: true | ||
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` |
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,85 @@ | ||
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('bceid_username'); | ||
const password = Cypress.env('bceid_password'); | ||
const new_trow_url = Cypress.env('new_tros_url'); | ||
|
||
// 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(5000); | ||
|
||
// Step 3: Enter credentials | ||
cy.get('#user').type(username); | ||
cy.get('#password').type(password); | ||
cy.wait(5000); | ||
|
||
// Step 4: Submit the login form | ||
cy.get('[name="btnSubmit"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.visit(new_trow_url); | ||
cy.wait(5000); | ||
|
||
// fill out the form | ||
cy.get('#application-select-vehicle').type('123'); | ||
cy.wait(5000); | ||
|
||
cy.get('[name="permitData.vehicleDetails.vin"]').click({ force: true }).type('115588'); | ||
cy.wait(5000); | ||
|
||
cy.get('[name="permitData.vehicleDetails.plate"]').type('1B25F'); | ||
cy.wait(5000); | ||
|
||
cy.get('[name="permitData.vehicleDetails.make"]').type('PHIL'); | ||
cy.wait(5000); | ||
|
||
cy.get('[name="permitData.vehicleDetails.year"]').type('1992'); | ||
cy.wait(5000); | ||
|
||
cy.get('[id="mui-component-select-permitData.vehicleDetails.countryCode"]').scrollIntoView().click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-value="CA"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[id="mui-component-select-permitData.vehicleDetails.provinceCode"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-value="BC"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[id="mui-component-select-permitData.vehicleDetails.vehicleType"]').click(({ force: true })); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-value="trailer"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[id="mui-component-select-permitData.vehicleDetails.vehicleSubType"]').click({ force: true }); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-value="DOLLIES"]').click(); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-testid="continue-application-button"]').click({ force: true }); | ||
cy.wait(5000); | ||
|
||
cy.get('input[type="checkbox"]').each(($checkbox) => { | ||
cy.wrap($checkbox).click({ force: true }); | ||
}); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-testid="add-to-cart-btn"]').click({force: true}); | ||
cy.wait(5000); | ||
|
||
cy.get('.shopping-cart-button').click({force: true}); | ||
cy.wait(5000); | ||
|
||
cy.get('[data-testid="pay-now-btn"]').scrollIntoView().click({force: true}); | ||
cy.wait(5000); | ||
|
||
}); | ||
}); |