@camunda/e2e-test-suite 0.0.166 → 0.0.167

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.
@@ -57,6 +57,7 @@ declare class ModelerCreatePage {
57
57
  readonly correlationKeyPayloadInput: Locator;
58
58
  readonly playTab: Locator;
59
59
  readonly continueToPlayButton: Locator;
60
+ readonly implementTab: Locator;
60
61
  readonly candidateUsersInput: Locator;
61
62
  readonly assigneeInput: Locator;
62
63
  readonly candidateGroupsInput: Locator;
@@ -118,11 +119,15 @@ declare class ModelerCreatePage {
118
119
  clickMarketPlaceButton(): Promise<void>;
119
120
  completeDeploymentEndpointConfiguration(): Promise<void>;
120
121
  completePlayConfiguration(): Promise<void>;
122
+ clickContinueToPlay(): Promise<void>;
121
123
  clickWebhookStartEventConnectorOption(): Promise<void>;
122
124
  clickWebhookIdInput(): Promise<void>;
123
125
  clearWebhookIdInput(): Promise<void>;
124
126
  fillWebhookIdInput(webhookId: string): Promise<void>;
125
127
  hoverOnStartEvent(): Promise<void>;
128
+ switchToImplementTab(): Promise<void>;
129
+ clickStartEvent(): Promise<void>;
130
+ assertScenarioNameVisible(scenarioName: string): Promise<void>;
126
131
  instanceStartedAssertion(): Promise<void>;
127
132
  assertImplementationOption(implementationType: string): Promise<void>;
128
133
  chooseImplementationOption(implementationType: string): Promise<void>;
@@ -62,6 +62,7 @@ class ModelerCreatePage {
62
62
  correlationKeyPayloadInput;
63
63
  playTab;
64
64
  continueToPlayButton;
65
+ implementTab;
65
66
  candidateUsersInput;
66
67
  assigneeInput;
67
68
  candidateGroupsInput;
@@ -192,6 +193,7 @@ class ModelerCreatePage {
192
193
  .locator('g:nth-child(8) > .djs-element > .djs-hit')
193
194
  .first();
194
195
  this.processIdSecondLocator = page.getByLabel('Process ID');
196
+ this.implementTab = page.getByRole('tab', { name: 'Implement' });
195
197
  this.bpmnReplaceMenu = page.getByTestId('bpmn-replace');
196
198
  }
197
199
  async deployProcessInstance() {
@@ -319,6 +321,7 @@ class ModelerCreatePage {
319
321
  }
320
322
  }
321
323
  async clickElemendIdInput() {
324
+ await this.elemendIdInput.waitFor({ state: 'visible', timeout: 10000 });
322
325
  await this.elemendIdInput.click();
323
326
  }
324
327
  async fillElementIdInput(id) {
@@ -619,6 +622,9 @@ class ModelerCreatePage {
619
622
  }
620
623
  }
621
624
  }
625
+ async clickContinueToPlay() {
626
+ await this.continueToPlayButton.click({ timeout: 30000 });
627
+ }
622
628
  async clickWebhookStartEventConnectorOption() {
623
629
  const maxRetries = 3;
624
630
  for (let retries = 0; retries < maxRetries; retries++) {
@@ -656,6 +662,15 @@ class ModelerCreatePage {
656
662
  async hoverOnStartEvent() {
657
663
  await this.hoverOnLocator(this.startEventElement, '.djs-context-pad');
658
664
  }
665
+ async switchToImplementTab() {
666
+ await this.implementTab.click({ timeout: 30000 });
667
+ }
668
+ async clickStartEvent() {
669
+ await this.startEventElement.click({ timeout: 30000 });
670
+ }
671
+ async assertScenarioNameVisible(scenarioName) {
672
+ await (0, test_1.expect)(this.page.getByTestId('instance-header').getByText(scenarioName)).toBeVisible();
673
+ }
659
674
  async instanceStartedAssertion() {
660
675
  try {
661
676
  await (0, test_1.expect)(this.page.getByText('Instance started!')).toBeVisible({
@@ -2,6 +2,19 @@ import { Page, Locator } from '@playwright/test';
2
2
  declare class PlayPage {
3
3
  private page;
4
4
  readonly completeJobButton: Locator;
5
+ readonly saveScenarioButton: Locator;
6
+ readonly viewScenarioButton: Locator;
7
+ readonly runAllScenariosButton: Locator;
8
+ readonly confirmSaveScenarioButton: Locator;
9
+ readonly enterScenarioNameInput: Locator;
10
+ readonly confirmDeleteScenarioButton: Locator;
11
+ readonly viewAllScenariosButton: Locator;
12
+ readonly getScenarioRowByName: (scenarioName: string) => Locator;
13
+ readonly getScenarioRow: (scenarioName: string) => Locator;
14
+ readonly diagram: Locator;
15
+ readonly startInstanceButton: Locator;
16
+ readonly notifications: Locator;
17
+ readonly saveScenarioModal: Locator;
5
18
  constructor(page: Page);
6
19
  waitForCompleteJobButtonToBeAvailable(): Promise<void>;
7
20
  clickCompleteJobButton(): Promise<void>;
@@ -10,5 +23,17 @@ declare class PlayPage {
10
23
  waitForInstanceDetailsToBeLoaded(): Promise<void>;
11
24
  waitForNextElementToBeActive(historyItem: string): Promise<void>;
12
25
  waitForProcessToBeCompleted(): Promise<void>;
26
+ clickSaveScenarioButton(): Promise<void>;
27
+ clickViewScenarioButton(): Promise<void>;
28
+ enterScenarioName(scenarioName: string): Promise<void>;
29
+ updateScenarioName(newScenarioName: string): Promise<void>;
30
+ clickViewAllScenariosButton(): Promise<void>;
31
+ confirmSaveScenario(): Promise<void>;
32
+ getDeleteIconForScenario(scenarioName: string): Promise<Locator>;
33
+ deleteScenario(scenarioName: string): Promise<void>;
34
+ confirmDeleteScenario(): Promise<void>;
35
+ clickRunAllScenariosButton(): Promise<void>;
36
+ clickmessagePublishButton(): Promise<void>;
37
+ assertScenarioCompleted(scenarioName: string): Promise<void>;
13
38
  }
14
39
  export { PlayPage };
@@ -2,15 +2,53 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PlayPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
- const maxWaitTimeSeconds = 120000;
5
+ const sleep_1 = require("../../utils/sleep");
6
+ const maxWaitTimeSeconds = 180000;
6
7
  class PlayPage {
7
8
  page;
8
9
  completeJobButton;
10
+ saveScenarioButton;
11
+ viewScenarioButton;
12
+ runAllScenariosButton;
13
+ confirmSaveScenarioButton;
14
+ enterScenarioNameInput;
15
+ confirmDeleteScenarioButton;
16
+ viewAllScenariosButton;
17
+ getScenarioRowByName;
18
+ getScenarioRow;
19
+ diagram;
20
+ startInstanceButton;
21
+ notifications;
22
+ saveScenarioModal;
9
23
  constructor(page) {
10
24
  this.page = page;
11
25
  this.completeJobButton = page
12
26
  .getByTestId('diagram')
13
27
  .getByLabel('Complete job');
28
+ this.saveScenarioButton = page.getByRole('button', { name: 'Save scenario' });
29
+ this.viewScenarioButton = page.getByRole('button', { name: 'View scenario' });
30
+ this.runAllScenariosButton = page.getByRole('button', {
31
+ name: 'Run all scenarios',
32
+ });
33
+ this.confirmSaveScenarioButton = page
34
+ .getByTestId('save-scenario-modal')
35
+ .getByRole('button', { name: 'Save' });
36
+ this.enterScenarioNameInput = page
37
+ .getByTestId('save-scenario-modal')
38
+ .locator('input#scenario-name')
39
+ .first();
40
+ this.confirmDeleteScenarioButton = page.getByRole('button', {
41
+ name: 'danger Delete',
42
+ });
43
+ this.viewAllScenariosButton = page.getByRole('button', {
44
+ name: '(View all)',
45
+ });
46
+ this.getScenarioRowByName = (scenarioName) => page.locator('tr', { hasText: scenarioName });
47
+ this.getScenarioRow = (scenarioName) => page.locator('tr', { hasText: scenarioName });
48
+ this.diagram = page.getByTestId('diagram');
49
+ this.startInstanceButton = page.getByTestId('undefined-Start instance');
50
+ this.notifications = page.locator('.cds--toast-notification');
51
+ this.saveScenarioModal = page.getByTestId('save-scenario-modal');
14
52
  }
15
53
  async waitForCompleteJobButtonToBeAvailable() {
16
54
  await (0, test_1.expect)(this.completeJobButton).toBeVisible({
@@ -21,14 +59,39 @@ class PlayPage {
21
59
  await this.completeJobButton.click();
22
60
  }
23
61
  async clickStartInstanceButton() {
24
- await this.page.getByTestId('diagram').getByLabel('Start instance').click();
62
+ await this.diagram.waitFor({ state: 'visible', timeout: 30000 });
63
+ const maxRetries = 3;
64
+ let attempts = 0;
65
+ while (attempts < maxRetries) {
66
+ try {
67
+ await this.startInstanceButton.click({ timeout: 30000 });
68
+ return;
69
+ }
70
+ catch (error) {
71
+ if (attempts >= maxRetries - 1)
72
+ throw error;
73
+ await this.page.reload();
74
+ await (0, sleep_1.sleep)(2000);
75
+ attempts++;
76
+ }
77
+ }
25
78
  }
26
79
  async dismissStartModal() {
27
- await this.page
28
- .getByRole('button', {
29
- name: 'Start a process instance',
30
- })
31
- .click();
80
+ const buttonVariations = [
81
+ 'Start a process instance',
82
+ 'Start another instance',
83
+ 'Start new instance',
84
+ 'Start instance',
85
+ ];
86
+ for (const buttonName of buttonVariations) {
87
+ const button = this.page.getByRole('button', { name: buttonName });
88
+ const count = await button.count();
89
+ if (count > 0) {
90
+ await button.click();
91
+ return;
92
+ }
93
+ }
94
+ throw new Error('Could not find start instance button with any expected variation');
32
95
  }
33
96
  async waitForInstanceDetailsToBeLoaded() {
34
97
  const maxRetries = 2;
@@ -57,15 +120,73 @@ class PlayPage {
57
120
  });
58
121
  }
59
122
  async waitForProcessToBeCompleted() {
123
+ const incidentText = await this.page.getByText(/incident/i).count();
124
+ if (incidentText > 0) {
125
+ throw new Error('Process has an incident instead of completing');
126
+ }
127
+ await (0, test_1.expect)(this.page.getByText(/completed/i)).toBeVisible({
128
+ timeout: maxWaitTimeSeconds,
129
+ });
130
+ }
131
+ async clickSaveScenarioButton() {
132
+ await this.notifications
133
+ .first()
134
+ .waitFor({ state: 'hidden', timeout: 15000 })
135
+ .catch(() => { });
136
+ const isModalVisible = await this.saveScenarioModal
137
+ .isVisible()
138
+ .catch(() => false);
139
+ if (!isModalVisible) {
140
+ await this.saveScenarioButton.click({ force: true, timeout: 30000 });
141
+ }
142
+ }
143
+ async clickViewScenarioButton() {
144
+ await this.viewScenarioButton.click();
145
+ }
146
+ async enterScenarioName(scenarioName) {
147
+ const modal = this.page.locator('[data-testid="save-scenario-modal"].is-visible');
148
+ await modal.waitFor({ state: 'visible', timeout: 10000 });
149
+ const input = modal.locator('input#scenario-name');
150
+ await input.waitFor({ state: 'visible', timeout: 10000 });
151
+ await input.clear();
152
+ await input.fill(scenarioName);
153
+ }
154
+ async updateScenarioName(newScenarioName) {
155
+ await this.enterScenarioNameInput.fill(newScenarioName);
156
+ }
157
+ async clickViewAllScenariosButton() {
158
+ await this.viewAllScenariosButton.click();
159
+ }
160
+ async confirmSaveScenario() {
161
+ await this.confirmSaveScenarioButton.click();
162
+ }
163
+ async getDeleteIconForScenario(scenarioName) {
164
+ const scenarioRow = this.page
165
+ .locator('tr')
166
+ .filter({ has: this.page.getByText(scenarioName, { exact: true }) });
167
+ return scenarioRow.getByLabel('Delete scenario');
168
+ }
169
+ async deleteScenario(scenarioName) {
170
+ const deleteIcon = await this.getDeleteIconForScenario(scenarioName);
171
+ await deleteIcon.click();
172
+ }
173
+ async confirmDeleteScenario() {
174
+ await this.confirmDeleteScenarioButton.click();
175
+ }
176
+ async clickRunAllScenariosButton() {
177
+ await this.runAllScenariosButton.click();
178
+ }
179
+ async clickmessagePublishButton() {
180
+ await this.diagram.waitFor({ state: 'visible', timeout: 30000 });
181
+ const publishIcon = this.diagram
182
+ .locator('div.djs-overlays')
183
+ .getByLabel('Publish message', { exact: true });
184
+ await publishIcon.click({ timeout: 30000 });
185
+ }
186
+ async assertScenarioCompleted(scenarioName) {
60
187
  await (0, test_1.expect)(this.page
61
- .getByRole('heading', {
62
- name: 'Congratulations, you did it!',
63
- exact: true,
64
- })
65
- .or(this.page.getByRole('heading', {
66
- name: 'Scenario recorded!',
67
- exact: true,
68
- }))).toBeVisible({ timeout: maxWaitTimeSeconds });
188
+ .locator('tr', { hasText: scenarioName })
189
+ .locator('text=Completed')).toBeVisible({ timeout: 30000 });
69
190
  }
70
191
  }
71
192
  exports.PlayPage = PlayPage;
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const test_1 = require("@playwright/test");
4
4
  const SM_8_7_1 = require("../../fixtures/SM-8.7");
5
5
  const _setup_1 = require("../../test-setup.js");
6
+ const sleep_1 = require("../../utils/sleep");
6
7
  const KeycloakUtils_1 = require("../../pages/SM-8.7/KeycloakUtils");
7
8
  const loggingUtils_1 = require("../../utils/loggingUtils");
9
+ SM_8_7_1.test.describe.configure({ mode: 'parallel' });
8
10
  SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
9
11
  SM_8_7_1.test.beforeEach(async ({ navigationPage, identityPage, identityTenantPage, keycloakLoginPage, keycloakAdminPage, }, testInfo) => {
10
12
  (0, loggingUtils_1.setupTestLogging)(testInfo);
@@ -34,36 +36,30 @@ SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
34
36
  timeout: 120000,
35
37
  });
36
38
  await modelerCreatePage.enterDiagramName(processName);
37
- // Add a user task with Job worker implementation (default)
38
- await modelerCreatePage.clickAppendElementButton();
39
- await modelerCreatePage.clickAppendTaskButton();
40
- await modelerCreatePage.clickChangeTypeButton();
41
- await modelerCreatePage.clickUserTaskOption();
42
- await modelerCreatePage.chooseImplementationOption('jobWorker');
43
- await modelerCreatePage.clickGeneralPropertiesPanel();
44
- await modelerCreatePage.clickElemendIdInput();
45
- await modelerCreatePage.fillElementIdInput('tasklist-user-task' + randomString);
46
- // Add a user task with Zeebe user task implementation
39
+ await (0, sleep_1.sleep)(2000);
47
40
  await modelerCreatePage.clickAppendElementButton();
48
41
  await modelerCreatePage.clickAppendTaskButton();
49
42
  await modelerCreatePage.clickChangeTypeButton();
50
43
  await modelerCreatePage.clickUserTaskOption();
51
44
  await modelerCreatePage.chooseImplementationOption('zeebeUserTask');
45
+ await modelerCreatePage.clickGeneralPropertiesPanel();
52
46
  await modelerCreatePage.clickElemendIdInput();
53
47
  await modelerCreatePage.fillElementIdInput('zeebe-user-task' + randomString);
54
- // Add a service task
48
+ await (0, sleep_1.sleep)(1000);
55
49
  await modelerCreatePage.clickAppendElementButton();
56
50
  await modelerCreatePage.clickAppendTaskButton();
57
51
  await modelerCreatePage.clickChangeTypeButton();
58
52
  await modelerCreatePage.clickServiceTaskOption();
53
+ await modelerCreatePage.clickGeneralPropertiesPanel();
59
54
  await modelerCreatePage.clickElemendIdInput();
60
55
  await modelerCreatePage.fillElementIdInput('service-task' + randomString);
61
56
  await modelerCreatePage.clickTaskDefinitionPropertiesPanel();
62
57
  await modelerCreatePage.clickJobTypeInput();
63
58
  await modelerCreatePage.fillJobTypeInput('someJob' + randomString);
64
- // Add end event
59
+ await (0, sleep_1.sleep)(1000);
65
60
  await modelerCreatePage.clickAppendElementButton();
66
61
  await modelerCreatePage.clickAppendEndEventButton();
62
+ await (0, sleep_1.sleep)(2000);
67
63
  });
68
64
  await SM_8_7_1.test.step('Open Play', async () => {
69
65
  await modelerCreatePage.switchToPlay();
@@ -73,19 +69,93 @@ SM_8_7_1.test.describe('Deploy and run a process in Play', () => {
73
69
  await playPage.dismissStartModal();
74
70
  await playPage.clickStartInstanceButton();
75
71
  await playPage.waitForInstanceDetailsToBeLoaded();
76
- // wait for and complete the "tasklist user task"
77
- await playPage.waitForNextElementToBeActive('tasklist-user-task' + randomString);
78
- await playPage.waitForCompleteJobButtonToBeAvailable();
79
- await playPage.clickCompleteJobButton();
80
- // wait for and complete the "zeebe user task"
81
72
  await playPage.waitForNextElementToBeActive('zeebe-user-task' + randomString);
82
73
  await playPage.waitForCompleteJobButtonToBeAvailable();
83
74
  await playPage.clickCompleteJobButton();
84
- // wait for and complete the "service task"
85
75
  await playPage.waitForNextElementToBeActive('service-task' + randomString);
86
76
  await playPage.waitForCompleteJobButtonToBeAvailable();
87
77
  await playPage.clickCompleteJobButton();
88
78
  await playPage.waitForProcessToBeCompleted();
89
79
  });
90
80
  });
81
+ (0, SM_8_7_1.test)('Create,update and delete test scenarios in play', async ({ modelerHomePage, modelerCreatePage, playPage, context, navigationPage, page, }) => {
82
+ SM_8_7_1.test.slow();
83
+ const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
84
+ const processName = 'Play_Test_Process' + randomString;
85
+ await SM_8_7_1.test.step('Open Cross Component Test Project', async () => {
86
+ await context.clearCookies();
87
+ await navigationPage.goToModeler();
88
+ await modelerHomePage.clickCreateNewProjectButton();
89
+ await modelerHomePage.createCrossComponentProjectFolder();
90
+ });
91
+ await SM_8_7_1.test.step('Add A BPMN Template To The Project', async () => {
92
+ await modelerHomePage.clickDiagramTypeDropdown();
93
+ await modelerHomePage.clickBpmnTemplateOption();
94
+ });
95
+ await SM_8_7_1.test.step('Create a BPMN Diagram with simple start and end event', async () => {
96
+ await (0, test_1.expect)(modelerCreatePage.generalPanel).toBeVisible({
97
+ timeout: 120000,
98
+ });
99
+ await modelerCreatePage.enterDiagramName(processName);
100
+ await (0, sleep_1.sleep)(2000);
101
+ await modelerCreatePage.clickAppendElementButton();
102
+ await modelerCreatePage.clickAppendEndEventButton();
103
+ await (0, sleep_1.sleep)(2000);
104
+ });
105
+ await SM_8_7_1.test.step('Open Play', async () => {
106
+ await modelerCreatePage.switchToPlay();
107
+ await modelerCreatePage.completePlayConfiguration();
108
+ });
109
+ await SM_8_7_1.test.step('Start and complete the process instance in Play and save scenario', async () => {
110
+ await playPage.dismissStartModal();
111
+ await playPage.clickStartInstanceButton();
112
+ await playPage.waitForInstanceDetailsToBeLoaded();
113
+ await playPage.waitForProcessToBeCompleted();
114
+ await playPage.clickSaveScenarioButton();
115
+ await playPage.enterScenarioName('My first scenario');
116
+ await playPage.confirmSaveScenario();
117
+ await (0, sleep_1.sleep)(2000);
118
+ });
119
+ await SM_8_7_1.test.step('Update the saved scenario', async () => {
120
+ await modelerCreatePage.switchToImplementTab();
121
+ 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);
132
+ await modelerCreatePage.clickAppendElementButton();
133
+ await modelerCreatePage.clickAppendEndEventButton();
134
+ await modelerCreatePage.switchToPlay();
135
+ await modelerCreatePage.clickContinueToPlay();
136
+ await (0, sleep_1.sleep)(2000);
137
+ await playPage.clickStartInstanceButton();
138
+ await playPage.waitForNextElementToBeActive('zeebe-user-task' + randomString);
139
+ await playPage.waitForCompleteJobButtonToBeAvailable();
140
+ await playPage.clickCompleteJobButton();
141
+ await playPage.waitForProcessToBeCompleted();
142
+ await playPage.clickSaveScenarioButton();
143
+ await playPage.enterScenarioName('My first scenario-updated');
144
+ await playPage.confirmSaveScenario();
145
+ await modelerCreatePage.assertScenarioNameVisible('My first scenario-updated');
146
+ });
147
+ await SM_8_7_1.test.step('Run all scenarios', async () => {
148
+ await playPage.clickViewAllScenariosButton();
149
+ await playPage.clickRunAllScenariosButton();
150
+ await playPage.assertScenarioCompleted('My first scenario');
151
+ await playPage.assertScenarioCompleted('My first scenario-updated');
152
+ });
153
+ await SM_8_7_1.test.step('Delete test scenario', async () => {
154
+ await playPage.deleteScenario('My first scenario');
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);
159
+ });
160
+ });
91
161
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.166",
3
+ "version": "0.0.167",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",