@digital-ai/devops-page-object-release 1.0.7 → 1.0.8

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
+ ## 1.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - c67afde: S-132898: add new functions for updated inline autocomplete listbox component
8
+
3
9
  ## 1.0.7
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1509,6 +1509,51 @@ class $59543fc69900e8db$export$f8e64fcf447db2bf extends (0, $f8721861c660dd88$ex
1509
1509
  name: 'Add'
1510
1510
  });
1511
1511
  }
1512
+ async selectVariableFromSelector(variableName) {
1513
+ const normalizedVariableName = variableName.replace(/^\$\{(.+)\}$/, '$1');
1514
+ const selector = this.page.locator('.variable-dropdown .ui-autocomplete-input').first();
1515
+ await selector.waitFor({
1516
+ state: 'visible'
1517
+ });
1518
+ await selector.click();
1519
+ await selector.clear();
1520
+ await selector.type(normalizedVariableName, {
1521
+ delay: 50
1522
+ });
1523
+ await this.page.waitForTimeout(300);
1524
+ await selector.press('ArrowDown');
1525
+ const options = this.page.locator('.ui-menu-item-wrapper:visible, ul.xl-components.xl-widget-autocomplete:visible li');
1526
+ const createOption = options.filter({
1527
+ hasText: 'Create a new variable'
1528
+ }).filter({
1529
+ hasText: normalizedVariableName
1530
+ }).first();
1531
+ if (await createOption.isVisible({
1532
+ timeout: 1000
1533
+ })) {
1534
+ await createOption.click();
1535
+ return;
1536
+ }
1537
+ const variableOption = options.filter({
1538
+ hasText: variableName
1539
+ }).first();
1540
+ if (await variableOption.isVisible({
1541
+ timeout: 1000
1542
+ })) {
1543
+ await variableOption.click();
1544
+ return;
1545
+ }
1546
+ await options.filter({
1547
+ hasText: normalizedVariableName
1548
+ }).first().click();
1549
+ }
1550
+ async selectValueFromInlineDropDown(value) {
1551
+ const editor = this.page.locator('#modal .variable-value .inline-drop-down-list-editor').first();
1552
+ await editor.locator('.xl-btn-handler').click();
1553
+ await editor.locator('ul.xl-components.xl-widget-autocomplete li').filter({
1554
+ hasText: value
1555
+ }).click();
1556
+ }
1512
1557
  async openVariable(variableKey) {
1513
1558
  await this.page.locator(`.variables-list .variable`).getByText(variableKey).click();
1514
1559
  return new $59543fc69900e8db$var$VariableModal(this.page);
@@ -1546,7 +1591,7 @@ class $59543fc69900e8db$export$f8e64fcf447db2bf extends (0, $f8721861c660dd88$ex
1546
1591
  await this.addListValue.fill(possiblevalue);
1547
1592
  await this.listAddButton.click();
1548
1593
  }
1549
- await this.page.locator('.variable-value select').type(defaultValue);
1594
+ await this.selectValueFromInlineDropDown(defaultValue);
1550
1595
  if (required) await this.page.getByRole('checkbox').check();
1551
1596
  }
