@camunda/e2e-test-suite 0.0.178 → 0.0.179

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,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ModelerHomePage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
5
6
  class ModelerHomePage {
6
7
  page;
7
8
  defaultFolderName;
@@ -64,6 +65,9 @@ class ModelerHomePage {
64
65
  this.uploadFilesButton = page.getByRole('menuitem', { name: 'Upload files' });
65
66
  }
66
67
  async clickCreateNewProjectButton() {
68
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.createNewProjectButton, {
69
+ totalTimeout: 30000,
70
+ });
67
71
  await this.createNewProjectButton.click({ timeout: 10000 });
68
72
  }
69
73
  async enterNewProjectName(name) {
@@ -15,6 +15,9 @@ declare class PlayPage {
15
15
  readonly startInstanceButton: Locator;
16
16
  readonly notifications: Locator;
17
17
  readonly saveScenarioModal: Locator;
18
+ readonly dialog: Locator;
19
+ readonly loadingInstanceDetailsText: Locator;
20
+ readonly retryButton: Locator;
18
21
  constructor(page: Page);
19
22
  waitForCompleteJobButtonToBeAvailable(): Promise<void>;
20
23
  clickCompleteJobButton(): Promise<void>;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlayPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("../../utils/sleep");
6
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
7
+ const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
6
8
  const maxWaitTimeSeconds = 180000;
7
9
  class PlayPage {
8
10
  page;
@@ -20,6 +22,9 @@ class PlayPage {
20
22
  startInstanceButton;
21
23
  notifications;
22
24
  saveScenarioModal;
25
+ dialog;
26
+ loadingInstanceDetailsText;
27
+ retryButton;
23
28
  constructor(page) {
24
29
  this.page = page;
25
30
  this.completeJobButton = page
@@ -30,6 +35,7 @@ class PlayPage {
30
35
  this.runAllScenariosButton = page.getByRole('button', {
31
36
  name: 'Run all scenarios',
32
37
  });
38
+ this.dialog = page.getByRole('dialog');
33
39
  this.confirmSaveScenarioButton = page
34
40
  .getByTestId('save-scenario-modal')
35
41
  .getByRole('button', { name: 'Save' });
@@ -49,6 +55,8 @@ class PlayPage {
49
55
  this.startInstanceButton = page.getByTestId('undefined-Start instance');
50
56
  this.notifications = page.locator('.cds--toast-notification');
51
57
  this.saveScenarioModal = page.getByTestId('save-scenario-modal');
58
+ this.loadingInstanceDetailsText = this.page.getByText('Loading instance details...');
59
+ this.retryButton = this.page.getByRole('button', { name: 'Retry' });
52
60
  }
53
61
  async waitForCompleteJobButtonToBeAvailable() {
54
62
  await (0, test_1.expect)(this.completeJobButton).toBeVisible({
@@ -59,12 +67,16 @@ class PlayPage {
59
67
  await this.completeJobButton.click();
60
68
  }
61
69
  async clickStartInstanceButton() {
62
- await this.diagram.waitFor({ state: 'visible', timeout: 30000 });
63
70
  const maxRetries = 3;
64
71
  let attempts = 0;
65
72
  while (attempts < maxRetries) {
66
73
  try {
74
+ await this.diagram.waitFor({ state: 'visible', timeout: 30000 });
67
75
  await this.startInstanceButton.click({ timeout: 30000 });
76
+ await (0, test_1.expect)(this.loadingInstanceDetailsText).toBeVisible();
77
+ await (0, test_1.expect)(this.loadingInstanceDetailsText).not.toBeVisible({
78
+ timeout: 60000,
79
+ });
68
80
  return;
69
81
  }
70
82
  catch (error) {
@@ -119,7 +131,7 @@ class PlayPage {
119
131
  const maxRetries = 6; // ~1 min with the waits below
120
132
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
121
133
  try {
122
- await (0, test_1.expect)(locator).toBeVisible({ timeout: 20000 });
134
+ await (0, test_1.expect)(locator.first()).toBeVisible({ timeout: 20000 });
123
135
  return;
124
136
  }
125
137
  catch (e) {
@@ -150,6 +162,9 @@ class PlayPage {
150
162
  .isVisible()
151
163
  .catch(() => false);
152
164
  if (!isModalVisible) {
165
+ await (0, sleep_1.sleep)(3000);
166
+ await (0, test_1.expect)(this.saveScenarioButton).toBeVisible({ timeout: 30000 });
167
+ await (0, test_1.expect)(this.saveScenarioButton).toBeEnabled({ timeout: 30000 });
153
168
  await this.saveScenarioButton.click({ force: true, timeout: 30000 });
154
169
  }
155
170
  }
@@ -157,9 +172,12 @@ class PlayPage {
157
172
  await this.viewScenarioButton.click();
158
173
  }
159
174
  async enterScenarioName(scenarioName) {
160
- const modal = this.page.locator('[data-testid="save-scenario-modal"].is-visible');
161
- await modal.waitFor({ state: 'visible', timeout: 10000 });
162
- const input = modal.locator('input#scenario-name');
175
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.dialog, {
176
+ postAction: async () => {
177
+ await this.saveScenarioButton.click({ timeout: 30000 });
178
+ },
179
+ });
180
+ const input = this.dialog.locator('input#scenario-name');
163
181
  await input.waitFor({ state: 'visible', timeout: 10000 });
164
182
  await input.clear();
165
183
  await input.fill(scenarioName);
@@ -168,7 +186,7 @@ class PlayPage {
168
186
  await this.enterScenarioNameInput.fill(newScenarioName);
169
187
  }
170
188
  async clickViewAllScenariosButton() {
171
- await this.viewAllScenariosButton.click();
189
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.viewAllScenariosButton);
172
190
  }
173
191
  async confirmSaveScenario() {
174
192
  await this.confirmSaveScenarioButton.click();
@@ -197,9 +215,17 @@ class PlayPage {
197
215
  await publishIcon.click({ timeout: 30000 });
198
216
  }
199
217
  async assertScenarioCompleted(scenarioName) {
200
- await (0, test_1.expect)(this.page
218
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.page
201
219
  .locator('tr', { hasText: scenarioName })
202
- .locator('text=Completed')).toBeVisible({ timeout: 60000 });
220
+ .locator('text=Completed'), {
221
+ totalTimeout: 90000,
222
+ visibilityTimeout: 20000,
223
+ postAction: async () => {
224
+ if (await this.retryButton.isVisible()) {
225
+ await this.retryButton.click();
226
+ }
227
+ },
228
+ });
203
229
  }
204
230
  }
205
231
  exports.PlayPage = PlayPage;
@@ -82,6 +82,8 @@ SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
82
82
  SM_8_7_1.test.slow();
83
83
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
84
84
  const processName = 'Play_Test_Process' + randomString;
85
+ const scenarioName = 'My first scenario' + randomString;
86
+ const updatedScenarioName = 'My first scenario-updated' + randomString;
85
87
  await SM_8_7_1.test.step('Open Cross Component Test Project', async () => {
86
88
  await context.clearCookies();
87
89
  await navigationPage.goToModeler();
@@ -97,10 +99,11 @@ SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
97
99
  timeout: 120000,
98
100
  });
99
101
  await modelerCreatePage.enterDiagramName(processName);
100
- await (0, sleep_1.sleep)(2000);
102
+ await modelerCreatePage.addParallelUserTasks(1, 'zeebe-user-task' + randomString);
103
+ await modelerCreatePage.clickSecondPlacedGateway();
101
104
  await modelerCreatePage.clickAppendElementButton();
102
- await modelerCreatePage.clickAppendEndEventButton();
103
- await (0, sleep_1.sleep)(2000);
105
+ await modelerCreatePage.clickAppendEndEventButton('parallelGateway');
106
+ await (0, sleep_1.sleep)(5000);
104
107
  });
105
108
  await SM_8_7_1.test.step('Open Play', async () => {
106
109
  await modelerCreatePage.switchToPlay();
@@ -110,52 +113,51 @@ SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
110
113
  await playPage.dismissStartModal();
111
114
  await playPage.clickStartInstanceButton();
112
115
  await playPage.waitForInstanceDetailsToBeLoaded();
116
+ await playPage.waitForNextElementToBeActive('zeebe-user-task' + randomString + '1');
117
+ await playPage.waitForCompleteJobButtonToBeAvailable();
118
+ await playPage.clickCompleteJobButton();
113
119
  await playPage.waitForProcessToBeCompleted();
114
120
  await playPage.clickSaveScenarioButton();
115
- await playPage.enterScenarioName('My first scenario');
121
+ await playPage.enterScenarioName(scenarioName);
116
122
  await playPage.confirmSaveScenario();
117
123
  await (0, sleep_1.sleep)(2000);
118
124
  });
119
125
  await SM_8_7_1.test.step('Update the saved scenario', async () => {
120
126
  await modelerCreatePage.switchToImplementTab();
121
127
  await (0, sleep_1.sleep)(2000);
122
- await modelerCreatePage.clickStartEvent();
123
- await modelerCreatePage.hoverOnStartEvent();
124
- await modelerCreatePage.clickAppendTaskButton();
125
- await modelerCreatePage.clickChangeTypeButton();
126
- await modelerCreatePage.clickUserTaskOption();
127
- await modelerCreatePage.chooseImplementationOption('zeebeUserTask');
128
- await modelerCreatePage.clickGeneralPropertiesPanel();
129
- await modelerCreatePage.clickElemendIdInput();
130
- await modelerCreatePage.fillElementIdInput('zeebe-user-task' + randomString);
131
- await (0, sleep_1.sleep)(2000);
128
+ await modelerCreatePage.clickFirstPlacedGateway();
132
129
  await modelerCreatePage.clickAppendElementButton();
133
- await modelerCreatePage.clickAppendEndEventButton();
130
+ await modelerCreatePage.clickAppendTaskButton();
131
+ await modelerCreatePage.clickConnectToOtherElementButton();
132
+ await modelerCreatePage.clickSecondPlacedGateway();
133
+ await (0, sleep_1.sleep)(5000);
134
134
  await modelerCreatePage.switchToPlay();
135
135
  await modelerCreatePage.clickContinueToPlay();
136
136
  await (0, sleep_1.sleep)(5000);
137
137
  await playPage.clickStartInstanceButton();
138
- await playPage.waitForNextElementToBeActive('zeebe-user-task' + randomString);
138
+ await playPage.waitForNextElementToBeActive('zeebe-user-task' + randomString + '1');
139
139
  await playPage.waitForCompleteJobButtonToBeAvailable();
140
140
  await playPage.clickCompleteJobButton();
141
141
  await playPage.waitForProcessToBeCompleted();
142
142
  await playPage.clickSaveScenarioButton();
143
- await playPage.enterScenarioName('My first scenario-updated');
143
+ await playPage.enterScenarioName(updatedScenarioName);
144
144
  await playPage.confirmSaveScenario();
145
- await modelerCreatePage.assertScenarioNameVisible('My first scenario-updated');
145
+ await modelerCreatePage.assertScenarioNameVisible(updatedScenarioName);
146
146
  });
147
147
  await SM_8_7_1.test.step('Run all scenarios', async () => {
148
148
  await playPage.clickViewAllScenariosButton();
149
149
  await playPage.clickRunAllScenariosButton();
150
- await playPage.assertScenarioCompleted('My first scenario');
151
- await playPage.assertScenarioCompleted('My first scenario-updated');
150
+ await playPage.assertScenarioCompleted(scenarioName);
151
+ await playPage.assertScenarioCompleted(updatedScenarioName);
152
152
  });
153
153
  await SM_8_7_1.test.step('Delete test scenario', async () => {
154
- await playPage.deleteScenario('My first scenario');
154
+ await playPage.deleteScenario(scenarioName);
155
155
  await playPage.confirmDeleteScenario();
156
- await (0, test_1.expect)(page
157
- .locator('tr')
158
- .filter({ has: page.getByText('My first scenario', { exact: true }) })).toHaveCount(0);
156
+ await (0, test_1.expect)(page.locator('tr').filter({
157
+ has: page.getByText(scenarioName, {
158
+ exact: true,
159
+ }),
160
+ })).toHaveCount(0);
159
161
  });
160
162
  });
161
163
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.178",
3
+ "version": "0.0.179",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",