@camunda/e2e-test-suite 0.0.969 → 0.0.970

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.
@@ -30,10 +30,15 @@ declare class NavigationPage {
30
30
  username: string;
31
31
  password: string;
32
32
  }): Promise<void>;
33
+ private goToWithoutAccess;
33
34
  goToOptimizeWithoutAccess({ username, password, }?: {
34
35
  username?: string;
35
36
  password?: string;
36
37
  }): Promise<void>;
38
+ goToModelerWithoutAccess({ username, password, }?: {
39
+ username?: string;
40
+ password?: string;
41
+ }): Promise<void>;
37
42
  goToKeycloak(): Promise<void>;
38
43
  goToOCIdentity(sleepTimeout?: number, credentials?: {
39
44
  username: string;
@@ -5,6 +5,7 @@ const test_1 = require("@playwright/test");
5
5
  const LoginPage_1 = require("./LoginPage");
6
6
  const sleep_1 = require("../../utils/sleep");
7
7
  const constants_1 = require("../../utils/constants");
8
+ const GATEWAY_ERROR_STATUSES = [502, 503, 504];
8
9
  class NavigationPage {
9
10
  page;
10
11
  modelerPageBanner;
@@ -118,18 +119,34 @@ class NavigationPage {
118
119
  async goToOptimize(sleepTimeout, credentials) {
119
120
  await this.goTo('/optimize', this.optimizePageBanner, sleepTimeout, credentials);
120
121
  }
121
- // `goTo` ends by asserting the app banner, so it cannot be used to reach
122
- // Optimize as a user without the Optimize role: that request ends on a
123
- // `text/plain` 403 page carrying neither the banner nor a login form, and
124
- // every retry burns a full 60s timeout. Navigate and log in only; the
125
- // caller asserts what the denied page shows.
122
+ // `goTo` ends by asserting the app banner, so it cannot be used to reach a
123
+ // component the user has no role for: the denied response carries neither
124
+ // the banner nor a login form, and every retry burns a full 60s timeout.
125
+ // Navigate and log in only; the caller asserts what the denied page shows.
126
+ // The ingress answers 5xx while a component is still rolling out (upgrade
127
+ // scenarios), so retry the request until the component itself responds.
128
+ async goToWithoutAccess(url, username, password) {
129
+ await (0, test_1.expect)(async () => {
130
+ const response = await this.page.goto(url, {
131
+ timeout: 60000,
132
+ waitUntil: 'domcontentloaded',
133
+ });
134
+ (0, test_1.expect)(GATEWAY_ERROR_STATUSES).not.toContain(response?.status());
135
+ }).toPass({ timeout: 120000, intervals: [5000, 10000, 15000] });
136
+ await new LoginPage_1.LoginPage(this.page).login(username, password);
137
+ }
138
+ // Optimize denies a user without the Optimize role with a `text/plain` 403
139
+ // page.
126
140
  async goToOptimizeWithoutAccess({ username = 'demo', password = process.env.DISTRO_QA_E2E_TESTS_IDENTITY_FIRSTUSER_PASSWORD ??
127
141
  'demo', } = {}) {
128
- await this.page.goto('/optimize', {
129
- timeout: 60000,
130
- waitUntil: 'domcontentloaded',
131
- });
132
- await new LoginPage_1.LoginPage(this.page).login(username, password);
142
+ await this.goToWithoutAccess('/optimize', username, password);
143
+ }
144
+ // Web Modeler denies a user without the Web Modeler role with a blank page.
145
+ // It briefly renders its banner before dropping it, so `goTo`'s closing
146
+ // banner assertion either fails outright or passes by winning that race.
147
+ async goToModelerWithoutAccess({ username = 'demo', password = process.env.DISTRO_QA_E2E_TESTS_IDENTITY_FIRSTUSER_PASSWORD ??
148
+ 'demo', } = {}) {
149
+ await this.goToWithoutAccess('/modeler', username, password);
133
150
  }
134
151
  async goToKeycloak() {
135
152
  const keycloakUrl = process.env.KEYCLOAK_URL
@@ -147,18 +164,11 @@ class NavigationPage {
147
164
  async goToConsole(sleepTimeout, credentials) {
148
165
  await this.goTo('/console', this.consolePageBanner, sleepTimeout, credentials);
149
166
  }
150
- // `goTo` ends by asserting the app banner, so it cannot be used to reach
151
- // Console as a user without the Console role: that request renders
152
- // Console's own "Something went wrong" error page, which has neither the
153
- // banner nor a login form, and every retry burns a full 60s timeout.
154
- // Navigate and log in only; the caller asserts what the denied page shows.
167
+ // Console denies a user without the Console role with its own "Something
168
+ // went wrong" error page.
155
169
  async goToConsoleWithoutAccess({ username = 'demo', password = process.env.DISTRO_QA_E2E_TESTS_IDENTITY_FIRSTUSER_PASSWORD ??
156
170
  'demo', } = {}) {
157
- await this.page.goto('/console', {
158
- timeout: 60000,
159
- waitUntil: 'domcontentloaded',
160
- });
161
- await new LoginPage_1.LoginPage(this.page).login(username, password);
171
+ await this.goToWithoutAccess('/console', username, password);
162
172
  }
163
173
  async goToManagementIdentity(sleepTimeout, credentials) {
164
174
  await this.goTo('/identity', this.managementIdentityPageBanner, sleepTimeout, credentials);
@@ -74,7 +74,7 @@ SM_8_8_1.test.describe('Identity User Flow Tests', () => {
74
74
  });
75
75
  });
76
76
  await SM_8_8_1.test.step('Ensure Modeler is not Accessible', async () => {
77
- await navigationPage.goToModeler(undefined, credentials);
77
+ await navigationPage.goToModelerWithoutAccess(credentials);
78
78
  await (0, test_1.expect)(modelerHomePage.modelerPageBanner).not.toBeVisible({
79
79
  timeout: 60000,
80
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.969",
3
+ "version": "0.0.970",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",