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 2 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
48 changes: 39 additions & 9 deletions tests/cypress/e2e/bceid-update-term-oversize.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,48 @@ describe('Login Test for OnRouteBC', () => {
cy.get('[data-testid="continue-application-button"]').click({ force: true });
cy.wait(5000);

cy.visit('/applications');
cy.wait(5000);

cy.get('a.column-link--application-details').first().click();
cy.wait(5000);
// get the application id just created
cy.get('.MuiAlert-message').invoke('text').then((text) => {
const match = text.match(/A2-\d{8}-\d{3}-\w{2}/);
if (match) {
const extractedValue = match[0];

cy.visit('/applications');
cy.wait(5000);

cy.get('a.column-link--application-details').each(($el) => {
cy.wrap($el).invoke('text').then((linkText) => {
if (linkText.includes(extractedValue)) {
cy.wrap($el).click();
cy.get('[name="permitData.contactDetails.phone1Extension"]').clear().type('0003');
cy.wait(5000);

// save updates
cy.get('[data-testid="save-application-button"]').click();
cy.wait(5000);
return false; // Breaks out of the .each() loop once the item is clicked
}
});
});
} else {
cy.log('No matching value found in the alert message');
}
});





// cy.get('a.column-link--application-details').first().click();
// cy.wait(5000);

// update phone ext
cy.get('[name="permitData.contactDetails.phone1Extension"]').clear().type('0003');
cy.wait(5000);
// cy.get('[name="permitData.contactDetails.phone1Extension"]').clear().type('0003');
// cy.wait(5000);

// save updates
cy.get('[data-testid="save-application-button"]').click();
cy.wait(5000);
// // save updates
// cy.get('[data-testid="save-application-button"]').click();
// cy.wait(5000);
});
});
134 changes: 134 additions & 0 deletions tests/cypress/e2e/idir-amend-term-oversize.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,140 @@ describe('Login Test for OnRouteBC', () => {
cy.wait(5000);
cy.xpath("//button[text()='Test Transport Inc.']").click();
cy.wait(5000);


// create a new application in case there is no activate permit over there
// create a permit first
// click select
cy.get('[aria-label="Select"]').eq(1).click({ force: true });
cy.wait(5000);

// click term
cy.get('.css-1hdidwq').eq(0).click({force: true});
cy.wait(5000);

// click term oversize
cy.get('.css-1sucic7').eq(0).click({force: true});
cy.wait(5000);

cy.get('li.start-application-action__menu-item')
.contains('p.MuiTypography-root', 'Term').first()
.click({force: true});
cy.wait(5000);

cy.contains('li', 'Oversize').first().click();
cy.wait(5000);

cy.get('body').click({force: true});
cy.wait(5000);

// click "start application"
cy.get('.start-application-action__btn').first().click({force: true});
cy.wait(5000);

cy.get('.start-application-action__btn').eq(1).click({force: true});
cy.wait(5000);

// fill out the form
cy.get('[name="permitData.contactDetails.firstName"]').type('Load');
cy.wait(5000);

cy.get('[name="permitData.contactDetails.lastName"]').type('Test');
cy.wait(5000);

cy.get('[name="permitData.contactDetails.phone1"]').type('2501111234');
cy.wait(5000);

cy.get('#application-select-vehicle').type('MCL36');
cy.wait(5000);

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

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

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

cy.get('[name="permitData.vehicleDetails.year"]').type('2020');
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="powerUnit"]').click();
cy.wait(5000);

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

cy.get('[data-value="REGTRCK"]').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('div.MuiSelect-select[aria-controls=":r1g:"]').click();
// cy.wait(5000);
cy.get('div[role="combobox"]')
.contains('Select')
.click();

cy.contains('li', 'Mastercard (Debit)').first().click();
cy.wait(5000);

cy.get('[name="additionalPaymentData.icepayTransactionId"]').type(1234);
cy.wait(5000);

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

cy.visit('/');
cy.wait(5000);


// Find the search button by its class name and click it
cy.get('.search-button').click();
cy.wait(5000);

// Find the element with value="companies" and interact with it
cy.get('[value="companies"]').click();
cy.wait(5000);

// Find elements to amend application
cy.get('.css-1pog434').type('t');
cy.wait(5000);
cy.get('.search-by__search').click();
cy.wait(5000);
cy.xpath("//button[text()='Test Transport Inc.']").click();
cy.wait(5000);



cy.xpath("//div[@class='tab__label' and text()='Active Permits']").click();
cy.wait(5000);
cy.get('.css-15mydm5').first().scrollIntoView().wait(3000).click({ force: true });
Expand Down
Loading