@camunda/e2e-test-suite 0.0.911 → 0.0.912
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,7 @@ declare class LoginPage {
|
|
|
8
8
|
readonly loginMessage: Locator;
|
|
9
9
|
readonly errorMessage: Locator;
|
|
10
10
|
readonly passwordHeading: Locator;
|
|
11
|
+
readonly rateLimitError: Locator;
|
|
11
12
|
constructor(page: Page);
|
|
12
13
|
fillUsername(username: string): Promise<void>;
|
|
13
14
|
clickContinueButton(): Promise<void>;
|
|
@@ -12,6 +12,7 @@ class LoginPage {
|
|
|
12
12
|
loginMessage;
|
|
13
13
|
errorMessage;
|
|
14
14
|
passwordHeading;
|
|
15
|
+
rateLimitError;
|
|
15
16
|
constructor(page) {
|
|
16
17
|
this.page = page;
|
|
17
18
|
this.usernameInput = page
|
|
@@ -34,6 +35,9 @@ class LoginPage {
|
|
|
34
35
|
exact: true,
|
|
35
36
|
});
|
|
36
37
|
this.errorMessage = page.getByText('Wrong email or password');
|
|
38
|
+
this.rateLimitError = page
|
|
39
|
+
.getByText(/rate limit has been reached/i)
|
|
40
|
+
.or(page.getByText(/We are sorry, an error occurred/i));
|
|
37
41
|
}
|
|
38
42
|
async fillUsername(username) {
|
|
39
43
|
await this.usernameInput.waitFor({ state: 'visible', timeout: 60000 });
|
|
@@ -32,7 +32,7 @@ async function forceLogoutIfNeeded(page) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
exports.forceLogoutIfNeeded = forceLogoutIfNeeded;
|
|
35
|
-
async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries =
|
|
35
|
+
async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries = 5) {
|
|
36
36
|
let lastError;
|
|
37
37
|
// Stagger the first navigation across parallel workers. Without this, every
|
|
38
38
|
// worker's initial page.goto('/') fires within the same second -- with 18+
|
|
@@ -64,6 +64,16 @@ async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries = 3
|
|
|
64
64
|
await page
|
|
65
65
|
.waitForLoadState('networkidle', { timeout: 30000 })
|
|
66
66
|
.catch(() => { });
|
|
67
|
+
// Auth0 serves a tenant-wide rate-limit error page that carries none of
|
|
68
|
+
// the usual auth controls. Bail out early on it so the outer retry backs
|
|
69
|
+
// off long enough to outlast the window instead of burning attempts
|
|
70
|
+
// against a 60s wait for a login form that will never render.
|
|
71
|
+
if (await loginPage.rateLimitError
|
|
72
|
+
.first()
|
|
73
|
+
.isVisible()
|
|
74
|
+
.catch(() => false)) {
|
|
75
|
+
throw new Error('AUTH0_RATE_LIMIT: identity provider returned an error page');
|
|
76
|
+
}
|
|
67
77
|
await (0, test_1.expect)(loginPage.loginMessage.or(loginPage.passwordHeading)).toBeVisible({ timeout: 60000 });
|
|
68
78
|
await loginPage.loginWithTestUser(testUser);
|
|
69
79
|
return;
|
|
@@ -71,8 +81,16 @@ async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries = 3
|
|
|
71
81
|
catch (error) {
|
|
72
82
|
lastError = error;
|
|
73
83
|
if (attempt < maxRetries - 1) {
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
const rateLimited = String(error).includes('AUTH0_RATE_LIMIT');
|
|
85
|
+
console.warn(`Attempt ${attempt + 1} failed for logging in. Retrying with clean session...`, error);
|
|
86
|
+
if (rateLimited) {
|
|
87
|
+
// Auth0 rate-limit windows commonly last 30-90s. Back off long
|
|
88
|
+
// enough to outlast the window before the next attempt.
|
|
89
|
+
await (0, randomSleep_1.randomSleep)(60000, 90000);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
await (0, randomSleep_1.randomSleep)(10000, 20000);
|
|
93
|
+
}
|
|
76
94
|
}
|
|
77
95
|
else {
|
|
78
96
|
console.error(lastError);
|