Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORV2-3221: fixed the failure on idir/bceid update term oversize test … #1725

Merged
merged 5 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/e2e-regression-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
CYPRESS_bceid_password: ${{secrets.BCEID_PASSWORD}}
CYPRESS_idir_username: ${{vars.IDIR_USERNAME}}
CYPRESS_idir_password: ${{secrets.IDIR_PASSWORD}}
CYPRESS_wait_time: 2000
with:
browser: ${{ matrix.browser }}
config: pageLoadTimeout=10000,video=true
Expand Down
57 changes: 29 additions & 28 deletions tests/cypress/e2e/bceid-crud-power-units.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,105 +6,106 @@ describe('Crud for power unit', () => {
const new_power_unit_url = '/manage-vehicles/add-powerunit';
const update_power_unit_url = Cypress.env('update_power_unit_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(5000);
cy.wait(wait_time);

// Step 3: Enter credentials
cy.get('#user').type(username);
cy.get('#password').type(password);
cy.wait(5000);
cy.wait(wait_time);

// Step 4: Submit the login form
cy.get('[name="btnSubmit"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.visit(new_power_unit_url);
cy.wait(5000);
cy.wait(wait_time);

// create new power unit
// cy.get('[name="unitNumber"]').type('MCL37');
// cy.wait(5000);
// cy.wait(wait_time);

cy.get('[name="make"]').type('Toyota');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="year"]').type('2002');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="vin"]').type('MCL37A');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="plate"]').type('VB0007');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-powerUnitTypeCode"]').click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="BUSCRUM"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-countryCode"]').scrollIntoView().click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="CA"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-provinceCode"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="AB"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="licensedGvw"]').type('2000');
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-xie432').click();
cy.wait(5000);
cy.wait(wait_time);

// update power unit
cy.visit(manage_vehicle_url);
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-15mydm5').first().scrollIntoView().wait(3000).click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.xpath("//li[text()='Edit']").click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="make"]').clear().type('Toyota');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="year"]').clear().type('2021');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="licensedGvw"]').clear().type('3000');
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-xie432').click();
cy.wait(5000);
cy.wait(wait_time);

// delete power unit
cy.visit(manage_vehicle_url);
cy.wait(5000);
cy.wait(wait_time);

cy.xpath("(//input[@type='checkbox'])[2]")
.then(($checkbox) => {
if (!$checkbox.prop('checked')) { // Check if it's not selected
cy.wrap($checkbox).click(); // Select it if not already checked
}
});
cy.wait(5000);
cy.wait(wait_time);

cy.get('.delete-btn--active').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-1a53fri').click();
cy.wait(5000);
cy.wait(wait_time);

});
});
Expand Down
59 changes: 30 additions & 29 deletions tests/cypress/e2e/bceid-crud-trailers.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,109 +6,110 @@ describe('Crud for trailer', () => {
const new_trailer_url = '/manage-vehicles/add-trailer';
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(5000);
cy.wait(wait_time);

// Step 3: Enter credentials
cy.get('#user').type(username);
cy.get('#password').type(password);
cy.wait(5000);
cy.wait(wait_time);

// Step 4: Submit the login form
cy.get('[name="btnSubmit"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.visit(new_trailer_url);
cy.wait(5000);
cy.wait(wait_time);

// create new trailer
// cy.get('[name="unitNumber"]').type('TCL37');
// cy.wait(5000);
// cy.wait(wait_time);

cy.get('[name="make"]').type('NISSAN');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="year"]').type('2005');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="vin"]').type('TCL37A');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="plate"]').type('VT0007');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-trailerTypeCode"]').click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="BOOSTER"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-countryCode"]').scrollIntoView().click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="CA"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-provinceCode"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="BC"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-xie432').click();
cy.wait(5000);
cy.wait(wait_time);

// update power unit
cy.visit(manage_vehicle_url);
cy.wait(5000);
cy.wait(wait_time);

cy.get('.tab__label').contains('Trailer').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-15mydm5').first().scrollIntoView().wait(3000).click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.xpath("//li[text()='Edit']").click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="make"]').clear().type('BMW');
cy.wait(5000);
cy.wait(wait_time);

// cy.get('[name="unitNumber"]').clear().type('TCL37');
// cy.wait(5000);
// cy.wait(wait_time);

cy.get('[name="year"]').clear().type('2021');
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-xie432').click();
cy.wait(5000);
cy.wait(wait_time);


// delete trailer
cy.visit(manage_vehicle_url);
cy.wait(5000);
cy.wait(wait_time);

cy.get('.tab__label').contains('Trailer').click();
cy.wait(5000);
cy.wait(wait_time);

cy.xpath("(//input[@type='checkbox'])[2]")
.then(($checkbox) => {
if (!$checkbox.prop('checked')) { // Check if it's not selected
cy.wrap($checkbox).click(); // Select it if not already checked
}
});
cy.wait(5000);
cy.wait(wait_time);

cy.get('.delete-btn--active').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('.css-1a53fri').click();
cy.wait(5000);
cy.wait(wait_time);

});
});
Expand Down
45 changes: 23 additions & 22 deletions tests/cypress/e2e/bceid-new-term-oversize.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,83 @@ describe('Login Test for OnRouteBC', () => {
const username = Cypress.env('bceid_username');
const password = Cypress.env('bceid_password');
const new_tros_url = '/create-application/TROS';
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(5000);
cy.wait(wait_time);

// Step 3: Enter credentials
cy.get('#user').type(username);
cy.get('#password').type(password);
cy.wait(5000);
cy.wait(wait_time);

// Step 4: Submit the login form
cy.get('[name="btnSubmit"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.visit(new_tros_url);
cy.wait(5000);
cy.wait(wait_time);

// fill out the form
cy.get('#application-select-vehicle').type('MCL36');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="permitData.vehicleDetails.vin"]').click({ force: true }).type('MCL36A');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="permitData.vehicleDetails.plate"]').type('L4NDO');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="permitData.vehicleDetails.make"]').type('BMW');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[name="permitData.vehicleDetails.year"]').type('2020');
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-permitData.vehicleDetails.countryCode"]').scrollIntoView().click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="CA"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-permitData.vehicleDetails.provinceCode"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="BC"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-permitData.vehicleDetails.vehicleType"]').click(({ force: true }));
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="powerUnit"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[id="mui-component-select-permitData.vehicleDetails.vehicleSubType"]').click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-value="REGTRCK"]').click();
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-testid="continue-application-button"]').click({ force: true });
cy.wait(5000);
cy.wait(wait_time);

cy.get('input[type="checkbox"]').each(($checkbox) => {
cy.wrap($checkbox).click({ force: true });
});
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-testid="add-to-cart-btn"]').click({force: true});
cy.wait(5000);
cy.wait(wait_time);

cy.get('.shopping-cart-button').click({force: true});
cy.wait(5000);
cy.wait(wait_time);

cy.get('[data-testid="pay-now-btn"]').scrollIntoView().click({force: true});
cy.wait(5000);
cy.wait(wait_time);

});
});
Loading
Loading