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

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,17 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7a87015: S-129713: Fixed the flakiness in User profile page
8
+
9
+ ## 1.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 95453e3: Implemented new SAAS login method
14
+
3
15
  ## 0.0.120
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -6836,11 +6836,21 @@ class $010122e1d9b28b80$export$3cf9c90f870f31bd extends (0, $f8721861c660dd88$ex
6836
6836
  return this;
6837
6837
  }
6838
6838
  async save() {
6839
- const saveBtn = this.page.getByTestId('save-button');
6840
- await (0, $kKeXs$playwrighttest.expect)(saveBtn).toBeEnabled({
6839
+ const saveButton = this.page.getByTestId('save-button');
6840
+ await saveButton.waitFor({
6841
+ state: 'visible',
6841
6842
  timeout: 5000
6842
6843
  });
6843
- await saveBtn.click();
6844
+ await (0, $kKeXs$playwrighttest.expect)(saveButton).toBeEnabled();
6845
+ await saveButton.click();
6846
+ // Wait for the toast or saved text to appear
6847
+ const toast = this.page.getByText('Changes saved successfully').first();
6848
+ await toast.waitFor({
6849
+ state: 'visible',
6850
+ timeout: 5000
6851
+ }).catch(()=>{
6852
+ undefined;
6853
+ });
6844
6854
  return this;
6845
6855
  }
6846
6856
  async clearEmailInput() {
@@ -6924,7 +6934,7 @@ class $010122e1d9b28b80$export$3cf9c90f870f31bd extends (0, $f8721861c660dd88$ex
6924
6934
  await (0, $kKeXs$playwrighttest.expect)(dropdown).toHaveText(option);
6925
6935
  await (0, $kKeXs$playwrighttest.expect)(saveButton).toBeEnabled();
6926
6936
  await saveButton.click();
6927
- await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('Changes saved successfully')).toBeVisible();
6937
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('Changes saved successfully').first()).toBeVisible();
6928
6938
  }
6929
6939
  async setDefaultFolderPage(option) {
6930
6940
  const dropdown = this.page.getByRole('combobox', {
@@ -6944,7 +6954,7 @@ class $010122e1d9b28b80$export$3cf9c90f870f31bd extends (0, $f8721861c660dd88$ex
6944
6954
  await (0, $kKeXs$playwrighttest.expect)(dropdown).toHaveText(option);
6945
6955
  await (0, $kKeXs$playwrighttest.expect)(saveButton).toBeEnabled();
6946
6956
  await saveButton.click();
6947
- await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('Changes saved successfully')).toBeVisible();
6957
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('Changes saved successfully').first()).toBeVisible();
6948
6958
  }
6949
6959
  }
6950
6960
 
@@ -9245,36 +9255,35 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
9245
9255
  });
9246
9256
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator('.risk-profile .data-row .ng-binding').first()).toHaveText('Default risk profile');
9247
9257
  }
9258
+ riskProfileRow(title) {
9259
+ return this.page.locator('.risk-profile .data-row').filter({
9260
+ has: this.page.getByText(title, {
9261
+ exact: true
9262
+ })
9263
+ });
9264
+ }
9248
9265
  async openRiskProfile(title) {
9249
9266
  await this.page.locator('#risk-profile-table').waitFor({
9250
9267
  state: 'visible'
9251
9268
  });
9252
- await this.page.locator('.risk-profile .data-row').filter({
9253
- hasText: title
9254
- }).click();
9269
+ await this.riskProfileRow(title).click();
9255
9270
  return new $ea5452748687c9a2$var$RisksProfilePage(this.page);
9256
9271
  }
