@digital-ai/devops-page-object-release 0.0.40 → 0.0.41

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,11 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.41
4
+
5
+ ### Patch Changes
6
+
7
+ - e080216: Replace isVisible with expectation
8
+
3
9
  ## 0.0.40
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1736,7 +1736,6 @@ class $6c924a95a765a086$export$15d3f9b095bb5188 extends (0, $f8721861c660dd88$ex
1736
1736
  class $f9016705c1a1eb20$export$aa59788fdecae2f2 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
1737
1737
  async expectWithAttachment(filename) {
1738
1738
  const test = this.page.locator(".task-attachments-grid .file-item-text");
1739
- await test.isVisible();
1740
1739
  await (0, $kKeXs$playwrighttest.expect)(test).toContainText(filename);
1741
1740
  }
1742
1741
  async getAttachmentsListCount() {
@@ -1834,10 +1833,10 @@ class $9c0b0c2caed50730$export$d4865631ba74f3e2 extends (0, $f8721861c660dd88$ex
1834
1833
  await this.page.waitForTimeout(1000);
1835
1834
  }
1836
1835
  async expectPreconditionEditable() {
1837
- await this.textEditor.isVisible();
1836
+ await (0, $kKeXs$playwrighttest.expect)(this.textEditor).toBeVisible();
1838
1837
  }
1839
1838
  async expectPreconditionNotEditable() {
1840
- await this.textEditor.isHidden();
1839
+ await (0, $kKeXs$playwrighttest.expect)(this.textEditor).not.toBeEditable();
1841
1840
  }
1842
1841
  async enableFailureHandler() {
1843
1842
  await this.page.getByLabel("Enable failure handler").check();
@@ -2153,7 +2152,6 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2153
2152
  })
2154
2153
  }).locator(".icon-options");
2155
2154
  if (canDelete) {
2156
- await depOptionsIcon.isVisible();
2157
2155
  await depOptionsIcon.click();
2158
2156
  await (0, $kKeXs$playwrighttest.expect)(this.railLocator.getByRole("menuitem", {
2159
2157
  name: "Remove"
@@ -2181,7 +2179,6 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2181
2179
  exact: true
2182
2180
  })
2183
2181
  }).locator(".icon-options");
2184
- await depOptionsIcon.isVisible();
2185
2182
  await depOptionsIcon.click();
2186
2183
  await this.railLocator.getByRole("menuitem", {
2187
2184
  name: "Remove"
@@ -2212,7 +2209,6 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2212
2209
  const depOptionsIcon = this.page.locator(".dependency").filter({
2213
2210
  has: this.page.getByLabel(dependencies)
2214
2211
  }).first().locator(".actions");
2215
- await depOptionsIcon.isVisible();
2216
2212
  await depOptionsIcon.click();
2217
2213
  const frame = this.page.getByTestId("undefined-menu");
2218
2214
  if (await frame.isVisible()) await this.railLocator.getByRole("menuitem", {
@@ -2274,9 +2270,11 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2274
2270
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#dialogTitle")).toContainText(errorMessage);
2275
2271
  }
2276
2272
  async isButtonVisible(buttonName, visible = true) {
2277
- (0, $kKeXs$playwrighttest.expect)(await this.page.getByRole("button", {
2273
+ const locator = this.page.getByRole("button", {
2278
2274
  name: buttonName
2279
- }).isVisible()).toBe(visible);
2275
+ });
2276
+ if (visible) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
2277
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
2280
2278
  }
2281
2279
  async cancelDialogWindow() {
2282
2280
  await this.page.getByRole("button", {
@@ -2325,9 +2323,11 @@ class $eb81c1b930e440ff$export$519356f6c50361f7 extends (0, $f8721861c660dd88$ex
2325
2323
  await this.page.locator(`input[name='${fieldID}']`).fill(value);
2326
2324
  }
2327
2325
  async abortButtonVisibility(visible = true) {
2328
- (0, $kKeXs$playwrighttest.expect)(await this.page.getByRole("button", {
2326
+ const locator = this.page.getByRole("button", {
2329
2327
  name: "Abort"
2330
- }).isVisible()).toBe(visible);
2328
+ });
2329
+ if (visible) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
2330
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
2331
2331
  }
2332
2332
  async setPattern(patternName) {
2333
2333
  await this.page.locator("#patternId").click();
@@ -2493,15 +2493,12 @@ class $eb81c1b930e440ff$export$fbbf45eff21470e3 extends (0, $f8721861c660dd88$ex
2493
2493
  this.task = this.dependencyLocator.locator("#task-dependency");
2494
2494
  }
2495
2495
  async getRelease() {
2496
- await this.release.isVisible();
2497
2496
  return await this.release.getAttribute("value");
2498
2497
  }
2499
2498
  async getPhase() {
2500
- await this.phase.isVisible();
2501
2499
  return await this.phase.getAttribute("value");
2502
2500
  }
2503
2501
  async getTask() {
2504
- await this.task.isVisible();
2505
2502
  return await this.task.getAttribute("value");
2506
2503
  }
2507
2504
  async setRelease(releaseTitle) {
@@ -2684,14 +2681,14 @@ class $1fbdec5dc9cde599$export$e3515314c13bc477 extends (0, $f8721861c660dd88$ex
2684
2681
  this.dateUtil = new (0, $880df57ffbf6e614$export$9b575f14aa5e09a1)(page);
2685
2682
  }
2686
2683
  async expectStartDateToBeDisplayed() {
2687
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".flex-section.column").filter({
2684
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".flex-section.column").filter({
2688
2685
  hasText: "Start Date"
2689
- }).locator(".task-date-view-content").isVisible()).toBe(true);
2686
+ }).locator(".task-date-view-content")).toBeVisible();
2690
2687
  }
2691
2688
  async expectEndDateToBeDisplayed() {
2692
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".flex-section.column").filter({
2689
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".flex-section.column").filter({
2693
2690
  hasText: "End Date"
2694
- }).locator(".task-date-view-content").isVisible()).toBe(true);
2691
+ }).locator(".task-date-view-content")).toBeVisible();
2695
2692
  }
