@digital-ai/devops-page-object-release 0.0.4 → 0.0.5

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.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 68bf4f7: More page objects for task drawer
8
+
3
9
  ## 0.0.4
4
10
 
5
11
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1047,6 +1047,29 @@ class $487fa7328f6a6cf2$export$b66cc3708c7bd4a4 extends (0, $4cb1d878399c7551$ex
1047
1047
 
1048
1048
 
1049
1049
 
1050
+ async function $ef0df8ad8a777ce6$export$a0f926f04148e5d2(locators) {
1051
+ const res = await Promise.all([
1052
+ ...locators.map(async (locator, index)=>{
1053
+ let timedOut = false;
1054
+ await locator.waitFor({
1055
+ state: "visible",
1056
+ timeout: 2000
1057
+ }).catch(()=>timedOut = true);
1058
+ return [
1059
+ timedOut ? -1 : index,
1060
+ locator
1061
+ ];
1062
+ })
1063
+ ]);
1064
+ const resolvedLocator = res.find((r)=>r[0] !== -1);
1065
+ if (!resolvedLocator) {
1066
+ console.warn("waitForOneOf", res);
1067
+ throw new Error("no locator visible before timeout");
1068
+ }
1069
+ return resolvedLocator;
1070
+ }
1071
+
1072
+
1050
1073
  class $e53d02b209248a0b$export$a87f0ae8695e74be extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
1051
1074
  async openVariable(variableKey) {
1052
1075
  await this.page.locator(`.variables-list .variable`).getByText(variableKey).click();
@@ -1054,8 +1077,31 @@ class $e53d02b209248a0b$export$a87f0ae8695e74be extends (0, $f8721861c660dd88$ex
1054
1077
  }
1055
1078
  }
1056
1079
  class $e53d02b209248a0b$var$ReleaseVariableModal extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
1080
+ async expectValue(locators, expectFn) {
1081
+ const [index, locator] = await (0, $ef0df8ad8a777ce6$export$a0f926f04148e5d2)(locators);
1082
+ await expectFn[index](locator);
1083
+ }
1057
1084
  async expectValueToBe(value) {
1058
- await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#modal .variable-value input")).toHaveValue(value);
1085
+ await this.expectValue([
1086
+ this.page.locator("#modal .variable-value input"),
1087
+ this.page.locator("#modal .variable-value .field-readonly"),
1088
+ this.page.locator("#modal .variable-value .xl-map-string-string")
1089
+ ], [
1090
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l).toHaveValue(value),
1091
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l).toHaveText(value),
1092
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l).toHaveText(value)
1093
+ ]);
1094
+ }
1095
+ async expectValueToContain(value) {
1096
+ await this.expectValue([
1097
+ this.page.locator("#modal .variable-value input"),
1098
+ this.page.locator("#modal .variable-value .field-readonly"),
1099
+ this.page.locator("#modal .variable-value .xl-map-string-string")
1100
+ ], [
1101
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l.inputValue()).toContain(value),
1102
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l).toContainText(value),
1103
+ (l)=>(0, $kKeXs$playwrighttest.expect)(l).toContainText(value)
1104
+ ]);
1059
1105
  }
1060
1106
  async close() {
1061
1107
  await this.page.locator("#modal .modal-header button.close").click();
@@ -1129,6 +1175,9 @@ class $d91a6ef09b618c8d$var$ConfigRail extends $d91a6ef09b618c8d$export$e946776e
1129
1175
  hasText: variableName
1130
1176
  }).click();
1131
1177
  }
1178
+ async setVariable(propertyName, variableName) {
1179
+ return this.setValueFromCi(propertyName, variableName);
1180
+ }
1132
1181
  async expectValueFromString(propertyName, propertyValue) {
1133
1182
  return await (0, $kKeXs$playwrighttest.expect)(this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`)).toHaveText(propertyValue);
1134
1183
  }
@@ -2049,7 +2098,6 @@ const $8977f8672c5de0fa$export$45f0aca2596a2bb3 = function() {
2049
2098
  const getVariableEntity = (value, key, containerId, index, password)=>{
2050
2099
  const keyNoSyntax = key.replace("${", "").replace("}", "");
2051
2100
  return {
2052
- title: "",
2053
2101
  id: `${containerId}/Variable${index}`,
2054
2102
  key: keyNoSyntax,
2055
2103
  requiresValue: true,