1552
1597
  async selectVariablePasswordType(possiblevalue) {
@@ -1640,19 +1685,13 @@ class $59543fc69900e8db$export$f8e64fcf447db2bf extends (0, $f8721861c660dd88$ex
1640
1685
  }
1641
1686
  async switchPossibleValuesToVariable(variableName) {
1642
1687
  await this.page.locator('.variable-toggle button').click();
1643
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
1644
- await this.page.locator('.ui-menu-item-wrapper').filter({
1645
- hasText: `${variableName}`
1646
- }).click();
1688
+ await this.selectVariableFromSelector(variableName);
1647
1689
  }
1648
1690
  async selectVariableListboxTypeWithVariable(variableName, defaultValue, required) {
1649
1691
  await this.page.getByRole('combobox').selectOption('DropDownListBox');
1650
1692
  await this.page.locator('.variable-toggle button').click();
1651
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
1652
- await this.page.locator('.ui-menu-item-wrapper').filter({
1653
- hasText: `${variableName}`
1654
- }).click();
1655
- await this.page.locator('.variable-value select').type(defaultValue);
1693
+ await this.selectVariableFromSelector(variableName);
1694
+ await this.selectValueFromInlineDropDown(defaultValue);
1656
1695
  if (required) await this.page.getByRole('checkbox').check();
1657
1696
  else await this.page.getByRole('checkbox').uncheck();
1658
1697
  }
@@ -1677,6 +1716,51 @@ class $59543fc69900e8db$var$VariableModal extends (0, $f8721861c660dd88$export$2
1677
1716
  super(page);
1678
1717
  this.dateUtil = new (0, $880df57ffbf6e614$export$9b575f14aa5e09a1)(page);
1679
1718
  }
1719
+ async selectVariableFromSelector(variableName) {
1720
+ const normalizedVariableName = variableName.replace(/^\$\{(.+)\}$/, '$1');
1721
+ const selector = this.page.locator('#modal .variable-dropdown .ui-autocomplete-input').first();
1722
+ await selector.waitFor({
1723
+ state: 'visible'
1724
+ });
1725
+ await selector.click();
1726
+ await selector.clear();
1727
+ await selector.type(normalizedVariableName, {
1728
+ delay: 50
1729
+ });
1730
+ await this.page.waitForTimeout(300);
1731
+ await selector.press('ArrowDown');
1732
+ const options = this.page.locator('.ui-menu-item-wrapper:visible, ul.xl-components.xl-widget-autocomplete:visible li');
1733
+ const createOption = options.filter({
1734
+ hasText: 'Create a new variable'
1735
+ }).filter({
1736
+ hasText: normalizedVariableName
1737
+ }).first();
1738
+ if (await createOption.isVisible({
1739
+ timeout: 1000
1740
+ })) {
1741
+ await createOption.click();
1742
+ return;
1743
+ }
1744
+ const variableOption = options.filter({
1745
+ hasText: variableName
1746
+ }).first();
1747
+ if (await variableOption.isVisible({
1748
+ timeout: 1000
1749
+ })) {
1750
+ await variableOption.click();
1751
+ return;
1752
+ }
1753
+ await options.filter({
1754
+ hasText: normalizedVariableName
1755
+ }).first().click();
1756
+ }
1757
+ async selectValueFromInlineDropDown(value) {
1758
+ const editor = this.page.locator('#modal .variable-value .inline-drop-down-list-editor').first();
1759
+ await editor.locator('.xl-btn-handler').click();
1760
+ await editor.locator('ul.xl-components.xl-widget-autocomplete li').filter({
1761
+ hasText: value
1762
+ }).click();
1763
+ }
1680
1764
  async expectValue(locators, expectFn) {
1681
1765
  const [index, locator] = await (0, $ef0df8ad8a777ce6$export$a0f926f04148e5d2)(locators);
1682
1766
  expectFn[index](locator);
@@ -1733,7 +1817,7 @@ class $59543fc69900e8db$var$VariableModal extends (0, $f8721861c660dd88$export$2
1733
1817
  }
1734
1818
  }
1735
1819
  async selectVariableValue(defaultValue) {
1736
- await this.page.locator('.variable-value select').selectOption(defaultValue);
1820
+ await this.selectValueFromInlineDropDown(defaultValue);
1737
1821
  }
1738
1822
  async save() {
1739
1823
  const saveButton = this.page.locator('#modal .modal-footer .save');
@@ -1745,29 +1829,11 @@ class $59543fc69900e8db$var$VariableModal extends (0, $f8721861c660dd88$export$2
1745
1829
  await (0, $kKeXs$playwrighttest.expect)(saveButton).not.toBeVisible();
1746
1830
  }
1747
1831
  async createPossibleValuesVariable(variableName) {
1748
- await this.page.locator('.variable-toggle button').click();
1749
- await (0, $kKeXs$playwrighttest.expect)(async ()=>{
1750
- await this.page.locator('.ui-autocomplete-input').clear();
1751
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
1752
- const check = await this.page.locator('.ui-menu-item-wrapper').getByText('${' + variableName + '}', {
1753
- exact: true
1754
- }).isVisible({
1755
- timeout: 1000
1756
- });
1757
- if (check) await this.page.locator('.ui-menu-item-wrapper').getByText('${' + variableName + '}', {
1758
- exact: true
1759
- }).click({
1760
- timeout: 1000
1761
- });
1762
- else await this.page.locator('.ui-menu-item-wrapper').filter({
1763
- hasText: `${variableName}`
1764
- }).click({
1765
- timeout: 1000
1766
- });
1767
- }).toPass();
1832
+ await this.page.locator('#modal .variable-toggle button').click();
1833
+ await this.selectVariableFromSelector(variableName);
1768
1834
  }
1769
1835
  async expectVariableValueToBe(value) {
1770
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator('.variable-value select option[selected="selected"]').textContent()).toBe(value);
1836
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('#modal .variable-value .inline-drop-down-list-editor input').first()).toHaveValue(value);
1771
1837
  }
