@camunda/e2e-test-suite 0.0.132 → 0.0.133
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.
|
@@ -2,6 +2,8 @@ import { Page, Locator } from '@playwright/test';
|
|
|
2
2
|
declare class ClusterPage {
|
|
3
3
|
private page;
|
|
4
4
|
private defaultClusterType;
|
|
5
|
+
readonly belgiumRegion: Locator;
|
|
6
|
+
readonly finlandRegion: Locator;
|
|
5
7
|
readonly createNewClusterButton: Locator;
|
|
6
8
|
readonly clusterNameInput: Locator;
|
|
7
9
|
readonly createClusterButton: Locator;
|
|
@@ -35,6 +37,7 @@ declare class ClusterPage {
|
|
|
35
37
|
clickClusterNameInput(): Promise<void>;
|
|
36
38
|
fillClusterNameInput(name: string): Promise<void>;
|
|
37
39
|
createCluster(name: string, region?: string): Promise<void>;
|
|
40
|
+
selectSubRegion(region: string): Promise<void>;
|
|
38
41
|
private extractClusterIdFromUrl;
|
|
39
42
|
private logClusterCreationInfo;
|
|
40
43
|
clickClusterType(): Promise<void>;
|
|
@@ -8,6 +8,8 @@ const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocat
|
|
|
8
8
|
class ClusterPage {
|
|
9
9
|
page;
|
|
10
10
|
defaultClusterType = 'G3-Dev';
|
|
11
|
+
belgiumRegion;
|
|
12
|
+
finlandRegion;
|
|
11
13
|
createNewClusterButton;
|
|
12
14
|
clusterNameInput;
|
|
13
15
|
createClusterButton;
|
|
@@ -74,6 +76,12 @@ class ClusterPage {
|
|
|
74
76
|
this.gcpRegion = page.getByRole('tab', {
|
|
75
77
|
name: 'GCP',
|
|
76
78
|
});
|
|
79
|
+
this.belgiumRegion = page.locator('label').filter({
|
|
80
|
+
hasText: 'Chaos, Belgium, Europe (europe-west1)',
|
|
81
|
+
});
|
|
82
|
+
this.finlandRegion = page.locator('label').filter({
|
|
83
|
+
hasText: 'Finland, Europe (europe-north1)',
|
|
84
|
+
});
|
|
77
85
|
this.clustersList = page
|
|
78
86
|
.getByRole('row')
|
|
79
87
|
.filter({ hasNotText: 'Generation' }); //Filter out header row
|
|
@@ -162,11 +170,24 @@ class ClusterPage {
|
|
|
162
170
|
await this.fillClusterNameInput(name);
|
|
163
171
|
await this.clickClusterType();
|
|
164
172
|
await this.page.getByRole('tab', { name: region }).click();
|
|
173
|
+
await this.selectSubRegion(region);
|
|
165
174
|
await this.clickClusterOption();
|
|
166
175
|
await this.clickCreateClusterButton();
|
|
167
176
|
await this.logClusterCreationInfo(name);
|
|
168
177
|
await this.clickClustersBreadcrumb(name);
|
|
169
178
|
}
|
|
179
|
+
async selectSubRegion(region) {
|
|
180
|
+
if (region === 'GCP') {
|
|
181
|
+
const regions = [
|
|
182
|
+
{ name: 'Belgium', locator: this.belgiumRegion },
|
|
183
|
+
{ name: 'Finland', locator: this.finlandRegion },
|
|
184
|
+
];
|
|
185
|
+
const chosen = regions[Math.floor(Math.random() * regions.length)];
|
|
186
|
+
console.log(`Selected region: ${chosen.name}`);
|
|
187
|
+
await (0, test_1.expect)(chosen.locator).toBeVisible({ timeout: 20000 });
|
|
188
|
+
await chosen.locator.click();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
170
191
|
extractClusterIdFromUrl(url) {
|
|
171
192
|
const clusterIdMatch = url.match(/\/cluster\/([a-f0-9-]+)/);
|
|
172
193
|
return clusterIdMatch ? clusterIdMatch[1] : null;
|