9257
9272
  async shouldHaveCopyButtonEnabledForRiskProfile(title, enabled = true) {
9258
- await this.page.locator('.risk-profile .data-row').filter({
9259
- hasText: title
9260
- }).waitFor({
9273
+ const row = this.riskProfileRow(title);
9274
+ await row.waitFor({
9261
9275
  state: 'visible'
9262
9276
  });
9263
- const locator = this.page.locator('.risk-profile .data-row').filter({
9264
- hasText: title
9265
- }).locator('.copy-action');
9277
+ const locator = row.locator('.copy-action');
9266
9278
  if (enabled) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
9267
9279
  else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
9268
9280
  }
9269
9281
  async shouldHaveDeleteButtonEnabledForRiskProfile(title, enabled = true) {
9270
- await this.page.locator('.risk-profile .data-row').filter({
9271
- hasText: title
9272
- }).waitFor({
9282
+ const row = this.riskProfileRow(title);
9283
+ await row.waitFor({
9273
9284
  state: 'visible'
9274
9285
  });
9275
- const locator = this.page.locator(`.risk-profile .data-row`).filter({
9276
- hasText: title
9277
- }).locator(`.remove-action`);
9286
+ const locator = row.locator(`.remove-action`);
9278
9287
  if (enabled) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
9279
9288
  else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
9280
9289
  }
@@ -9286,14 +9295,11 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
9286
9295
  return new $ea5452748687c9a2$var$RisksProfilePage(this.page);
9287
9296
  }
9288
9297
  async deleteRiskProfile(title) {
9289
- await this.page.locator('.risk-profile .data-row').filter({
9290
- hasText: title
9291
- }).locator('.remove-action').waitFor({
9298
+ const row = this.riskProfileRow(title);
9299
+ await row.locator('.remove-action').waitFor({
9292
9300
  state: 'visible'
9293
9301
  });
9294
- await this.page.locator('.risk-profile .data-row').filter({
9295
- hasText: title
9296
- }).locator('.remove-action').click();
9302
+ await row.locator('.remove-action').click();
9297
9303
  await this.page.locator('.modal-footer .button.save').click();
9298
9304
  }
9299
9305
  async expectSuccessMessageOnRisksPage() {
@@ -9304,14 +9310,11 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
9304
9310
  await this.closeNotificationBanner();
9305
9311
  }
9306
9312
  async copyRiskProfile(title) {
9307
- await this.page.locator('.risk-profile .data-row').filter({
9308
- hasText: title
9309
- }).waitFor({
9313
+ const row = this.riskProfileRow(title);
9314
+ await row.waitFor({
9310
9315
  state: 'visible'
9311
9316
  });
9312
- await this.page.locator('.risk-profile .data-row').filter({
9313
- hasText: title
9314
- }).locator('.copy-action').click();
9317
+ await row.locator('.copy-action').click();
9315
9318
  }
9316
9319
  async expectSuccessMessageOnUpdateRiskProfile() {
9317
9320
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel('success')).toBeVisible();
@@ -10361,6 +10364,63 @@ class $267ea1f27d28a032$export$8da2fa93430be6ca extends (0, $f8721861c660dd88$ex
10361
10364
 
10362
10365
 
10363
10366
 
10367
+
10368
+
10369
+ class $51c942d36af547b6$export$3006749443672de8 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
10370
+ constructor(page){
10371
+ super(page);
10372
+ this.AskReleaseButton = this.page.getByRole('button', {
10373
+ name: 'Ask Release'
10374
+ });
10375
+ }
10376
+ async clickAskReleaseButton() {
10377
+ await this.AskReleaseButton.click();
10378
+ }
10379
+ async clickNewChatButton() {
10380
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole('button', {
10381
+ name: 'New chat'
10382
+ })).toBeVisible();
10383
+ await this.page.getByRole('button', {
10384
+ name: 'New chat'
10385
+ }).click();
10386
+ }
10387
+ async clickHistory() {
10388
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByTestId('rail-item-1')).toBeVisible();
10389
+ await this.page.getByTestId('rail-item-1').first().click();
10390
+ }
10391
+ async expectAskReleaseChatWindowToBeOpen() {
10392
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole('heading', {
10393
+ name: 'Ask release'
10394
+ })).toBeVisible();
10395
+ }
10396
+ async expectAskReleaseChatWindowToBeClosed() {
10397
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole('heading', {
10398
+ name: 'Ask release'
10399
+ })).not.toBeVisible();
10400
+ }
10401
+ async expectCorrectResponse(response, timeout = 360000) {
10402
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByText(response, {
10403
+ exact: false
10404
+ })).toBeVisible({
10405
+ timeout: timeout
10406
+ });
10407
+ }
10408
+ async expectChatInputDrawerToBeEnabled() {
10409
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole('textbox', {
10410
+ name: 'Ask your question...'
10411
+ })).toBeVisible();
10412
+ }
10413
+ async feedYourQuestion(question) {
10414
+ await this.page.getByRole('textbox', {
10415
+ name: 'Ask your question...'
10416
+ }).fill(question);
10417
+ await this.page.getByRole('button', {
10418
+ name: 'Send'
10419
+ }).click();
10420
+ }
10421
+ }
10422
+
10423
+
10364
10424
  class $4ef41cf96a5fae4c$export$b8a61e5c71402559 {
10365
10425
  constructor(page){
10366
10426
  this.page = page;
@@ -10393,6 +10453,7 @@ class $4ef41cf96a5fae4c$export$b8a61e5c71402559 {
10393
10453
  this.util = new (0, $2c89ba54932fbba8$export$f8f26dd395d7e1bd)(page);
10394
10454
  this.workflowCatalogPage = new (0, $7bcc05352d6debcf$export$5628dfd1b9e94785)(page);
10395
10455
  this.taskAccessPage = new (0, $267ea1f27d28a032$export$8da2fa93430be6ca)(page);
10456
+ this.askReleasePage = new (0, $51c942d36af547b6$export$3006749443672de8)(page);
10396
10457
  }
10397
10458
  async openTemplate(id) {
10398
10459
  return this.openReleaseOrTemplate(id, false);
@@ -10592,6 +10653,41 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
10592
10653
  await this.page.waitForTimeout(1000);
10593
10654
  await this.closePendoModalWindow();
10594
10655
  }
10656
+ /**
10657
+ * Login via SaaS (Keycloak SSO) with username and password
10658
+ * @param userName
10659
+ * @param password
10660
+ */ async loginSaas(userName, password) {
10661
+ await this.page.goto('/#home', {
10662
+ waitUntil: 'domcontentloaded'
10663
+ });
10664
+ // Wait for either OIDC login page or already-authenticated app page
10665
+ await this.page.waitForURL(/(auth\/realms|#\/(home|default))/, {
10666
+ timeout: 60000,
10667
+ waitUntil: 'domcontentloaded'
10668
+ });
10669
+ // If redirected to OIDC login page, fill credentials
10670
+ if (this.page.url().includes('auth/realms')) {
10671
+ await this.page.getByRole('textbox', {
10672
+ name: 'Username or email'
10673
+ }).fill(userName, {
10674
+ timeout: 10000
10675
+ });
10676
+ await this.page.locator('#password').fill(password, {
10677
+ timeout: 10000
10678
+ });
10679
+ await this.page.getByRole('button', {
10680
+ name: 'Sign In'
10681
+ }).click({
10682
+ timeout: 30000
10683
+ });
10684
+ await this.page.waitForURL(/#\/(home|default)/, {
10685
+ timeout: 60000,
10686
+ waitUntil: 'domcontentloaded'
10687
+ });
10688
+ }
10689
+ await this.closePendoModalWindow();
10690
+ }
10595
10691
  async loginWithoutReload(userName, password) {
10596
10692
  let loadTriggered = false;
10597
10693
  this.page.on('load', ()=>{
@@ -10627,6 +10723,9 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
10627
10723
  async closePendoModalWindow() {
10628
10724
  await this.page.waitForTimeout(1000);
10629
10725
  if (await this.page.locator('._pendo-close-guide').count() > 0) await this.page.locator('._pendo-close-guide').click();
10726
+ await this.page.locator('button.close').first().click({
10727
+ timeout: 2000
10728
+ }).catch((_)=>undefined);
10630
10729
  }
10631
10730
  async expectUserNotVisible() {
10632
10731
  const tooltip = this.page.locator('top-toolbar .avatar-wrapper .dot-tooltip');