1772
1838
  async expectNoVariablesInList() {
1773
1839
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('No variables defined.')).toBeVisible();
@@ -6362,6 +6428,13 @@ class $506d511737b3ea46$export$74ca1eaaa9a0054 extends (0, $f8721861c660dd88$exp
6362
6428
  name: 'Add'
6363
6429
  });
6364
6430
  }
6431
+ async selectValueFromInlineDropDown(value) {
6432
+ const editor = this.page.locator('#modal .variable-value .inline-drop-down-list-editor').first();
6433
+ await editor.locator('.xl-btn-handler').click();
6434
+ await editor.locator('ul.xl-components.xl-widget-autocomplete li').filter({
6435
+ hasText: value
6436
+ }).click();
6437
+ }
6365
6438
  async addVariableText(valuename) {
6366
6439
  await this.page.getByRole('combobox').selectOption('StringVariable');
6367
6440
  await this.page.locator('.variable-value input').fill(valuename);
@@ -6371,7 +6444,7 @@ class $506d511737b3ea46$export$74ca1eaaa9a0054 extends (0, $f8721861c660dd88$exp
6371
6444
  await this.page.getByRole('combobox').selectOption('DropDownListBox');
6372
6445
  await this.addListValue.fill(possiblevalue);
6373
6446
  await this.listAddButton.click();
6374
- await this.page.getByRole('combobox').nth(1).selectOption(possiblevalue);
6447
+ await this.selectValueFromInlineDropDown(possiblevalue);
6375
6448
  await this.submitTheVariable();
6376
6449
  }
6377
6450
  async addVariablePassword(possiblevalue) {
@@ -7840,6 +7913,51 @@ class $fd4eef3ad2b2e612$export$a87f0ae8695e74be extends (0, $f8721861c660dd88$ex
7840
7913
  name: 'Add'
7841
7914
  });
7842
7915
  }