2696
2693
  async switchWaitForScheduledDate() {
2697
2694
  await this.page.locator(".wait-for-start input").click();
@@ -4606,7 +4603,7 @@ class $9b9a8c3da392d020$var$RestartPhaseModel extends (0, $f8721861c660dd88$expo
4606
4603
  await this.page.locator('.modal select[data-test="fromTask"]').selectOption(task);
4607
4604
  }
4608
4605
  async expectNoTaskSelectorVisible() {
4609
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator('.modal select[data-test="fromTask"]').isVisible()).toHaveLength(0);
4606
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('.modal select[data-test="fromTask"]')).not.toBeVisible();
4610
4607
  }
4611
4608
  async continue() {
4612
4609
  await this.page.locator(".modal .continue").click();
@@ -5121,7 +5118,6 @@ class $9058d40a81bdb1f5$export$b453f08936c58edb extends (0, $f8721861c660dd88$ex
5121
5118
  async backToAllFolders() {
5122
5119
  await this.page.locator(".icon-back.dot-i").click();
5123
5120
  await (0, $kKeXs$playwrighttest.expect)(this.page).toHaveTitle("Folders - Digital.ai Release");
5124
- await this.page.locator("button.btn-add-folder").isVisible();
5125
5121
  return this;
5126
5122
  }
5127
5123
  async createFolder(folderName) {
@@ -5399,7 +5395,6 @@ class $506d511737b3ea46$export$74ca1eaaa9a0054 extends (0, $f8721861c660dd88$exp
5399
5395
  await this.page.getByRole("button", {
5400
5396
  name: "Delete"
5401
5397
  }).click();
5402
- await this.page.locator("alert.notice.ng-scope").isVisible();
5403
5398
  }
5404
5399
  async editVariable(variableName, editedvariabletext) {
5405
5400
  await this.page.locator("[id='variables-filter']").fill(variableName);
@@ -7039,7 +7034,6 @@ class $ed2d4739e27d43c1$var$GridView extends (0, $f8721861c660dd88$export$2b65d1
7039
7034
  hasText: action
7040
7035
  }).click();
7041
7036
  if (action === "Complete") {
7042
- await this.page.locator("#modal textarea[mentio]").isVisible();
7043
7037
  await this.page.locator("#modal textarea[mentio]").fill("complete");
7044
7038
  await this.page.locator("#modal button.primary").filter({
7045
7039
  hasText: "Complete"
@@ -7773,10 +7767,14 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
7773
7767
  (0, $kKeXs$playwrighttest.expect)(await this.getValue(identifier)).toEqual(value.toString());
7774
7768
  }
7775
7769
  async shouldHaveEditButton(present = true) {
7776
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator("#editRisk").isVisible()).toBe(present);
7770
+ const locator = this.page.locator("#editRisk");
7771
+ if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7772
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7777
7773
  }
7778
7774
  async shouldHaveSaveButton(present = true) {
7779
- (0, $kKeXs$playwrighttest.expect)(await this.page.getByTestId("save-btn").isVisible()).toBe(present);
7775
+ const locator = this.page.getByTestId("save-btn");
7776
+ if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7777
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7780
7778
  }
7781
7779
  async startEditGlobalRiskThreshold() {
7782
7780
  await this.page.locator("#editRisk").click();
@@ -7798,9 +7796,11 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
7798
7796
  await this.page.locator("#risk-profile-table").waitFor({
7799
7797
  state: "visible"
7800
7798
  });
7801
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".risk-profile .data-row").filter({
7799
+ const locator = this.page.locator(".risk-profile .data-row").filter({
7802
7800
  hasText: title
7803
- }).isVisible()).toBe(present);
7801
+ });
7802
+ if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7803
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7804
7804
  }
7805
7805
  async expectDefaultRiskProfileToBeFirst() {
7806
7806
  await this.page.locator("#risk-profile-table").waitFor({
@@ -7823,9 +7823,11 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
7823
7823
  }).waitFor({
7824
7824
  state: "visible"
7825
7825
  });
7826
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".risk-profile .data-row").filter({
7826
+ const locator = this.page.locator(".risk-profile .data-row").filter({
7827
7827
  hasText: title
7828
- }).locator(".copy-action").isVisible()).toBe(enabled);
7828
+ }).locator(".copy-action");
7829
+ if (enabled) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7830
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7829
7831
  }
