@digital-ai/devops-page-object-release 0.0.119 → 0.0.120

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/dist/module.js CHANGED
@@ -5233,11 +5233,10 @@ class $50c91328c9110668$export$b453f08936c58edb extends (0, $9626bc9256ce31f7$ex
5233
5233
  }
5234
5234
  async expandFolder(folderName) {
5235
5235
  const folderRow = this.page.getByRole('listitem').filter({
5236
- hasText: folderName
5236
+ hasText: new RegExp(`^${folderName}$`)
5237
5237
  });
5238
5238
  const expandIcon = folderRow.locator('.arrow-right-icon');
5239
- await (0, $hOLA6$expect)(expandIcon).toBeVisible();
5240
- await expandIcon.click();
5239
+ if (await expandIcon.count() > 0) await expandIcon.click();
5241
5240
  return this;
5242
5241
  }
5243
5242
  async openFolderByRow(folderName) {
@@ -5383,6 +5382,12 @@ class $50c91328c9110668$export$b453f08936c58edb extends (0, $9626bc9256ce31f7$ex
5383
5382
  await this.page.getByTitle(releaseName).click();
5384
5383
  await (0, $hOLA6$expect)(this.page.getByLabel('breadcrumb').getByText('Flow')).toBeVisible();
5385
5384
  }
5385
+ async expectBreadcrumbToContain(option) {
5386
+ await (0, $hOLA6$expect)(this.page.getByLabel('breadcrumb').getByText(option)).toBeVisible();
5387
+ }
5388
+ async expectFolderOptionInUrl(option) {
5389
+ await (0, $hOLA6$expect)(this.page).toHaveURL(new RegExp(`#\\/folders\\/Applications\\/(Folder[^/]+\\/)+${option.toLowerCase()}(\\?.*)?$`));
5390
+ }
5386
5391
  }
5387
5392
 
5388
5393
 
@@ -5660,6 +5665,12 @@ class $2174535b78371022$export$36d69433c4f81145 extends (0, $9626bc9256ce31f7$ex
5660
5665
  await (0, $hOLA6$expect)(this.page.getByText('Introducing Analytics')).toBeVisible();
5661
5666
  await this.page.getByLabel('Close').click();
5662
5667
  }
5668
+ async expectGlobalPageToBe(option) {
5669
+ if (option === 'Home') await (0, $hOLA6$expect)(this.page.getByRole('heading', {
5670
+ name: 'Digital.ai Release Home'
5671
+ })).toBeVisible();
5672
+ else await (0, $hOLA6$expect)(this.page.getByLabel('breadcrumb').getByText(option)).toBeVisible();
5673
+ }
5663
5674
  }
5664
5675
 
5665
5676
 
@@ -5885,12 +5896,17 @@ class $a5932af323ac015a$export$3cf9c90f870f31bd extends (0, $9626bc9256ce31f7$ex
5885
5896
  return this;
5886
5897
  }
5887
5898
  async clickOnSaveButton() {
5888
- await this.page.locator('button:has-text("Save")').click();
5899
+ await this.page.getByRole('button', {
5900
+ name: 'Save'
5901
+ }).click();
5889
5902
  return this;
5890
5903
  }
5891
5904
  async save() {
5892
- await this.clickOnSaveButton();
5893
- await (0, $hOLA6$expect)(this.page.locator('.dot-snackbar')).toContainText('Changes saved successfully');
5905
+ const saveBtn = this.page.getByTestId('save-button');
5906
+ await (0, $hOLA6$expect)(saveBtn).toBeEnabled({
5907
+ timeout: 5000
5908
+ });
5909
+ await saveBtn.click();
5894
5910
  return this;
5895
5911
  }
5896
5912
  async clearEmailInput() {
@@ -5958,6 +5974,44 @@ class $a5932af323ac015a$export$3cf9c90f870f31bd extends (0, $9626bc9256ce31f7$ex
5958
5974
  }).click();
5959
5975
  await (0, $hOLA6$expect)(this.page.getByText(tokenName)).not.toBeVisible();
5960
5976
  }
5977
+ async setDefaultGlobalPage(option) {
5978
+ const dropdown = this.page.getByRole('combobox', {
5979
+ name: 'Default global page select'
5980
+ });
5981
+ const saveButton = this.page.getByTestId('save-button');
5982
+ const current = (await dropdown.innerText()).trim();
5983
+ if (current === option) {
5984
+ await (0, $hOLA6$expect)(saveButton).toBeDisabled();
5985
+ return;
5986
+ }
5987
+ await dropdown.click();
5988
+ await this.page.locator(`[role="option"][data-value="${option.toLowerCase()}"]`).click();
5989
+ await this.page.keyboard.press('Tab');
5990
+ await (0, $hOLA6$expect)(dropdown).toHaveText(option);
5991
+ await (0, $hOLA6$expect)(saveButton).toBeEnabled();
5992
+ await saveButton.click();
5993
+ await (0, $hOLA6$expect)(this.page.getByText('Changes saved successfully')).toBeVisible();
5994
+ }
5995
+ async setDefaultFolderPage(option) {
5996
+ const dropdown = this.page.getByRole('combobox', {
5997
+ name: 'Default folder page select'
5998
+ });
5999
+ const saveButton = this.page.getByTestId('save-button');
6000
+ const current = (await dropdown.innerText()).trim();
6001
+ if (current === option) {
6002
+ await (0, $hOLA6$expect)(saveButton).toBeDisabled();
6003
+ return;
6004
+ }
6005
+ await dropdown.click();
6006
+ await this.page.getByRole('option', {
6007
+ name: option
6008
+ }).click();
6009
+ await this.page.keyboard.press('Tab');
6010
+ await (0, $hOLA6$expect)(dropdown).toHaveText(option);
6011
+ await (0, $hOLA6$expect)(saveButton).toBeEnabled();
6012
+ await saveButton.click();
6013
+ await (0, $hOLA6$expect)(this.page.getByText('Changes saved successfully')).toBeVisible();
6014
+ }
5961
6015
  }
5962
6016
 
5963
6017
 
@@ -9410,11 +9464,11 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
9410
9464
  return this.openReleaseOrTemplate(id, false);
9411
9465
  }
9412
9466
  async openFolder(id) {
9413
- await this.page.goto(`./#/folders/${id}/releases`);
9414
- await this.page.waitForSelector('#releases-content');
9467
+ await this.page.goto(`./#/folders/${id}`);
9415
9468
  return new (0, $50c91328c9110668$export$b453f08936c58edb)(this.page);
9416
9469
  }
9417
9470
  async openFolderByName(folderName) {
9471
+ await this.page.goto(`./#/folders`);
9418
9472
  const folder = this.page.getByTitle(folderName);
9419
9473
  await (0, $hOLA6$expect)(folder).toBeVisible({
9420
9474
  timeout: 5000
@@ -9457,6 +9511,11 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
9457
9511
  name: 'Home'
9458
9512
  }).click();
9459
9513
  }
9514
+ async gotoHomePageByBreadcrumb() {
9515
+ await this.page.getByLabel('breadcrumb').getByRole('link', {
9516
+ name: 'Home'
9517
+ }).click();
9518
+ }
9460
9519
  async gotoFolderPage() {
9461
9520
  await this.page.locator('ul.side-nav li').getByLabel('Folders', {
9462
9521
  exact: true