@digital-ai/devops-page-object-release 0.0.43 → 0.0.45

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - ed8b3aa: S-118019: Migrate notification scenario into playwright
8
+ - 504d835: S-119461: Migrated task-modified-scenario into playwright
9
+ - 80856ce: S-119233: Migrated password-in-variables script to playwright
10
+ - 8f8dc5e: S-119235: S-119236: Migrated sequential-group and task-status-link scripts in playwright
11
+ - f10a7bb: S-119234: Migrating script-task-scenario in playwright
12
+
13
+ ## 0.0.44
14
+
15
+ ### Patch Changes
16
+
17
+ - 1efd9c6: Update locator for CRT template
18
+
3
19
  ## 0.0.43
4
20
 
5
21
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1707,6 +1707,9 @@ class $6c924a95a765a086$export$15d3f9b095bb5188 extends (0, $f8721861c660dd88$ex
1707
1707
  async expectCommentToContain(comment) {
1708
1708
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".markdown-wrapper").getByText(comment)).toBeVisible();
1709
1709
  }
1710
+ async expectCommentToContainLink(hrefLink) {
1711
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".markdown-wrapper a")).toHaveAttribute("href", hrefLink);
1712
+ }
1710
1713
  async expectTaskIsCommentable(isCommentable) {
1711
1714
  return (0, $kKeXs$playwrighttest.expect)(await this.page.locator("#task-comment").count()).toBe(isCommentable ? 1 : 0);
1712
1715
  }
@@ -1805,6 +1808,26 @@ class $6e382f24d680cc9b$export$a87b4660f21fba58 extends (0, $f8721861c660dd88$ex
1805
1808
  hasText: tagName
1806
1809
  })).toBeVisible();
1807
1810
  }
1811
+ async selectAttributeType(type) {
1812
+ await this.page.locator("#facet-type").selectOption(type);
1813
+ }
1814
+ async fillInputValue(labelName, value) {
1815
+ await this.page.getByRole("combobox", {
1816
+ name: labelName
1817
+ }).click();
1818
+ await this.page.getByRole("combobox", {
1819
+ name: labelName
1820
+ }).fill(value);
1821
+ await this.page.getByRole("option", {
1822
+ name: "value"
1823
+ }).click();
1824
+ }
1825
+ async saveAttributes() {
1826
+ await this.page.getByTestId("save-btn").click();
1827
+ }
1828
+ async cancelAttribute() {
1829
+ await this.page.getByTestId("cancel-btn").click();
1830
+ }
1808
1831
  }
1809
1832
 
1810
1833
 
@@ -1999,6 +2022,13 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
1999
2022
  await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
2000
2023
  await this.railLocator.locator(`textarea[id="${propertyName}"]`).fill(value);
2001
2024
  }
2025
+ async setValueForBody(value) {
2026
+ await this.railLocator.locator(".notification-body-field .markdown-viewer").focus();
2027
+ await this.railLocator.locator(".notification-body-field .markdown-viewer").dblclick();
2028
+ await this.railLocator.locator("#notification-body").fill(value);
2029
+ await this.railLocator.locator("#notification-body").press("Enter");
2030
+ await this.railLocator.getByTestId("save-button").click();
2031
+ }
2002
2032
  async setValueFromPassword(propertyName, value) {
2003
2033
  await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
2004
2034
  }
@@ -2016,10 +2046,10 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2016
2046
  return this;
2017
2047
  }
