@camunda/e2e-test-suite 0.0.1259 → 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.
|
@@ -16,19 +16,50 @@ class ClusterDetailsPage {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
async assertCustomPropertyIsNavigated(linkTitle, linkName, link) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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;
|
|
@@ -12,17 +12,48 @@ class ClusterDetailsPage {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
async assertCustomPropertyIsNavigated(linkTitle, linkName, link) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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;
|