@camunda/e2e-test-suite 0.0.1259 → 0.0.1260

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.
@@ -16,19 +16,50 @@ class ClusterDetailsPage {
16
16
  });
17
17
  }
18
18
  async assertCustomPropertyIsNavigated(linkTitle, linkName, link) {
19
- const pageTabPromise = this.page.waitForEvent('popup', {
20
- timeout: 60000,
21
- });
22
- // Each custom property is a <dt>/<dd> row (direct child of the details
23
- // card's <dl>), keyed by the property's own description — not by a
24
- // generic "Link 1"/"Link 2" row title, which this DOM never had.
25
- await this.page
26
- .locator('dl > div')
27
- .filter({ has: this.page.locator('dt', { hasText: linkTitle }) })
28
- .getByRole('link', { name: linkName, exact: true })
29
- .click({ timeout: 60000 });
30
- const camundaPage = await pageTabPromise;
31
- await (0, test_1.expect)(camundaPage).toHaveURL(link);
19
+ const context = this.page.context();
20
+ const matchesLink = (url) => typeof link === 'string'
21
+ ? url.href.startsWith(link)
22
+ : link.test(url.href);
23
+ // Serve a stub document only when the external site itself is
24
+ // unreachable, so the popup still commits the URL Console navigated to.
25
+ const handler = async (route) => {
26
+ if (route.request().resourceType() !== 'document') {
27
+ await route.continue();
28
+ return;
29
+ }
30
+ try {
31
+ const response = await route.fetch({ timeout: 30000 });
32
+ await route.fulfill({ response });
33
+ }
34
+ catch (error) {
35
+ const url = route.request().url();
36
+ console.warn(`External link ${url} unreachable, stubbing: ${error}`);
37
+ await route.fulfill({
38
+ status: 200,
39
+ contentType: 'text/html',
40
+ body: '<html><body></body></html>',
41
+ });
42
+ }
43
+ };
44
+ await context.route(matchesLink, handler);
45
+ try {
46
+ const pageTabPromise = this.page.waitForEvent('popup', {
47
+ timeout: 60000,
48
+ });
49
+ // Each custom property is a <dt>/<dd> row (direct child of the details
50
+ // card's <dl>), keyed by the property's own description — not by a
51
+ // generic "Link 1"/"Link 2" row title, which this DOM never had.
52
+ await this.page
53
+ .locator('dl > div')
54
+ .filter({ has: this.page.locator('dt', { hasText: linkTitle }) })
55
+ .getByRole('link', { name: linkName, exact: true })
56
+ .click({ timeout: 60000 });
57
+ const camundaPage = await pageTabPromise;
58
+ await (0, test_1.expect)(camundaPage).toHaveURL(link, { timeout: 60000 });
59
+ }
60
+ finally {
61
+ await context.unroute(matchesLink, handler);
62
+ }
32
63
  }
33
64
  }
34
65
  exports.ClusterDetailsPage = ClusterDetailsPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1259",
3
+ "version": "0.0.1260",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",