2018
2048
  async createNewVariableForField(objectID, variable) {
2019
- await this.page.locator(`div[data-testid="${objectID}"] .icon-variable`).waitFor({
2020
- timeout: 10000
2049
+ const variable_icon = this.page.locator(`div[data-testid="${objectID}"] .icon-variable`);
2050
+ if (await variable_icon.isVisible()) await variable_icon.click({
2051
+ timeout: 1000
2021
2052
  });
2022
- await this.page.locator(`div[data-testid="${objectID}"] .icon-variable`).click();
2023
2053
  await this.page.locator(`#${objectID}`).fill(variable);
2024
2054
  await this.railLocator.locator(`.dot-popper button`, {
2025
2055
  hasText: variable
@@ -2069,6 +2099,14 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2069
2099
  async expectTo(value) {
2070
2100
  return await (0, $kKeXs$playwrighttest.expect)(this.railLocator.getByTestId(`dot-autocomplete-chip`)).toHaveText(value);
2071
2101
  }
2102
+ async expectAutoCompleteFieldValue(label, value) {
2103
+ await (0, $kKeXs$playwrighttest.expect)(this.railLocator.locator(".task-input-property").filter({
2104
+ hasText: label
2105
+ }).getByTestId("dot-autocomplete-chip")).toContainText(value);
2106
+ }
2107
+ async expectFieldValue(fieldName, value) {
2108
+ await (0, $kKeXs$playwrighttest.expect)(this.railLocator.locator(`input[name="${fieldName}"]`)).toHaveValue(value);
2109
+ }
2072
2110
  async expectSubjectToBe(value) {
2073
2111
  return await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#notification-subject")).toHaveValue(value);
2074
2112
  }
@@ -2254,8 +2292,8 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2254
2292
  }).click();
2255
2293
  }
2256
2294
  async setTemplate(templateName) {
2257
- await this.page.getByLabel("Template").click();
2258
- await this.page.getByLabel("Template").fill(templateName);
2295
+ await this.page.locator("#templateId").click();
2296
+ await this.page.locator("#templateId").fill(templateName);
2259
2297
  await this.page.getByRole("option", {
2260
2298
  name: templateName
2261
2299
  }).click();
@@ -2320,6 +2358,23 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2320
2358
  await this.page.locator(`[data-test-id="${fieldID}"]`).nth(1).click();
2321
2359
  await this.page.locator(`input[name='${fieldID}']`).fill(value);
2322
2360
  }
2361
+ async setEmailField(fieldName, value) {
2362
+ await this.page.getByLabel(`${fieldName}`, {
2363
+ exact: true
2364
+ }).click();
2365
+ await this.page.getByLabel(`${fieldName}`, {
2366
+ exact: true
2367
+ }).clear();
2368
+ await this.page.getByLabel(`${fieldName}`, {
2369
+ exact: true
2370
+ }).fill(value);
2371
+ await this.page.getByLabel(`${fieldName}`, {
2372
+ exact: true
2373
+ }).press("Enter");
2374
+ }
2375
+ async selectValueFromOption(fieldId, value) {
2376
+ await this.page.locator(`#${fieldId}`).selectOption(value);
2377
+ }
2323
2378
  async abortButtonVisibility(visible = true) {
2324
2379
  const locator = this.page.getByRole("button", {
2325
2380
  name: "Abort"
@@ -2464,6 +2519,9 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2464
2519
  await this.page.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
2465
2520
  await this.page.locator(`input[id="${propertyName}"]`).fill(value);
2466
2521
  }
2522
+ async toggleIgnoreVariableInterpolation() {
2523
+ await this.page.getByLabel("Ignore variable interpolation").click();
2524
+ }
2467
2525
  }
2468
2526
  class $eb81c1b930e440ff$export$bb6ccfada3e7d0f7 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
2469
2527
  constructor(page){
@@ -2913,7 +2971,7 @@ class $6a21661eb4695574$export$e946776eae644790 extends (0, $f8721861c660dd88$ex
2913
2971
  }).getByTestId("expand-btn")).toBeVisible();
2914
2972
  }
2915
2973
  async expectAssignedTo(username) {
2916
- await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("button", {
2974
+ await (0, $kKeXs$playwrighttest.expect)(this.taskDrawerLocator.getByRole("button", {
2917
2975
  name: username
2918
2976
  })).toBeVisible();
2919
2977
  }
@@ -3016,6 +3074,42 @@ class $6a21661eb4695574$export$e946776eae644790 extends (0, $f8721861c660dd88$ex
3016
3074
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-header-top-path")).toContainText(phaseName);
3017
3075
  await this.expectTaskTitle(taskTitle);
3018
3076
  }
3077
+ async expectTaskStatusLine(statusLine) {
3078
+ await (0, $kKeXs$playwrighttest.expect)(this.taskDrawerLocator.locator(`.task-status-line`)).toHaveText(statusLine);
3079
+ }
3080
+ async expectTaskStatusLineHref(link) {
3081
+ await (0, $kKeXs$playwrighttest.expect)(this.taskDrawerLocator.locator(`.task-status-line a`)).toHaveAttribute("href", link);
3082
+ }
3083
+ async expectNoTaskActionButton() {
3084
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-action-buttons")).not.toBeVisible();
3085
+ }
3086
+ async clickTaskOptionIcon() {
3087
+ await this.page.getByTestId("task-options-button").click();
3088
+ }
3089
+ async deleteTaskFromOption() {
3090
+ await this.clickTaskOptionIcon();
3091
+ await this.page.getByText("Delete task").click();
3092
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("heading", {
3093
+ name: "Delete task"
3094
+ })).toBeVisible();
3095
+ await this.page.getByRole("button", {
3096
+ name: "Delete"
3097
+ }).click();
3098
+ }
3099
+ async duplicateTaskFromOption() {
3100
+ await this.clickTaskOptionIcon();
3101
+ await this.page.getByText("Duplicate").click();
3102
+ }
3103
+ async expectOptionNotVisible(option) {
3104
+ await this.clickTaskOptionIcon();
3105
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByText(option)).not.toBeVisible();
3106
+ }
3107
+ async refresh() {
3108
+ await this.page.getByTestId("refresh-btn").click();
3109
+ }
3110
+ async expectRefreshButtonNotVisible() {
3111
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByTestId("refresh-btn")).not.toBeVisible();
3112
+ }
3019
3113
  }
