@digital-ai/devops-page-object-release 0.0.2 → 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 +18 -0
- package/dist/main.js +141 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +141 -2
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +30 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
## 0.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7b1ac2b: Update readme
|
|
14
|
+
|
|
15
|
+
## 0.0.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 5e61920: Task drawer config rail, first draft
|
|
20
|
+
|
|
3
21
|
## 0.0.2
|
|
4
22
|
|
|
5
23
|
### 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
|
|
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();
|
|
@@ -1063,6 +1109,81 @@ class $e53d02b209248a0b$var$ReleaseVariableModal extends (0, $f8721861c660dd88$e
|
|
|
1063
1109
|
}
|
|
1064
1110
|
|
|
1065
1111
|
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
class $d91a6ef09b618c8d$export$e946776eae644790 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
|
|
1115
|
+
constructor(page){
|
|
1116
|
+
super(page);
|
|
1117
|
+
this.taskDrawerLocator = this.page.locator("task-drawer .dot-drawer");
|
|
1118
|
+
}
|
|
1119
|
+
async openConfigRail() {
|
|
1120
|
+
await this.openRail("Config");
|
|
1121
|
+
return new $d91a6ef09b618c8d$var$ConfigRail(this.page);
|
|
1122
|
+
}
|
|
1123
|
+
async openRail(rail) {
|
|
1124
|
+
await this.taskDrawerLocator.locator(".task-navigation-rail").getByText(rail).click();
|
|
1125
|
+
}
|
|
1126
|
+
async close() {
|
|
1127
|
+
await this.taskDrawerLocator.locator(".task-drawer-header").getByTestId("close-btn").click();
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
class $d91a6ef09b618c8d$var$ConfigRail extends $d91a6ef09b618c8d$export$e946776eae644790 {
|
|
1131
|
+
constructor(page){
|
|
1132
|
+
super(page);
|
|
1133
|
+
this.railLocator = this.taskDrawerLocator.locator(".task-config");
|
|
1134
|
+
}
|
|
1135
|
+
async openInputProperties() {
|
|
1136
|
+
await this.railLocator.locator(".task-config-header").getByText("Input properties").click();
|
|
1137
|
+
}
|
|
1138
|
+
async openOutputProperties() {
|
|
1139
|
+
await this.railLocator.locator(".task-config-header").getByText("Output properties").click();
|
|
1140
|
+
}
|
|
1141
|
+
async getValueFromCi(propertyName) {
|
|
1142
|
+
return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
|
|
1143
|
+
}
|
|
1144
|
+
async getAllOptionsFromCi(propertyName) {
|
|
1145
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
1146
|
+
return this.railLocator.locator(`.dot-popper ul li`).allInnerTexts();
|
|
1147
|
+
}
|
|
1148
|
+
async setValueFromCi(propertyName, value) {
|
|
1149
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
|
|
1150
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
1151
|
+
await this.railLocator.locator(`.dot-popper ul li`, {
|
|
1152
|
+
hasText: value
|
|
1153
|
+
}).click();
|
|
1154
|
+
}
|
|
1155
|
+
async getValueFromString(propertyName) {
|
|
1156
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
1157
|
+
return this.railLocator.locator(`input[id="${propertyName}"]`).inputValue();
|
|
1158
|
+
}
|
|
1159
|
+
async setValueFromString(propertyName, value) {
|
|
1160
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
1161
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
|
|
1162
|
+
}
|
|
1163
|
+
async setValueFromLargeString(propertyName, value) {
|
|
1164
|
+
await this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`).focus();
|
|
1165
|
+
await this.railLocator.locator(`textarea[id="${propertyName}"]`).fill(value);
|
|
1166
|
+
}
|
|
1167
|
+
async setValueFromPassword(propertyName, value) {
|
|
1168
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(value);
|
|
1169
|
+
}
|
|
1170
|
+
async setAndCreateVariable(propertyName, variableName) {
|
|
1171
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).clear();
|
|
1172
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).click();
|
|
1173
|
+
await this.railLocator.locator(`input[id="${propertyName}"]`).fill(variableName);
|
|
1174
|
+
await this.railLocator.locator(`.dot-popper button`, {
|
|
1175
|
+
hasText: variableName
|
|
1176
|
+
}).click();
|
|
1177
|
+
}
|
|
1178
|
+
async setVariable(propertyName, variableName) {
|
|
1179
|
+
return this.setValueFromCi(propertyName, variableName);
|
|
1180
|
+
}
|
|
1181
|
+
async expectValueFromString(propertyName, propertyValue) {
|
|
1182
|
+
return await (0, $kKeXs$playwrighttest.expect)(this.railLocator.locator(`.input-scalar-fake-input[id="${propertyName}"]`)).toHaveText(propertyValue);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
|
|
1066
1187
|
class $fcbf42f405a34f2e$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
|
|
1067
1188
|
async openTriggers() {
|
|
1068
1189
|
await this.openSubPage("Triggers");
|
|
@@ -1094,12 +1215,21 @@ class $fcbf42f405a34f2e$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
|
|
|
1094
1215
|
exact: true
|
|
1095
1216
|
})).toBeVisible();
|
|
1096
1217
|
}
|
|
1218
|
+
async waitForStatusLine(statusLine) {
|
|
1219
|
+
await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task .status-line").getByText(statusLine, {
|
|
1220
|
+
exact: true
|
|
1221
|
+
})).toBeVisible();
|
|
1222
|
+
}
|
|
1097
1223
|
/**
|
|
1098
1224
|
* @deprecated Don't use this, use new TaskDrawer
|
|
1099
1225
|
*/ async openCustomScriptTaskModal(taskName) {
|
|
1100
1226
|
await this.page.locator(".task-header").getByText(taskName).click();
|
|
1101
1227
|
return new (0, $487fa7328f6a6cf2$export$b66cc3708c7bd4a4)(this.page);
|
|
1102
1228
|
}
|
|
1229
|
+
async openTaskDrawer(taskName) {
|
|
1230
|
+
await this.page.locator(".task-header").getByText(taskName).click();
|
|
1231
|
+
return new (0, $d91a6ef09b618c8d$export$e946776eae644790)(this.page);
|
|
1232
|
+
}
|
|
1103
1233
|
async openVariables() {
|
|
1104
1234
|
await this.openReleaseMenu("Variables");
|
|
1105
1235
|
return new (0, $e53d02b209248a0b$export$a87f0ae8695e74be)(this.page);
|
|
@@ -1968,7 +2098,6 @@ const $8977f8672c5de0fa$export$45f0aca2596a2bb3 = function() {
|
|
|
1968
2098
|
const getVariableEntity = (value, key, containerId, index, password)=>{
|
|
1969
2099
|
const keyNoSyntax = key.replace("${", "").replace("}", "");
|
|
1970
2100
|
return {
|
|
1971
|
-
title: "",
|
|
1972
2101
|
id: `${containerId}/Variable${index}`,
|
|
1973
2102
|
key: keyNoSyntax,
|
|
1974
2103
|
requiresValue: true,
|
|
@@ -2165,6 +2294,16 @@ class $6998c6a53a9eb4fa$var$Fixtures {
|
|
|
2165
2294
|
async setFeatures(features) {
|
|
2166
2295
|
return this.doPut("/settings/features", features);
|
|
2167
2296
|
}
|
|
2297
|
+
async enableTaskDrawer(enabled) {
|
|
2298
|
+
return this.setFeatures([
|
|
2299
|
+
{
|
|
2300
|
+
id: "Configuration/features/xlrelease.TaskDrawer",
|
|
2301
|
+
type: "xlrelease.TaskDrawer",
|
|
2302
|
+
category: "Stable",
|
|
2303
|
+
enabled: enabled
|
|
2304
|
+
}
|
|
2305
|
+
]);
|
|
2306
|
+
}
|
|
2168
2307
|
doPost(url, body) {
|
|
2169
2308
|
return this.request.post(url, {
|
|
2170
2309
|
data: body,
|