7830
7832
  async shouldHaveDeleteButtonEnabledForRiskProfile(title, enabled = true) {
7831
7833
  await this.page.locator(".risk-profile .data-row").filter({
@@ -7833,9 +7835,11 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
7833
7835
  }).waitFor({
7834
7836
  state: "visible"
7835
7837
  });
7836
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`.risk-profile .data-row`).filter({
7838
+ const locator = this.page.locator(`.risk-profile .data-row`).filter({
7837
7839
  hasText: title
7838
- }).locator(`.remove-action`).isVisible()).toBe(enabled);
7840
+ }).locator(`.remove-action`);
7841
+ if (enabled) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7842
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7839
7843
  }
7840
7844
  async clickNewRiskProfile() {
7841
7845
  await this.page.getByTestId("new-risk-btn").waitFor({
@@ -7891,7 +7895,9 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
7891
7895
  (0, $kKeXs$playwrighttest.expect)(await this.page.locator("#risk-profile-table .data-row").count()).toEqual(numberOfVisibleRiskProfiles);
7892
7896
  }
7893
7897
  async shouldHaveNewRiskProfileButton(present = true) {
7894
- (0, $kKeXs$playwrighttest.expect)(await this.page.getByTestId("new-risk-btn").isVisible()).toBe(present);
7898
+ const locator = this.page.getByTestId("new-risk-btn");
7899
+ if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
7900
+ else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
7895
7901
  }
7896
7902
  }
7897
7903
  class $ea5452748687c9a2$var$RisksProfilePage extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
@@ -7987,18 +7993,18 @@ class $3ec0e9cf832fdde8$export$9823ddf5e80770e7 extends (0, $f8721861c660dd88$ex
7987
7993
  state: "visible",
7988
7994
  timeout: 200000
7989
7995
  });
7990
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`.configuration-instance`).filter({
7996
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.configuration-instance`).filter({
7991
7997
  hasText: instanceName
7992
- }).isVisible()).toBe(true);
7998
+ })).toBeVisible();
7993
7999
  return this;
7994
8000
  }
7995
8001
  async expectInstanceNotDisplayed(instanceName) {
7996
8002
  await this.page.locator("#configuration").waitFor({
7997
8003
  state: "visible"
7998
8004
  });
7999
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`.configuration-instance`).filter({
8005
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.configuration-instance`).filter({
8000
8006
  hasText: instanceName
8001
- }).isVisible()).toBe(false);
8007
+ })).not.toBeVisible();
8002
8008
  return this;
8003
8009
  }
8004
8010
  async openInstance(instanceName) {
@@ -8219,7 +8225,6 @@ class $267ea1f27d28a032$export$8da2fa93430be6ca extends (0, $f8721861c660dd88$ex
8219
8225
  exact: true
8220
8226
  })
8221
8227
  }).getByRole("checkbox").click();
8222
- await this.page.getByTestId("save-btn").isVisible();
8223
8228
  await this.page.getByTestId("save-btn").click();
8224
8229
  await this.page.locator(".saved-text").waitFor();
8225
8230
  } else if (!isChecked && enable) {
@@ -8233,7 +8238,6 @@ class $267ea1f27d28a032$export$8da2fa93430be6ca extends (0, $f8721861c660dd88$ex
8233
8238
  exact: true
8234
8239
  })
8235
8240
  }).getByRole("checkbox").click();
8236
- await this.page.getByTestId("save-btn").isVisible();
8237
8241
  await this.page.getByTestId("save-btn").click();
8238
8242
  await this.page.locator(".saved-text").waitFor();
8239
8243
  }