Refactored e2e tests to use Promise.all for parallel execution

In this update, several end-to-end (e2e) tests were refactored to use Promise.all for parallel execution of operations. This was done to improve the efficiency and stability of the tests, as waiting for each operation one by one could cause bottlenecks and potential failures in the test execution. Receives and click actions were grouped together to allow them to be executed concurrently where possible. The changes were applied across different test scenarios.
This commit is contained in:
giancarlo
2024-05-07 17:29:54 +07:00
parent 171a404379
commit 7c447c8848
6 changed files with 105 additions and 58 deletions

View File

@@ -111,16 +111,18 @@ export class InvitationsPageObject {
async acceptInvitation() {
console.log('Accepting invitation...');
await this.page
const click = this.page
.locator('[data-test="join-team-form"] button[type="submit"]')
.click();
await this.page.waitForResponse((response) => {
const response = this.page.waitForResponse((response) => {
return (
response.url().includes('/join') &&
response.request().method() === 'POST'
);
});
await Promise.all([click, response]);
}
private getInviteForm() {