@camunda/e2e-test-suite 0.0.1260 → 0.0.1261

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