@camunda/e2e-test-suite 0.0.1257 → 0.0.1259

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.
@@ -66,25 +66,25 @@ class BrowseAllConnectorMarketplacePage {
66
66
  continue;
67
67
  }
68
68
  await addButton.click({ timeout: 60000 });
69
- if (await this.completeImportReviewIfNecessary(retryButton)) {
69
+ if (await this.completeImportReviewIfNecessary(retryButton, addedStatus)) {
70
70
  break;
71
71
  }
72
72
  if (attempt === 3) {
73
73
  throw new Error('Browse All could not import the Marketplace connector after 3 attempts.');
74
74
  }
75
75
  }
76
- await this.availableElementsHeading.waitFor({
77
- state: 'visible',
78
- timeout: 120000,
79
- });
76
+ await this.availableElementsHeading
77
+ .or(addedStatus)
78
+ .waitFor({ state: 'visible', timeout: 120000 });
80
79
  await browseAllDialog
81
80
  .getByRole('button', { name: 'Close' })
82
81
  .click({ timeout: 60000 });
83
82
  await browseAllDialog.waitFor({ state: 'hidden', timeout: 60000 });
84
83
  }
85
- async completeImportReviewIfNecessary(retryButton) {
84
+ async completeImportReviewIfNecessary(retryButton, addedStatus) {
86
85
  await this.importModal
87
86
  .or(this.availableElementsHeading)
87
+ .or(addedStatus)
88
88
  .or(retryButton)
89
89
  .waitFor({ state: 'visible', timeout: 120000 });
90
90
  if (await retryButton.isVisible()) {
@@ -107,6 +107,7 @@ class BrowseAllConnectorMarketplacePage {
107
107
  }
108
108
  await this.importModal.waitFor({ state: 'hidden', timeout: 120000 });
109
109
  await this.availableElementsHeading
110
+ .or(addedStatus)
110
111
  .or(retryButton)
111
112
  .waitFor({ state: 'visible', timeout: 120000 });
112
113
  return !(await retryButton.isVisible());
@@ -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.1257",
3
+ "version": "0.0.1259",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",