3020
3114
 
3021
3115
 
@@ -3928,6 +4022,13 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
3928
4022
  timeout: timeout
3929
4023
  });
3930
4024
  }
4025
+ async waitForTaskFailing(taskTitle) {
4026
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task.failing").getByText(taskTitle, {
4027
+ exact: true
4028
+ })).toBeVisible({
4029
+ timeout: 10000
4030
+ });
4031
+ }
3931
4032
  async waitForTaskSkipped(taskTitle, timeout = this.defaultTimeout) {
3932
4033
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task.skipped").getByText(taskTitle, {
3933
4034
  exact: true
@@ -3956,6 +4057,17 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
3956
4057
  timeout: timeout
3957
4058
  });
3958
4059
  }
4060
+ async expectTaskStatusLineToContain(taskTitle, info) {
4061
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task").filter({
4062
+ hasText: taskTitle
4063
+ }).locator(".status-line")).toContainText(info);
4064
+ }
4065
+ async expectTaskStatusLineToContainHref(taskTitle, link) {
4066
+ const taskInfo = this.page.locator(".task").filter({
4067
+ hasText: taskTitle
4068
+ }).locator(".status-line a");
4069
+ await (0, $kKeXs$playwrighttest.expect)(taskInfo).toHaveAttribute("href", link);
4070
+ }
3959
4071
  async waitForTaskStarted(taskTitle, timeout = this.defaultTimeout) {
3960
4072
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task.in_progress").getByTitle(taskTitle, {
3961
4073
  exact: true
@@ -3963,9 +4075,11 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
3963
4075
  timeout: timeout
3964
4076
  });
3965
4077
  }
