@coolon/angular-ui-powerups 12.4.0-alpha.1 → 12.4.0-alpha.11
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/assets/empty-state.scss +11 -0
- package/assets/styles.scss +1 -0
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js +363 -259
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +2 -7
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/cypress/builder.d.ts +32 -0
- package/cypress/components/aup-abstract-activity.d.ts +8 -0
- package/cypress/components/aup-activity.d.ts +8 -0
- package/cypress/components/aup-alert.d.ts +8 -0
- package/cypress/components/aup-command-face.d.ts +7 -0
- package/cypress/components/aup-command.d.ts +6 -18
- package/cypress/components/aup-empty-state.d.ts +4 -0
- package/cypress/components/aup-input.d.ts +8 -8
- package/cypress/components/aup-modal-activity.d.ts +4 -0
- package/cypress/components/aup-modal-alert.d.ts +6 -0
- package/cypress/components/aup-table.d.ts +1 -2
- package/cypress/components/button-mixin.d.ts +3 -1
- package/cypress/components/button.d.ts +4 -2
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/exports.d.ts +8 -1
- package/cypress/page-builder.d.ts +8 -0
- package/cypress/page-element.d.ts +5 -2
- package/cypress/page.d.ts +4 -30
- package/esm2015/cypress/builder.js +66 -0
- package/esm2015/cypress/builder.js.map +1 -0
- package/esm2015/cypress/builder.metadata.json +1 -0
- package/esm2015/cypress/components/aup-abstract-activity.js +11 -0
- package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-activity.js +13 -0
- package/esm2015/cypress/components/aup-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-alert.js +13 -0
- package/esm2015/cypress/components/aup-alert.js.map +1 -0
- package/esm2015/cypress/components/aup-alert.metadata.json +1 -0
- package/esm2015/cypress/components/aup-command-face.js +20 -18
- package/esm2015/cypress/components/aup-command-face.js.map +1 -1
- package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
- package/esm2015/cypress/components/aup-command.js +25 -9
- package/esm2015/cypress/components/aup-command.js.map +1 -1
- package/esm2015/cypress/components/aup-command.metadata.json +1 -1
- package/esm2015/cypress/components/aup-empty-state.js +7 -0
- package/esm2015/cypress/components/aup-empty-state.js.map +1 -0
- package/esm2015/cypress/components/aup-empty-state.metadata.json +1 -0
- package/esm2015/cypress/components/aup-input.js +7 -7
- package/esm2015/cypress/components/aup-input.js.map +1 -1
- package/esm2015/cypress/components/aup-modal-activity.js +7 -0
- package/esm2015/cypress/components/aup-modal-activity.js.map +1 -0
- package/esm2015/cypress/components/aup-modal-activity.metadata.json +1 -0
- package/esm2015/cypress/components/aup-modal-alert.js +12 -0
- package/esm2015/cypress/components/aup-modal-alert.js.map +1 -0
- package/esm2015/cypress/components/aup-modal-alert.metadata.json +1 -0
- package/esm2015/cypress/components/aup-table.js.map +1 -1
- package/esm2015/cypress/components/aup-table.metadata.json +1 -1
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/exports.js +8 -1
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-builder.js +15 -0
- package/esm2015/cypress/page-builder.js.map +1 -0
- package/esm2015/cypress/page-builder.metadata.json +1 -0
- package/esm2015/cypress/page-element.js +9 -3
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +8 -10
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/esm2015/cypress/path.js +3 -1
- package/esm2015/cypress/path.js.map +1 -1
- package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
- package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
- package/esm2015/lib/place/url-snapshot.js +1 -7
- package/esm2015/lib/place/url-snapshot.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups-cypress.js +264 -166
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +2 -7
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
- package/cypress/section.d.ts +0 -49
- package/esm2015/cypress/section.js +0 -58
- package/esm2015/cypress/section.js.map +0 -1
- package/esm2015/cypress/section.metadata.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"UrlSnapshot":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSerializer","line":17,"character":38},{"__symbolic":"reference","name":"string"}]}],"updateVisitSegments":[{"__symbolic":"method"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"UrlSnapshot":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSerializer","line":17,"character":38},{"__symbolic":"reference","name":"string"}]}],"updateVisitSegments":[{"__symbolic":"method"}],"getPrimarySegments":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":34,"character":3}}]}],"getSegmentsFor":[{"__symbolic":"method"}],"includesPathOf":[{"__symbolic":"method"}],"createVisitFor":[{"__symbolic":"method"}],"getInteractionIds":[{"__symbolic":"method"}],"hasInteractions":[{"__symbolic":"method"}],"hasInteractionIds":[{"__symbolic":"method"}],"updateInteractionIds":[{"__symbolic":"method"}],"removeInteractionIds":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as _ from 'lodash';
|
|
2
1
|
import { lang, Mixin } from '@coolon/typescript-utilities';
|
|
2
|
+
import * as _ from 'lodash';
|
|
3
3
|
import { DefaultUrlSerializer } from '@angular/router';
|
|
4
4
|
|
|
5
5
|
class PageElement {
|
|
@@ -7,7 +7,7 @@ class PageElement {
|
|
|
7
7
|
this.parentElementAccessor = parent instanceof PageElement ? () => parent.element() : parent;
|
|
8
8
|
this.elementAccessStrategy = _.isString(selector) ? {
|
|
9
9
|
findIn: p => p.find(selector),
|
|
10
|
-
shouldNotExist: (p) => p.should('not.
|
|
10
|
+
shouldNotExist: (p) => p.find(selector).should('not.exist')
|
|
11
11
|
} : selector;
|
|
12
12
|
}
|
|
13
13
|
element() {
|
|
@@ -24,7 +24,13 @@ class PageElement {
|
|
|
24
24
|
text ? this.element().contains(text).click() : this.element().click();
|
|
25
25
|
}
|
|
26
26
|
get should() {
|
|
27
|
-
return this.
|
|
27
|
+
return this.getShoulder(this.getShouldElement());
|
|
28
|
+
}
|
|
29
|
+
getShoulder(element) {
|
|
30
|
+
return element.should.bind(element);
|
|
31
|
+
}
|
|
32
|
+
getShouldElement() {
|
|
33
|
+
return this.element();
|
|
28
34
|
}
|
|
29
35
|
shouldBeVisible() {
|
|
30
36
|
this.should('be.visible');
|
|
@@ -37,118 +43,67 @@ class PageElement {
|
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
class FaceAccessor {
|
|
47
|
+
constructor(face) {
|
|
48
|
+
this.face = face;
|
|
49
|
+
}
|
|
50
|
+
findIn(parent) {
|
|
51
|
+
return this.face.text ?
|
|
52
|
+
parent.contains(`aup-command-face`, this.face.text()) :
|
|
53
|
+
this.face.icon ?
|
|
54
|
+
parent.find(`aup-icon[ng-reflect-icon=${this.face.icon()}]`).closest('aup-command-face') :
|
|
55
|
+
undefined;
|
|
56
|
+
}
|
|
57
|
+
shouldNotExist(parent) {
|
|
58
|
+
return this.face.text ?
|
|
59
|
+
parent.should('not.contain', `aup-command-face`, this.face.text()) :
|
|
60
|
+
this.face.icon ?
|
|
61
|
+
parent.should('not.contain', `aup-icon[ng-reflect-icon=${this.face.icon()}]`) :
|
|
62
|
+
undefined;
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
|
-
(function (Path) {
|
|
58
|
-
function setUrlSerialiser(serialiser) {
|
|
59
|
-
urlSerialiser = serialiser;
|
|
60
|
-
}
|
|
61
|
-
Path.setUrlSerialiser = setUrlSerialiser;
|
|
62
|
-
class Segment {
|
|
63
|
-
constructor(path, params = {}) {
|
|
64
|
-
var _a;
|
|
65
|
-
this.path = path;
|
|
66
|
-
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
67
|
-
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
68
|
-
}
|
|
69
|
-
toUrlPart(params) {
|
|
70
|
-
let path = this.path;
|
|
71
|
-
this.visitParams.forEach(p => {
|
|
72
|
-
const value = params[p];
|
|
73
|
-
if (value) {
|
|
74
|
-
path = `${path};${p}=${value}`;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
if (this.routeId && params[this.routeId]) {
|
|
78
|
-
path = path + '/' + params[this.routeId];
|
|
79
|
-
}
|
|
80
|
-
return path;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
Path.Segment = Segment;
|
|
84
|
-
class Builder {
|
|
85
|
-
constructor() {
|
|
86
|
-
this.segments = [];
|
|
87
|
-
}
|
|
88
|
-
segment(name, params) {
|
|
89
|
-
const builder = new Segment(name, params);
|
|
90
|
-
this.segments.push(builder);
|
|
91
|
-
return this;
|
|
92
|
-
}
|
|
93
|
-
getPath() {
|
|
94
|
-
return new Path(this.segments);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
Path.Builder = Builder;
|
|
98
|
-
})(Path || (Path = {}));
|
|
99
|
-
|
|
100
65
|
class AupCommandFace extends PageElement {
|
|
101
66
|
constructor(parentElement, face) {
|
|
102
67
|
super(() => parentElement.element(), AupCommandFace.createAccessor(face));
|
|
103
68
|
}
|
|
104
69
|
static createAccessor(face) {
|
|
105
|
-
|
|
106
|
-
const accessor = {
|
|
107
|
-
findIn(parent) {
|
|
108
|
-
return face.text ?
|
|
109
|
-
parent.contains(`aup-command-face`, face.text()) :
|
|
110
|
-
face.icon ?
|
|
111
|
-
parent.find(`aup-icon[ng-reflect-icon=${face.icon()}]`).closest('aup-command-face') :
|
|
112
|
-
undefined;
|
|
113
|
-
},
|
|
114
|
-
shouldNotExist(parent) {
|
|
115
|
-
return face.text ?
|
|
116
|
-
parent.should("not.contain", `aup-command-face`, face.text()) :
|
|
117
|
-
face.icon ?
|
|
118
|
-
parent.should("not.contain", `aup-icon[ng-reflect-icon=${face.icon()}]`) :
|
|
119
|
-
undefined;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
return accessor;
|
|
70
|
+
return new FaceAccessor(face);
|
|
123
71
|
}
|
|
124
72
|
}
|
|
125
73
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
class AupCommand extends ButtonMixin(PageElement) {
|
|
142
|
-
constructor(parentElementAccessor, face) {
|
|
143
|
-
const faceAccessor = AupCommandFace.createAccessor(face);
|
|
144
|
-
super(parentElementAccessor, {
|
|
145
|
-
findIn(parent) {
|
|
146
|
-
return faceAccessor.findIn(parent).closest("aup-command");
|
|
74
|
+
class AupCommand extends PageElement {
|
|
75
|
+
constructor(parent, faceOrSelector) {
|
|
76
|
+
super(parent, {
|
|
77
|
+
findIn(parentElement) {
|
|
78
|
+
if (_.isString(faceOrSelector)) {
|
|
79
|
+
return parentElement.find(faceOrSelector);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return AupCommandFace.createAccessor(faceOrSelector).findIn(parentElement).closest('aup-command');
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
shouldNotExist(parentElement) {
|
|
86
|
+
this.findIn(parentElement).should("not.exist");
|
|
147
87
|
}
|
|
148
88
|
});
|
|
149
89
|
}
|
|
150
|
-
|
|
151
|
-
|
|
90
|
+
click() {
|
|
91
|
+
this.getButton().click();
|
|
92
|
+
}
|
|
93
|
+
getShouldElement() {
|
|
94
|
+
return this.getButton();
|
|
95
|
+
}
|
|
96
|
+
shouldBeDisabled() {
|
|
97
|
+
this.getButton().should('be.disabled');
|
|
98
|
+
}
|
|
99
|
+
getButton() {
|
|
100
|
+
return this.element().find('button');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
class AupEmptyState extends PageElement {
|
|
105
|
+
shouldContainText(text) {
|
|
106
|
+
this.element().should("contain.text", text);
|
|
152
107
|
}
|
|
153
108
|
}
|
|
154
109
|
|
|
@@ -163,13 +118,13 @@ class AupInput extends PageElement {
|
|
|
163
118
|
return this.element().find('mat-error');
|
|
164
119
|
}
|
|
165
120
|
get labelShould() {
|
|
166
|
-
return this.label()
|
|
121
|
+
return this.getShoulder(this.label());
|
|
167
122
|
}
|
|
168
123
|
get hintShould() {
|
|
169
|
-
return this.hint()
|
|
124
|
+
return this.getShoulder(this.hint());
|
|
170
125
|
}
|
|
171
126
|
get errorShould() {
|
|
172
|
-
return this.error()
|
|
127
|
+
return this.getShoulder(this.error());
|
|
173
128
|
}
|
|
174
129
|
labelShouldBe(text) {
|
|
175
130
|
return this.labelShould("have.text", text);
|
|
@@ -195,14 +150,14 @@ class AupInput extends PageElement {
|
|
|
195
150
|
input.type(`${value}`);
|
|
196
151
|
this.input().should('have.value', `${value}`);
|
|
197
152
|
}
|
|
198
|
-
|
|
199
|
-
return this.input()
|
|
153
|
+
getShouldElement() {
|
|
154
|
+
return this.input();
|
|
200
155
|
}
|
|
201
156
|
}
|
|
202
157
|
AupInput.HtmlInput = HtmlInput;
|
|
203
158
|
class TextAreaInput extends AupInput {
|
|
204
|
-
|
|
205
|
-
return this.input()
|
|
159
|
+
getShouldElement() {
|
|
160
|
+
return this.input();
|
|
206
161
|
}
|
|
207
162
|
input() {
|
|
208
163
|
return this.element().find('textarea');
|
|
@@ -270,6 +225,21 @@ class AupTable extends PageElement {
|
|
|
270
225
|
AupTable.Cell = Cell;
|
|
271
226
|
})(AupTable || (AupTable = {}));
|
|
272
227
|
|
|
228
|
+
function ButtonMixin(Base) {
|
|
229
|
+
return class extends Base {
|
|
230
|
+
constructor(...args) {
|
|
231
|
+
super(...args);
|
|
232
|
+
}
|
|
233
|
+
click() {
|
|
234
|
+
return this.element().click();
|
|
235
|
+
}
|
|
236
|
+
shouldBeDisabled() {
|
|
237
|
+
this.should("be.disabled");
|
|
238
|
+
// this.should("have.css", "color", "rgba(0,0,0,0.26)")
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
273
243
|
class Button extends ButtonMixin(PageElement) {
|
|
274
244
|
constructor(parentElementAccessor, buttonText) {
|
|
275
245
|
super(parentElementAccessor, {
|
|
@@ -283,56 +253,186 @@ class Button extends ButtonMixin(PageElement) {
|
|
|
283
253
|
}
|
|
284
254
|
}
|
|
285
255
|
|
|
286
|
-
|
|
287
|
-
(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
256
|
+
class Builder {
|
|
257
|
+
constructor(source) {
|
|
258
|
+
this.source = source;
|
|
259
|
+
}
|
|
260
|
+
find(selector) {
|
|
261
|
+
return new PageElement(this.source, selector);
|
|
262
|
+
}
|
|
263
|
+
section(selector, builder) {
|
|
264
|
+
return this.createContainerElement(PageElement, selector, builder);
|
|
265
|
+
}
|
|
266
|
+
contains(text) {
|
|
267
|
+
return new PageElement(this.source, {
|
|
268
|
+
findIn: parent => parent.contains(text),
|
|
269
|
+
shouldNotExist: (parent) => parent.should('not.contain', text)
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
button(text) {
|
|
273
|
+
return new Button(this.source, text);
|
|
274
|
+
}
|
|
275
|
+
aupStringInput(selector) {
|
|
276
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
277
|
+
}
|
|
278
|
+
aupTextInput(selector) {
|
|
279
|
+
return new AupInput.TextAreaInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
280
|
+
}
|
|
281
|
+
aupPasswordInput(selector) {
|
|
282
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
283
|
+
}
|
|
284
|
+
aupNumberInput(selector) {
|
|
285
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
286
|
+
}
|
|
287
|
+
aupCommand(faceOrSelector) {
|
|
288
|
+
return new AupCommand(this.source, faceOrSelector);
|
|
289
|
+
}
|
|
290
|
+
aupTabbedNavigation() {
|
|
291
|
+
return new AupNavigation(this.source, 'aup-tabbed-place-navigation');
|
|
292
|
+
}
|
|
293
|
+
aupSideNavigation() {
|
|
294
|
+
return new AupNavigation(this.source, 'aup-list-place-nav');
|
|
295
|
+
}
|
|
296
|
+
aupTable(selector) {
|
|
297
|
+
return new AupTable(this.source, selector !== null && selector !== void 0 ? selector : 'aup-table');
|
|
298
|
+
}
|
|
299
|
+
aupEmptyState(selectorOrBuilder, optionalBuilder) {
|
|
300
|
+
return this.createContainerElement(AupEmptyState, selectorOrBuilder, optionalBuilder, 'aup-empty-state');
|
|
301
|
+
}
|
|
302
|
+
createContainerElement(klass, selectorOrBuilder, optionalBuilder, defaultSelector) {
|
|
303
|
+
const selector = _.isString(selectorOrBuilder) ? selectorOrBuilder : defaultSelector;
|
|
304
|
+
const builder = _.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
|
|
305
|
+
if (!selector) {
|
|
306
|
+
lang.illegalState('This element requires a selector but none was provided');
|
|
307
|
+
}
|
|
308
|
+
const element = new klass(this.source, selector);
|
|
309
|
+
return builder ? Mixin.createProxy(element, builder(new Builder(element))) : element;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
class AupAbstractActivity extends PageElement {
|
|
314
|
+
constructor(parent, selector) {
|
|
315
|
+
super(parent, selector);
|
|
316
|
+
this.title = this.find('aup-activity-title');
|
|
317
|
+
this._confirmCommand = new Builder(this).aupCommand('[data-cy=confirm-command]');
|
|
318
|
+
this._cancelCommand = new Builder(this).aupCommand('[data-cy=cancel-command]');
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
class AupActivity extends AupAbstractActivity {
|
|
323
|
+
constructor(parent, selector) {
|
|
324
|
+
super(parent, selector);
|
|
325
|
+
}
|
|
326
|
+
get confirmCommand() {
|
|
327
|
+
return this._confirmCommand;
|
|
328
|
+
}
|
|
329
|
+
get cancelCommand() {
|
|
330
|
+
return this._cancelCommand;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
class AupModalActivity extends AupActivity {
|
|
335
|
+
clickBackdrop() {
|
|
336
|
+
this.element().closest(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
class AupAlert extends AupAbstractActivity {
|
|
341
|
+
constructor(parent, selector) {
|
|
342
|
+
super(parent, selector);
|
|
343
|
+
}
|
|
344
|
+
get closeCommand() {
|
|
345
|
+
return this._confirmCommand;
|
|
346
|
+
}
|
|
347
|
+
clickClose() {
|
|
348
|
+
this.closeCommand.click();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
class AupModalAlert extends AupAlert {
|
|
353
|
+
constructor(parent, selector) {
|
|
354
|
+
super(parent, selector);
|
|
355
|
+
}
|
|
356
|
+
clickBackdrop() {
|
|
357
|
+
this.element()
|
|
358
|
+
.closest(`.cdk-overlay-container`)
|
|
359
|
+
.find(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
class PageBuilder extends Builder {
|
|
364
|
+
aupModalActivity(selector, builder) {
|
|
365
|
+
return this.createContainerElement(AupModalActivity, `.dialog-interaction-context ${selector}`, builder);
|
|
366
|
+
}
|
|
367
|
+
aupModalAlert(builder) {
|
|
368
|
+
return this.createContainerElement(AupModalAlert, `.dialog-interaction-context aup-alert-dialog`, builder);
|
|
369
|
+
}
|
|
370
|
+
aupModelConfirm(builder) {
|
|
371
|
+
return this.aupModalActivity(`aup-confirm-dialog`, builder);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
let urlSerialiser = new DefaultUrlSerializer();
|
|
376
|
+
class Path {
|
|
377
|
+
constructor(segments) {
|
|
378
|
+
this.segments = segments;
|
|
379
|
+
}
|
|
380
|
+
static extractVisitParameters(url) {
|
|
381
|
+
var _a, _b;
|
|
382
|
+
let result = {};
|
|
383
|
+
const urlTree = urlSerialiser.parse(url);
|
|
384
|
+
const urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
|
|
385
|
+
urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(s => {
|
|
386
|
+
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
387
|
+
});
|
|
388
|
+
return result;
|
|
389
|
+
}
|
|
390
|
+
toUrl(matrixParams) {
|
|
391
|
+
return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
(function (Path) {
|
|
395
|
+
function setUrlSerialiser(serialiser) {
|
|
396
|
+
urlSerialiser = serialiser;
|
|
397
|
+
}
|
|
398
|
+
Path.setUrlSerialiser = setUrlSerialiser;
|
|
399
|
+
class Segment {
|
|
400
|
+
constructor(path, params = {}) {
|
|
401
|
+
var _a;
|
|
402
|
+
this.path = path;
|
|
403
|
+
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
404
|
+
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
405
|
+
}
|
|
406
|
+
toUrlPart(params) {
|
|
407
|
+
let path = this.path;
|
|
408
|
+
this.visitParams.forEach(p => {
|
|
409
|
+
const value = params[p];
|
|
410
|
+
if (value) {
|
|
411
|
+
path = `${path};${p}=${value}`;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
if (this.routeId && params[this.routeId]) {
|
|
415
|
+
path = path + '/' + params[this.routeId];
|
|
329
416
|
}
|
|
330
|
-
|
|
417
|
+
return path;
|
|
418
|
+
}
|
|
331
419
|
}
|
|
332
|
-
|
|
333
|
-
class
|
|
420
|
+
Path.Segment = Segment;
|
|
421
|
+
class Builder {
|
|
422
|
+
constructor() {
|
|
423
|
+
this.segments = [];
|
|
424
|
+
}
|
|
425
|
+
segment(name, params) {
|
|
426
|
+
const builder = new Segment(name, params);
|
|
427
|
+
this.segments.push(builder);
|
|
428
|
+
return this;
|
|
429
|
+
}
|
|
430
|
+
getPath() {
|
|
431
|
+
return new Path(this.segments);
|
|
432
|
+
}
|
|
334
433
|
}
|
|
335
|
-
|
|
434
|
+
Path.Builder = Builder;
|
|
435
|
+
})(Path || (Path = {}));
|
|
336
436
|
|
|
337
437
|
class Page extends PageElement {
|
|
338
438
|
constructor(path) {
|
|
@@ -363,8 +463,8 @@ class Page extends PageElement {
|
|
|
363
463
|
}
|
|
364
464
|
shouldBeActive(withParameters) {
|
|
365
465
|
// Note: cy.window() doesn't return a promise... it's a chainable.
|
|
366
|
-
cy
|
|
367
|
-
cy
|
|
466
|
+
cy['waitUntil'](() => {
|
|
467
|
+
return cy.window().then(window => {
|
|
368
468
|
return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
|
|
369
469
|
});
|
|
370
470
|
});
|
|
@@ -381,21 +481,19 @@ class Page extends PageElement {
|
|
|
381
481
|
}
|
|
382
482
|
}
|
|
383
483
|
(function (Page) {
|
|
384
|
-
function create(pathOrPathBuilder,
|
|
484
|
+
function create(pathOrPathBuilder, builder) {
|
|
385
485
|
const pathBuilder = new Path.Builder();
|
|
386
486
|
if (_.isString(pathOrPathBuilder)) {
|
|
387
|
-
pathOrPathBuilder.split(
|
|
487
|
+
pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
|
|
388
488
|
}
|
|
389
489
|
else {
|
|
390
490
|
pathOrPathBuilder(pathBuilder);
|
|
391
491
|
}
|
|
392
|
-
const
|
|
393
|
-
|
|
492
|
+
const instance = new Page(pathBuilder.getPath());
|
|
493
|
+
const content = builder(new PageBuilder(instance));
|
|
494
|
+
return Mixin.createProxy(content, instance);
|
|
394
495
|
}
|
|
395
496
|
Page.create = create;
|
|
396
|
-
class PageBuilder extends Section.Mixin(Page) {
|
|
397
|
-
}
|
|
398
|
-
Page.PageBuilder = PageBuilder;
|
|
399
497
|
})(Page || (Page = {}));
|
|
400
498
|
|
|
401
499
|
class AupCommandGroup extends PageElement {
|
|
@@ -439,5 +537,5 @@ class AupToolBar extends PageElement {
|
|
|
439
537
|
* Generated bundle index. Do not edit.
|
|
440
538
|
*/
|
|
441
539
|
|
|
442
|
-
export { AupCommand, AupCommandFace, AupCommandGroup, AupInput, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Button, ButtonMixin, Page, PageElement, Path
|
|
540
|
+
export { AupAbstractActivity, AupActivity, AupAlert, AupCommand, AupCommandFace, AupCommandGroup, AupEmptyState, AupInput, AupModalActivity, AupModalAlert, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Builder, Button, ButtonMixin, FaceAccessor, Page, PageBuilder, PageElement, Path };
|
|
443
541
|
//# sourceMappingURL=coolon-angular-ui-powerups-cypress.js.map
|