7916
+ async selectVariableFromSelector(variableName) {
7917
+ const normalizedVariableName = variableName.replace(/^\$\{(.+)\}$/, '$1');
7918
+ const selector = this.page.locator('.variable-dropdown .ui-autocomplete-input').first();
7919
+ await selector.waitFor({
7920
+ state: 'visible'
7921
+ });
7922
+ await selector.click();
7923
+ await selector.clear();
7924
+ await selector.type(normalizedVariableName, {
7925
+ delay: 50
7926
+ });
7927
+ await this.page.waitForTimeout(300);
7928
+ await selector.press('ArrowDown');
7929
+ const options = this.page.locator('.ui-menu-item-wrapper:visible, ul.xl-components.xl-widget-autocomplete:visible li');
7930
+ const createOption = options.filter({
7931
+ hasText: 'Create a new variable'
7932
+ }).filter({
7933
+ hasText: normalizedVariableName
7934
+ }).first();
7935
+ if (await createOption.isVisible({
7936
+ timeout: 1000
7937
+ })) {
7938
+ await createOption.click();
7939
+ return;
7940
+ }
7941
+ const variableOption = options.filter({
7942
+ hasText: variableName
7943
+ }).first();
7944
+ if (await variableOption.isVisible({
7945
+ timeout: 1000
7946
+ })) {
7947
+ await variableOption.click();
7948
+ return;
7949
+ }
7950
+ await options.filter({
7951
+ hasText: normalizedVariableName
7952
+ }).first().click();
7953
+ }
7954
+ async selectValueFromInlineDropDown(value) {
7955
+ const editor = this.page.locator('#modal .variable-value .inline-drop-down-list-editor').first();
7956
+ await editor.locator('.xl-btn-handler').click();
7957
+ await editor.locator('ul.xl-components.xl-widget-autocomplete li').filter({
7958
+ hasText: value
7959
+ }).click();
7960
+ }
7843
7961
  async openVariable(variableKey) {
7844
7962
  await this.page.locator(`.variables-list .variable`).getByText(variableKey).click();
7845
7963
  return new $fd4eef3ad2b2e612$var$ReleaseVariableModal(this.page);
@@ -7864,7 +7982,7 @@ class $fd4eef3ad2b2e612$export$a87f0ae8695e74be extends (0, $f8721861c660dd88$ex
7864
7982
  await this.addListValue.fill(possiblevalue);
7865
7983
  await this.listAddButton.click();
7866
7984
  }
7867
- await this.page.locator('.variable-value select').type(defaultValue);
7985
+ await this.selectValueFromInlineDropDown(defaultValue);
7868
7986
  if (required) await this.page.getByRole('checkbox').check();
7869
7987
  else await this.page.getByRole('checkbox').uncheck();
7870
7988
  }
@@ -7953,19 +8071,13 @@ class $fd4eef3ad2b2e612$export$a87f0ae8695e74be extends (0, $f8721861c660dd88$ex
7953
8071
  }
7954
8072
  async switchPossibleValuesToVariable(variableName) {
7955
8073
  await this.page.locator('.variable-toggle button').click();
7956
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
7957
- await this.page.locator('.ui-menu-item-wrapper').filter({
7958
- hasText: `${variableName}`
7959
- }).click();
8074
+ await this.selectVariableFromSelector(variableName);
7960
8075
  }
7961
8076
  async selectVariableListboxTypeWithVariable(variableName, defaultValue, required) {
7962
8077
  await this.page.getByRole('combobox').selectOption('DropDownListBox');
7963
8078
  await this.page.locator('.variable-toggle button').click();
7964
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
7965
- await this.page.locator('.ui-menu-item-wrapper').filter({
7966
- hasText: `${variableName}`
7967
- }).click();
7968
- await this.page.locator('.variable-value select').type(defaultValue);
8079
+ await this.selectVariableFromSelector(variableName);
8080
+ await this.selectValueFromInlineDropDown(defaultValue);
7969
8081
  if (required) await this.page.getByRole('checkbox').check();
7970
8082
  else await this.page.getByRole('checkbox').uncheck();
7971
8083
  }
@@ -7975,6 +8087,51 @@ class $fd4eef3ad2b2e612$var$ReleaseVariableModal extends (0, $f8721861c660dd88$e
7975
8087
  super(page);
7976
8088
  this.dateUtil = new (0, $880df57ffbf6e614$export$9b575f14aa5e09a1)(page);
7977
8089
  }
