@digital-ai/devops-page-object-release 0.0.108 → 0.0.110

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
@@ -5741,14 +5741,15 @@ class $aa1ba8c8de3c0679$export$2fb4351c41ce6e7a extends (0, $9626bc9256ce31f7$ex
5741
5741
  await this.page.bringToFront();
5742
5742
  }
5743
5743
  async clickAvatarIcon(username) {
5744
- await this.page.getByLabel(username, {
5744
+ await this.page.getByRole('button', {
5745
+ name: username,
5745
5746
  exact: true
5746
5747
  }).click();
5747
5748
  }
5748
- async verifyUser(userFullName) {
5749
+ async verifyUser(username, userFullName) {
5749
5750
  await this.page.locator('li').getByLabel(userFullName).click();
5750
5751
  await (0, $hOLA6$expect)(this.page.getByRole('heading', {
5751
- name: 'Personal settings for admin'
5752
+ name: `Account details for ${username}`
5752
5753
  })).toBeVisible();
5753
5754
  }
5754
5755
  async clickAccessTokens() {
@@ -5836,12 +5837,21 @@ class $a5932af323ac015a$export$3cf9c90f870f31bd extends (0, $9626bc9256ce31f7$ex
5836
5837
  super(page);
5837
5838
  this.util = new (0, $87bbb6d35ad31a00$export$f8f26dd395d7e1bd)(page);
5838
5839
  }
5840
+ getConfirmPasswordHelperTextSelector() {
5841
+ return '#confirmPassword-helper-text';
5842
+ }
5839
5843
  async openProfile() {
5840
5844
  await this.util.openSideNavMenu('Profile');
5841
5845
  }
5842
5846
  async openAccessToken() {
5843
5847
  await this.util.openSideNavMenu('Access tokens');
5844
5848
  }
5849
+ async expectResetButtonEnabled() {
5850
+ await (0, $hOLA6$expect)(this.page.locator('button:has-text("Reset")')).toBeEnabled({
5851
+ timeout: 5000
5852
+ });
5853
+ return this;
5854
+ }
5845
5855
  async expectEmailDefined(email) {
5846
5856
  await (0, $hOLA6$expect)(this.page.locator('#email')).toHaveValue(email);
5847
5857
  return this;
@@ -5850,59 +5860,78 @@ class $a5932af323ac015a$export$3cf9c90f870f31bd extends (0, $9626bc9256ce31f7$ex
5850
5860
  return this.expectEmailDefined('');
5851
5861
  }
5852
5862
  async expectFullNameDefined(fullName) {
5853
- await (0, $hOLA6$expect)(this.page.locator('#full-name')).toHaveValue(fullName);
5863
+ await (0, $hOLA6$expect)(this.page.locator('#fullName')).toHaveValue(fullName);
5864
+ return this;
5865
+ }
5866
+ async expectConfirmPasswordErrorVisible() {
5867
+ await (0, $hOLA6$expect)(this.page.locator(this.getConfirmPasswordHelperTextSelector())).toBeVisible();
5868
+ await (0, $hOLA6$expect)(this.page.locator(this.getConfirmPasswordHelperTextSelector())).toContainText('Passwords do not match');
5869
+ return this;
5870
+ }
5871
+ async expectConfirmPasswordErrorNotVisible() {
5872
+ await (0, $hOLA6$expect)(this.page.locator(this.getConfirmPasswordHelperTextSelector())).toBeHidden();
5854
5873
  return this;
5855
5874
  }
5856
5875
  async expectNoFullNameDefined() {
5857
5876
  return this.expectFullNameDefined('');
5858
5877
  }
5859
5878
  async expectPasswordNotToBe(password) {
5860
- await (0, $hOLA6$expect)(this.page.locator('input[data-test="password-input"]')).not.toHaveValue(password);
5879
+ await (0, $hOLA6$expect)(this.page.locator('#password')).not.toHaveValue(password);
5861
5880
  return this;
5862
5881
  }
5863
5882
  async expectDateFormatToBe(dateFormat) {
5864
- await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.dateFormat"]')).toHaveValue(dateFormat);
5883
+ await (0, $hOLA6$expect)(this.page.locator('input[name="dateFormat"]')).toHaveValue(dateFormat);
5865
5884
  return this;
5866
5885
  }
5867
5886
  async expectTimeFormatToBe(timeFormat) {
5868
- await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.timeFormat"]')).toHaveValue(timeFormat);
5887
+ await (0, $hOLA6$expect)(this.page.locator('input[name="timeFormat"]')).toHaveValue(timeFormat);
5869
5888
  return this;
5870
5889
  }
5871
5890
  async expectFirstDayOfWeekToBe(firstDayOfWeek) {
5872
- await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.firstDayOfWeek"]')).toHaveValue(firstDayOfWeek);
5891
+ await (0, $hOLA6$expect)(this.page.locator('input[name="firstDayOfWeek"]')).toHaveValue(firstDayOfWeek);
5892
+ return this;
5893
+ }
5894
+ async clickOnSaveButton() {
5895
+ await this.page.locator('button:has-text("Save")').click();
5873
5896
  return this;
5874
5897
  }
5875
5898
  async save() {
5876
- await this.page.locator('action-toolbar button:has-text("Save"):enabled').click();
5877
- await this.page.locator('.saved-text').waitFor({
5878
- state: 'visible'
5879
- });
5899
+ await this.clickOnSaveButton();
5900
+ await (0, $hOLA6$expect)(this.page.locator('.dot-snackbar')).toContainText('Changes saved successfully');
5901
+ return this;
5902
+ }
5903
+ async clearEmailInput() {
5904
+ await this.page.locator('#email').fill('');
5880
5905
  return this;
5881
5906
  }
5882
5907
  async setEmail(email) {
5883
5908
  await this.page.locator('#email').fill(email);
5909
+ await this.expectEmailDefined(email);
5910
+ await this.expectResetButtonEnabled();
5884
5911
  return this.save();
5885
5912
  }
5886
5913
  async setFullName(fullName) {
5887
- await this.page.locator('#full-name').fill(fullName);
5914
+ await this.page.locator('#fullName').fill(fullName);
5915
+ await this.expectResetButtonEnabled();
5888
5916
  return this.save();
5889
5917
  }
5890
5918
  async setPassword(previousPassword, password) {
5891
5919
  await this.page.locator('#previousPassword').fill(previousPassword);
5892
- await this.page.locator('input[data-test="password-input"]').fill(password);
5893
- await this.page.locator('#passwordConfirmation').fill(password);
5920
+ await this.page.locator('#password').fill(password);
5921
+ await this.expectConfirmPasswordErrorVisible();
5922
+ const confirmPasswordInput = this.page.locator('#confirmPassword');
5923
+ await confirmPasswordInput.fill(password);
5924
+ await confirmPasswordInput.blur();
5925
+ await this.expectConfirmPasswordErrorNotVisible();
5894
5926
  return this.save();
5895
5927
  }
5896
5928
  async refresh() {
5897
5929
  await this.page.reload();
5898
- await this.page.waitForSelector('#profileForm');
5930
+ await this.page.waitForSelector('.profile-form');
5899
5931
  return this;
5900
5932
  }
5901
5933
  async editUserProfile(email) {
5902
- await this.page.getByLabel('Email address').click();
5903
- await this.page.getByLabel('Email address').fill(email);
5904
- await this.page.getByText('Save').click();
5905
- (0, $hOLA6$expect)(await this.page.locator('.saved-text').textContent()).toContain('Last saved on ');
5934
+ await this.setEmail(email);
5906
5935
  }
5907
5936
  async generateNewAccessToken(tokenName, expiryOptions) {
5908
5937
  await this.page.getByRole('button', {
@@ -7089,6 +7118,9 @@ class $c37c93912f458e81$export$60c3bfa6385e2a10 extends (0, $59c1d01bded91449$ex
7089
7118
  getStatusInputSelector() {
7090
7119
  return `${this.getBaseDrawerSelector()} input#task-status-filter-autocomplete`;
7091
7120
  }
7121
+ getTaskAssignedToMeSnackbarUndoButtonSelector() {
7122
+ return ".dot-snackbar button:has-text('Undo')";
7123
+ }
7092
7124
  async openTask(taskName) {
7093
7125
  await this.filterTaskByTitle(taskName);
7094
7126
  await this.page.getByText(taskName).first().click();
@@ -7259,15 +7291,23 @@ class $c37c93912f458e81$export$60c3bfa6385e2a10 extends (0, $59c1d01bded91449$ex
7259
7291
  await this.page.locator(this.getStatusInputSelector()).click();
7260
7292
  await this.page.locator(this.getSelectAllStatusesButtonSelector()).click();
7261
7293
  }
7294
+ async clickOnTaskAssignedToMeSnackbarUndoButton() {
7295
+ await this.page.locator(this.getTaskAssignedToMeSnackbarUndoButtonSelector()).click();
7296
+ }
7262
7297
  async assignTaskToMe(title) {
7263
7298
  await this.page.locator(`.task-line`).filter({
7264
7299
  hasText: title
7265
7300
  }).locator(`.assign-to-me`).click();
7266
- await this.page.locator('.modal:visible >> text="Assign to me"').click();
7267
7301
  }
7268
7302
  async expectTaskAssignedToMe(title) {
7269
7303
  await this.expectTaskAssignedTo(title, 'me');
7270
7304
  }
7305
+ async expectTaskAssignedToMeSnackbar(text) {
7306
+ await (0, $hOLA6$expect)(this.page.locator(`.dot-snackbar .snackbar-html-message >> text=${text}`)).toBeVisible();
7307
+ }
7308
+ async expectTaskAssignedToMeSnackbarUndoButton() {
7309
+ await (0, $hOLA6$expect)(this.page.locator(this.getTaskAssignedToMeSnackbarUndoButtonSelector())).toBeVisible();
7310
+ }
7271
7311
  async expectTaskAssignedTo(title, user) {
7272
7312
  await (0, $hOLA6$expect)(this.page.locator(`.task-line:has-text("${title}") >> text="${user}"`).first()).toHaveCount(1);
7273
7313
  }