case 4690 - E2E: reliable login and notification wait on remote servers
Over the internet the login page reloads once on a first visit (service worker taking control) and can move the focus back to the username field while it settles; both made logins fail at random (8.2.4 and 8.3.0). ayLogin now lets the service worker take control first, waits for notify/hello and the trial users list, checks both fields and types again if needed, and clicks the login button. 0900 reloads Notifications until the notification arrives (the server delivers about once a minute). 27/27 on the 8.3.0 release candidate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,9 +6,24 @@ describe("Tax code", () => {
|
||||
|
||||
cy.get("[data-cy=notification]").click();
|
||||
cy.url().should("include", "/home-notifications");
|
||||
// the server delivers notifications about once a minute (release build) and this page does not
|
||||
// refresh itself, so reload until the contract notification from 0500 has arrived
|
||||
waitForNotification(15);
|
||||
cy.contains("Object created");
|
||||
//Going to assume this is a virgin run so test contract text should be there but not going to assume it's due to current run so not checking for cyid
|
||||
//cy.contains(`${Cypress.config("cyid")}-test-contract`);
|
||||
cy.contains('-test-contract');
|
||||
});
|
||||
});
|
||||
|
||||
// check 5 seconds after each (re)load, up to the given number of times, until "Object created" shows
|
||||
function waitForNotification(triesLeft) {
|
||||
cy.wait(5000);
|
||||
cy.get("body").then(($body) => {
|
||||
if ($body.text().includes("Object created") || triesLeft <= 0) {
|
||||
return;
|
||||
}
|
||||
cy.reload();
|
||||
waitForNotification(triesLeft - 1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user