3966
- async waitForTaskPlanned(title, timeout = this.defaultTimeout) {
3967
- await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.task:has-text('${title}').planned`)).toBeVisible({
3968
- timeout: timeout
4078
+ async waitForTaskPlanned(title) {
4079
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task.planned").getByText(title, {
4080
+ exact: true
4081
+ })).toBeVisible({
4082
+ timeout: 10000
3969
4083
  });
3970
4084
  }
3971
4085
  async clickOnStatusLine(statusLine) {
@@ -4029,7 +4143,9 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
4029
4143
  }
4030
4144
  async openVariables() {
4031
4145
  await this.util.openSideNavMenu("Variables");
4032
- await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Variables")).toBeVisible();
4146
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Variables", {
4147
+ exact: true
4148
+ })).toBeVisible();
4033
4149
  }
4034
4150
  async openProperties() {
4035
4151
  await this.util.openSideNavMenu("Properties");
@@ -4510,9 +4626,7 @@ class $9b9a8c3da392d020$var$Phase extends (0, $f8721861c660dd88$export$2b65d1d97
4510
4626
  }
4511
4627
  // eslint-disable-next-line max-params
4512
4628
  async addTaskInGroup(currentGroupType, taskTitle, taskGroup, taskType) {
4513
- const groupTaskLocator = this.phaseLocator.filter({
4514
- hasText: "Dev.Phase"
4515
- }).locator("li").filter({
4629
+ const groupTaskLocator = this.phaseLocator.locator("li").filter({
4516
4630
  hasText: currentGroupType
4517
4631
  }).locator("a.add-task.link");
4518
4632
  await groupTaskLocator.click();
@@ -4523,6 +4637,7 @@ class $9b9a8c3da392d020$var$Phase extends (0, $f8721861c660dd88$export$2b65d1d97
4523
4637
  await this.page.locator(".icon-close").click();
4524
4638
  await this.page.locator("#task-title").fill(taskTitle);
4525
4639
  await this.page.getByTestId("save-select-task-btn").click();
4640
+ await this.page.locator("#release-header").click();
4526
4641
  await (0, $kKeXs$playwrighttest.expect)(this.phaseLocator.filter({
4527
4642
  hasText: currentGroupType
4528
4643
  }).getByText(taskTitle)).toBeVisible();
@@ -7183,6 +7298,7 @@ class $3048f12d9d777352$export$98de9bca7d44fc1a extends (0, $f8721861c660dd88$ex
7183
7298
  class $b12db2561a3bf785$export$899a7095bab1879d extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
7184
7299
  constructor(page){
7185
7300
  super(page);
7301
+ this.create = new $b12db2561a3bf785$export$bad60adab28720fb(page);
7186
7302
  }
7187
7303
  async expectAllowConcurrentReleasesFromTrigger(expectedValue) {
7188
7304
  if (expectedValue) {
@@ -7209,6 +7325,67 @@ class $b12db2561a3bf785$export$899a7095bab1879d extends (0, $f8721861c660dd88$ex
7209
7325
  async expectNoNewTriggerButtonShown() {
7210
7326
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".trigger-header a.button.primary")).not.toBeVisible();
7211
7327
  }
7328
+ async clickAddTrigger() {
7329
+ await this.page.getByRole("button", {
7330
+ name: "Add trigger"
7331
+ }).click();
7332
+ return new $b12db2561a3bf785$export$bad60adab28720fb(this.page);
7333
+ }
7334
+ async openContextualMenuForTrigger(triggerName) {
7335
+ await this.page.locator(".xlr-trigger-row").filter({
7336
+ has: this.page.locator('div[data-test-column="triggerTitle"]').getByText(triggerName)
7337
+ }).locator(".context-menu-button").click();
7338
+ return this;
7339
+ }
7340
+ async selectContextualMenuItem(triggerName, menuItem) {
7341
+ await this.openContextualMenuForTrigger(triggerName);
7342
+ await this.page.locator("#context-menu-container").getByRole("menuitem", {
7343
+ name: menuItem
7344
+ }).click();
7345
+ return this;
7346
+ }
7347
+ }
7348
+ class $b12db2561a3bf785$export$bad60adab28720fb extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
7349
+ constructor(page){
7350
+ super(page);
7351
+ }
7352
+ async setTriggerTitle(title) {
7353
+ await this.page.locator("#title").fill(title);
7354
+ }
7355
+ async setTriggerType(triggerType) {
7356
+ await this.page.getByRole("textbox", {
7357
+ name: "Select trigger type..."
7358
+ }).click();
7359
+ await this.page.getByRole("textbox", {
7360
+ name: "Select trigger type..."
7361
+ }).fill(triggerType);
7362
+ await this.page.getByText(triggerType).click();
7363
+ }
7364
+ async setFieldInput(field, value) {
7365
+ await this.page.getByRole("textbox", {
7366
+ name: field
7367
+ }).click();
7368
+ await this.page.getByRole("textbox", {
7369
+ name: field
7370
+ }).fill(value);
7371
+ }
7372
+ async setValuesForVariable(variableId, value) {
7373
+ await this.page.locator(`#${variableId}`).scrollIntoViewIfNeeded();
7374
+ await this.page.locator(`#${variableId}`).click();
7375
+ await this.page.locator(`#${variableId} input`).clear();
7376
+ await this.page.locator(`#${variableId} input`).fill(value);
7377
+ return this;
7378
+ }
7379
+ async save() {
7380
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".action-toolbar-actions button").filter({
7381
+ hasText: "Save"
7382
+ })).toBeEnabled();
7383
+ await this.page.locator(".action-toolbar-actions button").filter({
7384
+ hasText: "Save"
7385
+ }).click({
7386
+ force: true
7387
+ });
7388
+ }
7212
7389
  }
7213
7390
 
7214
7391
 
@@ -7300,7 +7477,9 @@ class $959d38250779aa22$export$8c8e7207254accc2 extends (0, $f8721861c660dd88$ex
7300
7477
  }
7301
7478
  async openTriggers() {
7302
7479
  await this.openTemplateMenu("Triggers");
7303
- await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Triggers")).toBeVisible();
7480
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Triggers", {
7481
+ exact: true
7482
+ })).toBeVisible();
7304
7483
  }
7305
7484
  async backToTemplate() {
7306
7485
  await this.page.locator(".icon-back").click();
@@ -8113,6 +8292,10 @@ class $3ec0e9cf832fdde8$var$ConfigurationInstancePage extends (0, $f8721861c660d
8113
8292
  await this.page.getByLabel(fieldName).click();
8114
8293
  return this;
8115
8294
  }
8295
+ // To avoid flakiness and clicking around the page, we can directly click on the header
8296
+ async clickHeader() {
8297
+ await this.page.locator(".configuration-instance-page h2").click();
8298
+ }
8116
8299
  async expectTextFieldToBe(fieldName, fieldValue) {
8117
8300
  (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`input[name=${fieldName}]`).getAttribute("value")).toContain(fieldValue);
8118
8301
  return this;