8090
+ async selectVariableFromSelector(variableName) {
8091
+ const normalizedVariableName = variableName.replace(/^\$\{(.+)\}$/, '$1');
8092
+ const selector = this.page.locator('#modal .variable-dropdown .ui-autocomplete-input').first();
8093
+ await selector.waitFor({
8094
+ state: 'visible'
8095
+ });
8096
+ await selector.click();
8097
+ await selector.clear();
8098
+ await selector.type(normalizedVariableName, {
8099
+ delay: 50
8100
+ });
8101
+ await this.page.waitForTimeout(300);
8102
+ await selector.press('ArrowDown');
8103
+ const options = this.page.locator('.ui-menu-item-wrapper:visible, ul.xl-components.xl-widget-autocomplete:visible li');
8104
+ const createOption = options.filter({
8105
+ hasText: 'Create a new variable'
8106
+ }).filter({
8107
+ hasText: normalizedVariableName
8108
+ }).first();
8109
+ if (await createOption.isVisible({
8110
+ timeout: 1000
8111
+ })) {
8112
+ await createOption.click();
8113
+ return;
8114
+ }
8115
+ const variableOption = options.filter({
8116
+ hasText: variableName
8117
+ }).first();
8118
+ if (await variableOption.isVisible({
8119
+ timeout: 1000
8120
+ })) {
8121
+ await variableOption.click();
8122
+ return;
8123
+ }
8124
+ await options.filter({
8125
+ hasText: normalizedVariableName
8126
+ }).first().click();
8127
+ }
8128
+ async selectValueFromInlineDropDown(value) {
8129
+ const editor = this.page.locator('#modal .variable-value .inline-drop-down-list-editor').first();
8130
+ await editor.locator('.xl-btn-handler').click();
8131
+ await editor.locator('ul.xl-components.xl-widget-autocomplete li').filter({
8132
+ hasText: value
8133
+ }).click();
8134
+ }
7978
8135
  async expectValue(locators, expectFn) {
7979
8136
  const [index, locator] = await (0, $ef0df8ad8a777ce6$export$a0f926f04148e5d2)(locators);
7980
8137
  expectFn[index](locator);
@@ -8031,7 +8188,7 @@ class $fd4eef3ad2b2e612$var$ReleaseVariableModal extends (0, $f8721861c660dd88$e
8031
8188
  }
8032
8189
  }
8033
8190
  async selectVariableValue(defaultValue) {
8034
- await this.page.locator('.variable-value select').selectOption(defaultValue);
8191
+ await this.selectValueFromInlineDropDown(defaultValue);
8035
8192
  }
8036
8193
  async save() {
8037
8194
  const saveButton = this.page.locator('#modal .modal-footer .save');
@@ -8043,14 +8200,11 @@ class $fd4eef3ad2b2e612$var$ReleaseVariableModal extends (0, $f8721861c660dd88$e
8043
8200
  await (0, $kKeXs$playwrighttest.expect)(saveButton).not.toBeVisible();
8044
8201
  }
8045
8202
  async createPossibleValuesVariable(variableName) {
8046
- await this.page.locator('.variable-toggle button').click();
8047
- await this.page.locator('.ui-autocomplete-input').fill(variableName);
8048
- await this.page.locator('.ui-menu-item-wrapper').filter({
8049
- hasText: `${variableName}`
8050
- }).click();
8203
+ await this.page.locator('#modal .variable-toggle button').click();
8204
+ await this.selectVariableFromSelector(variableName);
8051
8205
  }
8052
8206
  async expectVariableValueToBe(value) {
8053
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator('.variable-value select option[selected="selected"]').textContent()).toBe(value);
8207
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('#modal .variable-value .inline-drop-down-list-editor input').first()).toHaveValue(value);
8054
8208
  }
8055
8209
  async expectNoVariablesInList() {
8056
8210
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByText('No variables defined.')).toBeVisible();