@coolon/angular-ui-powerups 12.4.0-alpha.2 → 12.4.0-alpha.20
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 +657 -306
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +7 -11
- 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 +45 -0
- package/cypress/components/aup-abstract-activity.d.ts +9 -0
- package/cypress/components/aup-abstract-table.d.ts +18 -0
- package/cypress/components/aup-activity.d.ts +9 -0
- package/cypress/components/aup-alert.d.ts +9 -0
- package/cypress/components/aup-command-face.d.ts +2 -8
- package/cypress/components/aup-command.d.ts +1 -1
- package/cypress/components/aup-empty-state.d.ts +4 -0
- package/cypress/components/aup-input.d.ts +11 -5
- package/cypress/components/aup-modal-activity.d.ts +4 -0
- package/cypress/components/aup-modal-alert.d.ts +7 -0
- package/cypress/components/aup-table.d.ts +5 -18
- package/cypress/components/aup-tree-table.d.ts +16 -0
- package/cypress/components/button.d.ts +9 -7
- package/cypress/components/form-element-mixin.d.ts +20 -0
- package/cypress/components/mat-checkbox.d.ts +29 -0
- package/cypress/components/popup/aup-abstract-popup-menu.d.ts +15 -0
- package/cypress/components/popup/aup-more-menu.d.ts +5 -0
- package/cypress/components/popup/aup-popup-menu-panel.d.ts +3 -0
- package/cypress/components/popup/aup-popup-menu.d.ts +7 -0
- package/cypress/components/table/aup-table-cell.d.ts +9 -0
- package/cypress/components/table/aup-table-column.d.ts +10 -0
- package/cypress/components/table/aup-table-row.d.ts +17 -0
- package/cypress/components/table/aup-table-selection-cell.d.ts +5 -0
- package/cypress/components/table/aup-table-selection-column.d.ts +5 -0
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/element-locator.d.ts +8 -0
- package/cypress/exports.d.ts +22 -4
- package/cypress/page-builder.d.ts +8 -0
- package/cypress/page-element.d.ts +9 -12
- package/cypress/page.d.ts +5 -33
- package/esm2015/cypress/builder.js +99 -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 +12 -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-abstract-table.js +50 -0
- package/esm2015/cypress/components/aup-abstract-table.js.map +1 -0
- package/esm2015/cypress/components/aup-abstract-table.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 +11 -22
- 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 +9 -6
- 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 +17 -5
- package/esm2015/cypress/components/aup-input.js.map +1 -1
- package/esm2015/cypress/components/aup-input.metadata.json +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-navigation.js +1 -1
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-table.js +5 -33
- package/esm2015/cypress/components/aup-table.js.map +1 -1
- package/esm2015/cypress/components/aup-table.metadata.json +1 -1
- package/esm2015/cypress/components/aup-tree-table.js +34 -0
- package/esm2015/cypress/components/aup-tree-table.js.map +1 -0
- package/esm2015/cypress/components/aup-tree-table.metadata.json +1 -0
- package/esm2015/cypress/components/button.js +4 -10
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/components/form-element-mixin.js +11 -0
- package/esm2015/cypress/components/form-element-mixin.js.map +1 -0
- package/esm2015/cypress/components/form-element-mixin.metadata.json +1 -0
- package/esm2015/cypress/components/mat-checkbox.js +34 -0
- package/esm2015/cypress/components/mat-checkbox.js.map +1 -0
- package/esm2015/cypress/components/mat-checkbox.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js +33 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-abstract-popup-menu.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-more-menu.js +8 -0
- package/esm2015/cypress/components/popup/aup-more-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-more-menu.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.js +4 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu-panel.metadata.json +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.js +12 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.js.map +1 -0
- package/esm2015/cypress/components/popup/aup-popup-menu.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-cell.js +14 -0
- package/esm2015/cypress/components/table/aup-table-cell.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-cell.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-column.js +19 -0
- package/esm2015/cypress/components/table/aup-table-column.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-column.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-row.js +28 -0
- package/esm2015/cypress/components/table/aup-table-row.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-row.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.js +6 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-cell.metadata.json +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.js +6 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.js.map +1 -0
- package/esm2015/cypress/components/table/aup-table-selection-column.metadata.json +1 -0
- package/esm2015/cypress/element-locator.js +16 -0
- package/esm2015/cypress/element-locator.js.map +1 -0
- package/esm2015/cypress/element-locator.metadata.json +1 -0
- package/esm2015/cypress/exports.js +22 -4
- 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 +18 -20
- 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/components/tables/tree-table/flattened-tree-list-model.js +4 -4
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/flattened-tree-list-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js +1 -0
- package/esm2015/lib/components/tables/tree-table/tree-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-model.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 +496 -221
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +7 -11
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/tables/tree-table/flattened-tree-list-model.d.ts +0 -1
- package/lib/components/tables/tree-table/tree-table-model.d.ts +4 -5
- package/package.json +1 -1
- package/cypress/components/aup-more-menu.d.ts +0 -4
- package/cypress/components/aup-popup-menu.d.ts +0 -7
- package/cypress/components/button-mixin.d.ts +0 -19
- package/cypress/section.d.ts +0 -51
- package/esm2015/cypress/components/aup-more-menu.js +0 -7
- package/esm2015/cypress/components/aup-more-menu.js.map +0 -1
- package/esm2015/cypress/components/aup-more-menu.metadata.json +0 -1
- package/esm2015/cypress/components/aup-popup-menu.js +0 -19
- package/esm2015/cypress/components/aup-popup-menu.js.map +0 -1
- package/esm2015/cypress/components/aup-popup-menu.metadata.json +0 -1
- package/esm2015/cypress/components/button-mixin.js +0 -15
- package/esm2015/cypress/components/button-mixin.js.map +0 -1
- package/esm2015/cypress/components/button-mixin.metadata.json +0 -1
- package/esm2015/cypress/section.js +0 -58
- package/esm2015/cypress/section.js.map +0 -1
- package/esm2015/cypress/section.metadata.json +0 -1
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
import { lang, Mixin } from '@coolon/typescript-utilities';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
|
+
import { __decorate, __metadata } from 'tslib';
|
|
4
|
+
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
3
5
|
import { DefaultUrlSerializer } from '@angular/router';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var ElementLocator;
|
|
8
|
+
(function (ElementLocator) {
|
|
9
|
+
function findByCssSelector(selector) {
|
|
10
|
+
return parent => parent.dom().find(selector);
|
|
11
|
+
}
|
|
12
|
+
ElementLocator.findByCssSelector = findByCssSelector;
|
|
13
|
+
function findByTextContent(text) {
|
|
14
|
+
return parent => parent.dom().contains(text);
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return parent
|
|
16
|
+
ElementLocator.findByTextContent = findByTextContent;
|
|
17
|
+
function findBySelectorAndTextContent(selector, text) {
|
|
18
|
+
return parent => parent.dom().contains(selector, text);
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
ElementLocator.findBySelectorAndTextContent = findBySelectorAndTextContent;
|
|
21
|
+
})(ElementLocator || (ElementLocator = {}));
|
|
22
|
+
|
|
23
|
+
class PageElement {
|
|
24
|
+
constructor(parent, selectorOrLocator) {
|
|
25
|
+
this.parent = parent;
|
|
26
|
+
this.domElementLocator = _.isString(selectorOrLocator) ?
|
|
27
|
+
ElementLocator.findByCssSelector(selectorOrLocator) :
|
|
28
|
+
selectorOrLocator;
|
|
29
|
+
}
|
|
30
|
+
dom() {
|
|
31
|
+
return this.domElementLocator(this.parent);
|
|
19
32
|
}
|
|
20
33
|
find(selector) {
|
|
21
|
-
return new PageElement(
|
|
34
|
+
return new PageElement(this, selector);
|
|
22
35
|
}
|
|
23
36
|
click(text) {
|
|
24
|
-
text ? this.
|
|
37
|
+
text ? this.dom().contains(text).click() : this.dom().click();
|
|
25
38
|
}
|
|
26
39
|
get should() {
|
|
27
40
|
return this.getShoulder(this.getShouldElement());
|
|
@@ -30,113 +43,47 @@ class PageElement {
|
|
|
30
43
|
return element.should.bind(element);
|
|
31
44
|
}
|
|
32
45
|
getShouldElement() {
|
|
33
|
-
return this.
|
|
46
|
+
return this.dom();
|
|
34
47
|
}
|
|
35
48
|
shouldBeVisible() {
|
|
36
49
|
this.should('be.visible');
|
|
37
50
|
}
|
|
38
51
|
shouldNotBeVisible() {
|
|
39
|
-
|
|
40
|
-
lang.abstractMethod(this.constructor);
|
|
41
|
-
}
|
|
42
|
-
this.elementAccessStrategy.shouldNotExist(this.getParentElement());
|
|
52
|
+
this.should('not.be.visible');
|
|
43
53
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
let urlSerialiser = new DefaultUrlSerializer();
|
|
47
|
-
class Path {
|
|
48
|
-
constructor(segments) {
|
|
49
|
-
this.segments = segments;
|
|
50
|
-
}
|
|
51
|
-
static extractVisitParameters(url) {
|
|
52
|
-
let result = {};
|
|
53
|
-
const urlTree = urlSerialiser.parse(url);
|
|
54
|
-
urlTree.root.children.primary.segments.forEach(s => {
|
|
55
|
-
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
56
|
-
});
|
|
57
|
-
return result;
|
|
54
|
+
shouldExist() {
|
|
55
|
+
this.dom().should('exist');
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
shouldNotExist() {
|
|
58
|
+
this.dom().should('not.exist');
|
|
61
59
|
}
|
|
62
60
|
}
|
|
63
|
-
(function (Path) {
|
|
64
|
-
function setUrlSerialiser(serialiser) {
|
|
65
|
-
urlSerialiser = serialiser;
|
|
66
|
-
}
|
|
67
|
-
Path.setUrlSerialiser = setUrlSerialiser;
|
|
68
|
-
class Segment {
|
|
69
|
-
constructor(path, params = {}) {
|
|
70
|
-
var _a;
|
|
71
|
-
this.path = path;
|
|
72
|
-
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
73
|
-
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
74
|
-
}
|
|
75
|
-
toUrlPart(params) {
|
|
76
|
-
let path = this.path;
|
|
77
|
-
this.visitParams.forEach(p => {
|
|
78
|
-
const value = params[p];
|
|
79
|
-
if (value) {
|
|
80
|
-
path = `${path};${p}=${value}`;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
if (this.routeId && params[this.routeId]) {
|
|
84
|
-
path = path + '/' + params[this.routeId];
|
|
85
|
-
}
|
|
86
|
-
return path;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
Path.Segment = Segment;
|
|
90
|
-
class Builder {
|
|
91
|
-
constructor() {
|
|
92
|
-
this.segments = [];
|
|
93
|
-
}
|
|
94
|
-
segment(name, params) {
|
|
95
|
-
const builder = new Segment(name, params);
|
|
96
|
-
this.segments.push(builder);
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
getPath() {
|
|
100
|
-
return new Path(this.segments);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
Path.Builder = Builder;
|
|
104
|
-
})(Path || (Path = {}));
|
|
105
61
|
|
|
106
|
-
class FaceAccessor {
|
|
107
|
-
constructor(face) {
|
|
108
|
-
this.face = face;
|
|
109
|
-
}
|
|
110
|
-
findIn(parent) {
|
|
111
|
-
return this.face.text ?
|
|
112
|
-
parent.contains(`aup-command-face`, this.face.text()) :
|
|
113
|
-
this.face.icon ?
|
|
114
|
-
parent.find(`aup-icon[ng-reflect-icon=${this.face.icon()}]`).closest('aup-command-face') :
|
|
115
|
-
undefined;
|
|
116
|
-
}
|
|
117
|
-
shouldNotExist(parent) {
|
|
118
|
-
return this.face.text ?
|
|
119
|
-
parent.should('not.contain', `aup-command-face`, this.face.text()) :
|
|
120
|
-
this.face.icon ?
|
|
121
|
-
parent.should('not.contain', `aup-icon[ng-reflect-icon=${this.face.icon()}]`) :
|
|
122
|
-
undefined;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
62
|
class AupCommandFace extends PageElement {
|
|
126
63
|
constructor(parentElement, face) {
|
|
127
|
-
super(
|
|
128
|
-
}
|
|
129
|
-
static
|
|
130
|
-
|
|
64
|
+
super(parentElement, AupCommandFace.createElementLocator(face));
|
|
65
|
+
}
|
|
66
|
+
static createElementLocator(face) {
|
|
67
|
+
const locator = parent => {
|
|
68
|
+
return face.text ?
|
|
69
|
+
parent.dom().contains(`aup-command-face`, face.text()) :
|
|
70
|
+
face.icon ?
|
|
71
|
+
parent.dom().find(`aup-icon[ng-reflect-icon=${face.icon()}]`).closest('aup-command-face') :
|
|
72
|
+
undefined;
|
|
73
|
+
};
|
|
74
|
+
// aot compiler doesn't like lambas
|
|
75
|
+
return locator;
|
|
131
76
|
}
|
|
132
77
|
}
|
|
133
78
|
|
|
134
79
|
class AupCommand extends PageElement {
|
|
135
|
-
constructor(parent,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
80
|
+
constructor(parent, faceOrSelector) {
|
|
81
|
+
super(parent, parentElement => {
|
|
82
|
+
if (_.isString(faceOrSelector)) {
|
|
83
|
+
return parentElement.dom().find(faceOrSelector);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return AupCommandFace.createElementLocator(faceOrSelector)(parentElement).closest('aup-command');
|
|
140
87
|
}
|
|
141
88
|
});
|
|
142
89
|
}
|
|
@@ -150,19 +97,25 @@ class AupCommand extends PageElement {
|
|
|
150
97
|
this.getButton().should('be.disabled');
|
|
151
98
|
}
|
|
152
99
|
getButton() {
|
|
153
|
-
return this.
|
|
100
|
+
return this.dom().find('button');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
class AupEmptyState extends PageElement {
|
|
105
|
+
shouldContainText(text) {
|
|
106
|
+
this.dom().should("contain.text", text);
|
|
154
107
|
}
|
|
155
108
|
}
|
|
156
109
|
|
|
157
110
|
class AupInput extends PageElement {
|
|
158
111
|
label() {
|
|
159
|
-
return this.
|
|
112
|
+
return this.dom().find('label');
|
|
160
113
|
}
|
|
161
114
|
hint() {
|
|
162
|
-
return this.
|
|
115
|
+
return this.dom().find('mat-hint');
|
|
163
116
|
}
|
|
164
117
|
error() {
|
|
165
|
-
return this.
|
|
118
|
+
return this.dom().find('mat-error');
|
|
166
119
|
}
|
|
167
120
|
get labelShould() {
|
|
168
121
|
return this.getShoulder(this.label());
|
|
@@ -182,11 +135,23 @@ class AupInput extends PageElement {
|
|
|
182
135
|
errorShouldBe(text) {
|
|
183
136
|
return this.errorShould("have.text", text);
|
|
184
137
|
}
|
|
138
|
+
shouldBeFocused() {
|
|
139
|
+
this.input().should("have.focus");
|
|
140
|
+
}
|
|
141
|
+
shouldNotBeFocused() {
|
|
142
|
+
this.input().should("not.have.focus");
|
|
143
|
+
}
|
|
144
|
+
type(characters) {
|
|
145
|
+
this.input().type(characters);
|
|
146
|
+
}
|
|
147
|
+
hitEnter() {
|
|
148
|
+
this.type("{enter}");
|
|
149
|
+
}
|
|
185
150
|
}
|
|
186
151
|
(function (AupInput) {
|
|
187
152
|
class HtmlInput extends AupInput {
|
|
188
153
|
input() {
|
|
189
|
-
return this.
|
|
154
|
+
return this.dom().find('input');
|
|
190
155
|
}
|
|
191
156
|
clear() {
|
|
192
157
|
this.input().clear();
|
|
@@ -207,7 +172,7 @@ class AupInput extends PageElement {
|
|
|
207
172
|
return this.input();
|
|
208
173
|
}
|
|
209
174
|
input() {
|
|
210
|
-
return this.
|
|
175
|
+
return this.dom().find('textarea');
|
|
211
176
|
}
|
|
212
177
|
clear() {
|
|
213
178
|
this.input().clear();
|
|
@@ -222,6 +187,46 @@ class AupInput extends PageElement {
|
|
|
222
187
|
AupInput.TextAreaInput = TextAreaInput;
|
|
223
188
|
})(AupInput || (AupInput = {}));
|
|
224
189
|
|
|
190
|
+
class AupPopupMenuPanel extends PageElement {
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
class AupAbstractPopupMenu extends PageElement {
|
|
194
|
+
constructor(parent, locator) {
|
|
195
|
+
super(parent, locator);
|
|
196
|
+
this.popup = new AupPopupMenuPanel(this, p => this.findPopupIn(p));
|
|
197
|
+
}
|
|
198
|
+
findPopupIn(p) {
|
|
199
|
+
return this.getOverlay().find('.mat-menu-panel');
|
|
200
|
+
}
|
|
201
|
+
getOverlay() {
|
|
202
|
+
return this.dom().closest('body').find('.cdk-overlay-container');
|
|
203
|
+
}
|
|
204
|
+
getBackdrop() {
|
|
205
|
+
return this.getOverlay().find('.cdk-overlay-backdrop');
|
|
206
|
+
}
|
|
207
|
+
openPopup() {
|
|
208
|
+
this.shouldNotBeOpen();
|
|
209
|
+
this.click();
|
|
210
|
+
return this.popup;
|
|
211
|
+
}
|
|
212
|
+
closePopup() {
|
|
213
|
+
this.shouldBeOpen();
|
|
214
|
+
this.getBackdrop().click();
|
|
215
|
+
}
|
|
216
|
+
shouldBeOpen() {
|
|
217
|
+
this.popup.shouldBeVisible();
|
|
218
|
+
}
|
|
219
|
+
shouldNotBeOpen() {
|
|
220
|
+
this.dom().closest('body').find('.mat-menu-panel').should("not.exist");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
class AupMoreMenu extends AupAbstractPopupMenu {
|
|
225
|
+
static create(parent, selector) {
|
|
226
|
+
return new AupMoreMenu(parent, ElementLocator.findByCssSelector(selector !== null && selector !== void 0 ? selector : 'aup-more-menu'));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
class AupNavigation extends PageElement {
|
|
226
231
|
click(label) {
|
|
227
232
|
return super.click(label);
|
|
@@ -233,123 +238,403 @@ class AupNavigation extends PageElement {
|
|
|
233
238
|
this.face(label).shouldBeVisible();
|
|
234
239
|
}
|
|
235
240
|
shouldNotHaveLink(label) {
|
|
236
|
-
this.face(label).
|
|
241
|
+
this.face(label).shouldNotExist();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
class AupTableCell extends PageElement {
|
|
246
|
+
rowId() {
|
|
247
|
+
return this.dom().closest('tr').invoke('attr', 'aup-row-id');
|
|
248
|
+
}
|
|
249
|
+
row() {
|
|
250
|
+
const self = this;
|
|
251
|
+
return this.parent.createRow(parent => {
|
|
252
|
+
return self.rowId().then(rowId => parent.dom().find(AupAbstractTable.cssSelectorForTableRowById(rowId)));
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
class AupTableColumn extends PageElement {
|
|
258
|
+
constructor(table, columnId) {
|
|
259
|
+
super(table, AupAbstractTable.cssSelectorForColumnCellRendererById(columnId));
|
|
260
|
+
this.columnId = columnId;
|
|
261
|
+
}
|
|
262
|
+
cellContaining(content) {
|
|
263
|
+
const self = this;
|
|
264
|
+
return new AupTableCell(this.parent, parent => {
|
|
265
|
+
return parent.dom().contains(AupAbstractTable.cssSelectorForColumnCellRendererById(self.columnId), content);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
rowContaining(content) {
|
|
269
|
+
return this.cellContaining(content).row();
|
|
237
270
|
}
|
|
238
271
|
}
|
|
239
272
|
|
|
240
|
-
class
|
|
241
|
-
|
|
242
|
-
super(parentElementAccessor, selector);
|
|
273
|
+
class AupTableSelectionColumn extends AupTableColumn {
|
|
274
|
+
selectAll() {
|
|
243
275
|
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
class AupAbstractTable extends PageElement {
|
|
244
279
|
row(rowId) {
|
|
245
|
-
return
|
|
280
|
+
return this.createRow(parent => {
|
|
281
|
+
return parent.dom().find(AupAbstractTable.cssSelectorForTableRowById(rowId));
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
rowNumber(rowNumber) {
|
|
285
|
+
return this.createRow(parent => {
|
|
286
|
+
return parent.dom().find(AupAbstractTable.cssSelectorForNthTableRow(rowNumber));
|
|
287
|
+
});
|
|
246
288
|
}
|
|
247
289
|
column(columnId) {
|
|
248
|
-
return new
|
|
290
|
+
return new AupTableColumn(this, columnId);
|
|
291
|
+
}
|
|
292
|
+
get selectionColumn() {
|
|
293
|
+
return new AupTableSelectionColumn(this, 'selection-column');
|
|
249
294
|
}
|
|
250
295
|
}
|
|
251
|
-
(
|
|
252
|
-
|
|
296
|
+
__decorate([
|
|
297
|
+
Memoize(),
|
|
298
|
+
__metadata("design:type", AupTableSelectionColumn),
|
|
299
|
+
__metadata("design:paramtypes", [])
|
|
300
|
+
], AupAbstractTable.prototype, "selectionColumn", null);
|
|
301
|
+
(function (AupAbstractTable) {
|
|
302
|
+
function cssSelectorForTableRowById(rowId) {
|
|
303
|
+
return `tbody tr[aup-row-id=${rowId}]`;
|
|
304
|
+
}
|
|
305
|
+
AupAbstractTable.cssSelectorForTableRowById = cssSelectorForTableRowById;
|
|
306
|
+
function cssSelectorForNthTableRow(rowNumber) {
|
|
307
|
+
return `tbody tr:nth-child(${rowNumber})`;
|
|
308
|
+
}
|
|
309
|
+
AupAbstractTable.cssSelectorForNthTableRow = cssSelectorForNthTableRow;
|
|
310
|
+
function cssSelectorForColumnCellRendererById(columnOrId) {
|
|
311
|
+
const columnId = _.isString(columnOrId) ? columnOrId : columnOrId.columnId;
|
|
312
|
+
return `aup-table-cell-renderer[column-id=${columnId}]`;
|
|
313
|
+
}
|
|
314
|
+
AupAbstractTable.cssSelectorForColumnCellRendererById = cssSelectorForColumnCellRendererById;
|
|
315
|
+
function cssSelectorForCell(rowId, columnOrId) {
|
|
316
|
+
return `${cssSelectorForTableRowById(rowId)} ${cssSelectorForColumnCellRendererById(columnOrId)}`;
|
|
317
|
+
}
|
|
318
|
+
AupAbstractTable.cssSelectorForCell = cssSelectorForCell;
|
|
319
|
+
})(AupAbstractTable || (AupAbstractTable = {}));
|
|
320
|
+
|
|
321
|
+
/* tslint:disable:unified-signatures */
|
|
322
|
+
class AupTableRow extends PageElement {
|
|
323
|
+
rowId() {
|
|
324
|
+
return this.dom()
|
|
325
|
+
.invoke('attr', 'aup-row-id');
|
|
326
|
+
}
|
|
327
|
+
shouldHaveRowId(rowId) {
|
|
328
|
+
this.rowId().should('eq', rowId);
|
|
329
|
+
}
|
|
330
|
+
cell(columnOrId) {
|
|
331
|
+
const self = this;
|
|
332
|
+
return new AupTableCell(this.parent, parent => {
|
|
333
|
+
return self.rowId()
|
|
334
|
+
.then(rowId => AupAbstractTable.cssSelectorForCell(rowId, columnOrId))
|
|
335
|
+
.then(selector => parent.dom().find(selector));
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
shouldBeSelected() {
|
|
339
|
+
this.dom().should('have.class', 'aup-row-selected');
|
|
340
|
+
}
|
|
341
|
+
shouldNotBeSelected() {
|
|
342
|
+
this.dom().should('not.have.class', 'aup-row-selected');
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
class AupTable extends AupAbstractTable {
|
|
347
|
+
createRow(locator) {
|
|
348
|
+
return new AupTableRow(this, locator);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
class AupTreeTable extends AupAbstractTable {
|
|
353
|
+
get treeControlColumn() {
|
|
354
|
+
return new AupTreeTable.TreeControlColumn(this, 'tree-label');
|
|
355
|
+
}
|
|
356
|
+
createRow(locator) {
|
|
357
|
+
return new AupTreeTable.Row(this, locator);
|
|
253
358
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
359
|
+
}
|
|
360
|
+
__decorate([
|
|
361
|
+
Memoize(),
|
|
362
|
+
__metadata("design:type", AupTreeTable.TreeControlColumn),
|
|
363
|
+
__metadata("design:paramtypes", [])
|
|
364
|
+
], AupTreeTable.prototype, "treeControlColumn", null);
|
|
365
|
+
(function (AupTreeTable) {
|
|
366
|
+
class Row extends AupTableRow {
|
|
367
|
+
shouldBeExpanded() {
|
|
368
|
+
this.dom().should("not.have.class", "aup-node-collapsed");
|
|
259
369
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return new Cell(this.table, {
|
|
263
|
-
findIn(parent) {
|
|
264
|
-
return parent.contains(`aup-table-cell-renderer[column-id=${self.columnId}]`, content);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
370
|
+
shouldBeCollapsed() {
|
|
371
|
+
this.dom().should("have.class", "aup-node-collapsed");
|
|
267
372
|
}
|
|
268
373
|
}
|
|
269
|
-
|
|
270
|
-
class
|
|
374
|
+
AupTreeTable.Row = Row;
|
|
375
|
+
class TreeControlColumn extends AupTableColumn {
|
|
271
376
|
}
|
|
272
|
-
|
|
273
|
-
})(
|
|
377
|
+
AupTreeTable.TreeControlColumn = TreeControlColumn;
|
|
378
|
+
})(AupTreeTable || (AupTreeTable = {}));
|
|
274
379
|
|
|
275
|
-
function
|
|
380
|
+
function FormElementMixin(Base) {
|
|
276
381
|
return class extends Base {
|
|
277
382
|
constructor(...args) {
|
|
278
383
|
super(...args);
|
|
279
384
|
}
|
|
280
|
-
click() {
|
|
281
|
-
return this.element().click();
|
|
282
|
-
}
|
|
283
385
|
shouldBeDisabled() {
|
|
284
386
|
this.should("be.disabled");
|
|
285
|
-
// this.should("have.css", "color", "rgba(0,0,0,0.26)")
|
|
286
387
|
}
|
|
287
388
|
};
|
|
288
389
|
}
|
|
289
390
|
|
|
290
|
-
class Button extends
|
|
391
|
+
class Button extends FormElementMixin(PageElement) {
|
|
291
392
|
constructor(parentElementAccessor, buttonText) {
|
|
292
|
-
super(parentElementAccessor,
|
|
293
|
-
findIn(parent) {
|
|
294
|
-
return parent.contains('button', buttonText);
|
|
295
|
-
},
|
|
296
|
-
shouldNotExist(parent) {
|
|
297
|
-
return parent.should('not.contain', buttonText);
|
|
298
|
-
}
|
|
299
|
-
});
|
|
393
|
+
super(parentElementAccessor, ElementLocator.findBySelectorAndTextContent('button', buttonText));
|
|
300
394
|
}
|
|
301
395
|
}
|
|
302
396
|
|
|
303
|
-
|
|
304
|
-
(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return new Button(() => this.element(), text);
|
|
322
|
-
}
|
|
323
|
-
aupStringInput(selector) {
|
|
324
|
-
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
325
|
-
}
|
|
326
|
-
aupTextInput(selector) {
|
|
327
|
-
return new AupInput.TextAreaInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
328
|
-
}
|
|
329
|
-
aupPasswordInput(selector) {
|
|
330
|
-
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
331
|
-
}
|
|
332
|
-
aupNumberInput(selector) {
|
|
333
|
-
return new AupInput.HtmlInput(() => this.element(), selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
334
|
-
}
|
|
335
|
-
aupCommand(face) {
|
|
336
|
-
return new AupCommand(this, face);
|
|
337
|
-
}
|
|
338
|
-
aupTabbedNavigation() {
|
|
339
|
-
return new AupNavigation(this, 'aup-tabbed-place-navigation');
|
|
397
|
+
class MatCheckbox extends FormElementMixin(PageElement) {
|
|
398
|
+
constructor(parentElementAccessor, text) {
|
|
399
|
+
super(parentElementAccessor, ElementLocator.findBySelectorAndTextContent('mat-checkbox', text));
|
|
400
|
+
}
|
|
401
|
+
shouldBeChecked() {
|
|
402
|
+
this.hiddenCheckBoxElement().should('be.checked');
|
|
403
|
+
}
|
|
404
|
+
shouldNotBeChecked() {
|
|
405
|
+
this.hiddenCheckBoxElement().should('not.be.checked');
|
|
406
|
+
}
|
|
407
|
+
hiddenCheckBoxElement() {
|
|
408
|
+
return this.dom().find('input[type=checkbox]');
|
|
409
|
+
}
|
|
410
|
+
check() {
|
|
411
|
+
this.hiddenCheckBoxElement().then(el => {
|
|
412
|
+
if (!el.prop('checked')) {
|
|
413
|
+
this.click();
|
|
414
|
+
this.shouldBeChecked();
|
|
340
415
|
}
|
|
341
|
-
|
|
342
|
-
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
uncheck() {
|
|
419
|
+
this.hiddenCheckBoxElement().then(el => {
|
|
420
|
+
if (el.prop('checked')) {
|
|
421
|
+
this.click();
|
|
422
|
+
this.shouldNotBeChecked();
|
|
343
423
|
}
|
|
344
|
-
|
|
345
|
-
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
class Builder {
|
|
429
|
+
constructor(parentPageElement) {
|
|
430
|
+
this.parentPageElement = parentPageElement;
|
|
431
|
+
}
|
|
432
|
+
find(selector) {
|
|
433
|
+
return new PageElement(this.parentPageElement, selector);
|
|
434
|
+
}
|
|
435
|
+
section(selector, builder) {
|
|
436
|
+
return this.createContainerElement(PageElement, selector, builder);
|
|
437
|
+
}
|
|
438
|
+
contains(text) {
|
|
439
|
+
return new PageElement(this.parentPageElement, ElementLocator.findByTextContent(text));
|
|
440
|
+
}
|
|
441
|
+
button(text) {
|
|
442
|
+
return new Button(this.parentPageElement, text);
|
|
443
|
+
}
|
|
444
|
+
matCheckbox(text) {
|
|
445
|
+
return new MatCheckbox(this.parentPageElement, text);
|
|
446
|
+
}
|
|
447
|
+
aupStringInput(selector) {
|
|
448
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
449
|
+
}
|
|
450
|
+
aupTextInput(selector) {
|
|
451
|
+
return new AupInput.TextAreaInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
452
|
+
}
|
|
453
|
+
aupPasswordInput(selector) {
|
|
454
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
455
|
+
}
|
|
456
|
+
aupNumberInput(selector) {
|
|
457
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
458
|
+
}
|
|
459
|
+
aupCommand(faceOrSelector) {
|
|
460
|
+
return new AupCommand(this.parentPageElement, faceOrSelector);
|
|
461
|
+
}
|
|
462
|
+
aupTabbedNavigation() {
|
|
463
|
+
return new AupNavigation(this.parentPageElement, 'aup-tabbed-place-navigation');
|
|
464
|
+
}
|
|
465
|
+
aupSideNavigation() {
|
|
466
|
+
return new AupNavigation(this.parentPageElement, 'aup-list-place-nav');
|
|
467
|
+
}
|
|
468
|
+
aupMoreMenu(selector) {
|
|
469
|
+
return AupMoreMenu.create(this.parentPageElement, selector);
|
|
470
|
+
}
|
|
471
|
+
aupTable(selectorOrBuilder, optionalBuilder) {
|
|
472
|
+
return this.createContainerElement(AupTable, selectorOrBuilder, optionalBuilder, 'aup-table');
|
|
473
|
+
}
|
|
474
|
+
aupTreeTable(selectorOrBuilder, optionalBuilder) {
|
|
475
|
+
return this.createContainerElement(AupTreeTable, selectorOrBuilder, optionalBuilder, 'aup-tree-table');
|
|
476
|
+
}
|
|
477
|
+
aupEmptyState(selectorOrBuilder, optionalBuilder) {
|
|
478
|
+
return this.createContainerElement(AupEmptyState, selectorOrBuilder, optionalBuilder, 'aup-empty-state');
|
|
479
|
+
}
|
|
480
|
+
// TODO: use this in all the element factory methods to allow customisation
|
|
481
|
+
createElement(klass, selectorOrBuilder, optionalBuilder, defaultSelector) {
|
|
482
|
+
const selector = _.isString(selectorOrBuilder) ? selectorOrBuilder : defaultSelector;
|
|
483
|
+
const builder = _.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
|
|
484
|
+
if (!selector) {
|
|
485
|
+
lang.illegalState('This element requires a selector but none was provided');
|
|
486
|
+
}
|
|
487
|
+
const element = new klass(this.parentPageElement, selector);
|
|
488
|
+
if (builder) {
|
|
489
|
+
return Mixin.createProxy(element, builder(element));
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
return element;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
createContainerElement(klass, selectorOrBuilder, optionalBuilder, defaultSelector) {
|
|
496
|
+
const selector = _.isString(selectorOrBuilder) ? selectorOrBuilder : defaultSelector;
|
|
497
|
+
const builder = _.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
|
|
498
|
+
if (!selector) {
|
|
499
|
+
lang.illegalState('This element requires a selector but none was provided');
|
|
500
|
+
}
|
|
501
|
+
const element = new klass(this.parentPageElement, selector);
|
|
502
|
+
if (builder) {
|
|
503
|
+
// create the B&E type that the builder has access to
|
|
504
|
+
const decoratedElement = Mixin.createProxy(element, new Builder(element));
|
|
505
|
+
// create final type that has the E & T type
|
|
506
|
+
return Mixin.createProxy(decoratedElement, builder(decoratedElement));
|
|
507
|
+
}
|
|
508
|
+
else {
|
|
509
|
+
return element;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
class AupAbstractActivity extends PageElement {
|
|
515
|
+
constructor(parent, selector) {
|
|
516
|
+
// @ts-ignore
|
|
517
|
+
super(parent, selector);
|
|
518
|
+
this.title = this.find('aup-activity-title');
|
|
519
|
+
this._confirmCommand = new Builder(this).aupCommand('[data-cy=confirm-command]');
|
|
520
|
+
this._cancelCommand = new Builder(this).aupCommand('[data-cy=cancel-command]');
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
class AupActivity extends AupAbstractActivity {
|
|
525
|
+
constructor(parent, selector) {
|
|
526
|
+
super(parent, selector);
|
|
527
|
+
}
|
|
528
|
+
get confirmCommand() {
|
|
529
|
+
return this._confirmCommand;
|
|
530
|
+
}
|
|
531
|
+
get cancelCommand() {
|
|
532
|
+
return this._cancelCommand;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
class AupModalActivity extends AupActivity {
|
|
537
|
+
clickBackdrop() {
|
|
538
|
+
this.dom().closest(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
class AupAlert extends AupAbstractActivity {
|
|
543
|
+
constructor(parent, selector) {
|
|
544
|
+
super(parent, selector);
|
|
545
|
+
}
|
|
546
|
+
get closeCommand() {
|
|
547
|
+
return this._confirmCommand;
|
|
548
|
+
}
|
|
549
|
+
clickClose() {
|
|
550
|
+
this.closeCommand.click();
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
class AupModalAlert extends AupAlert {
|
|
555
|
+
constructor(parent, selector) {
|
|
556
|
+
super(parent, selector);
|
|
557
|
+
}
|
|
558
|
+
clickBackdrop() {
|
|
559
|
+
this.dom()
|
|
560
|
+
.closest(`.cdk-overlay-container`)
|
|
561
|
+
.find(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
class PageBuilder extends Builder {
|
|
566
|
+
aupModalActivity(selector, builder) {
|
|
567
|
+
return this.createContainerElement(AupModalActivity, `.dialog-interaction-context ${selector}`, builder);
|
|
568
|
+
}
|
|
569
|
+
aupModalAlert(builder) {
|
|
570
|
+
return this.createContainerElement(AupModalAlert, `.dialog-interaction-context aup-alert-dialog`, builder);
|
|
571
|
+
}
|
|
572
|
+
aupModelConfirm(builder) {
|
|
573
|
+
return this.aupModalActivity(`aup-confirm-dialog`, builder);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
let urlSerialiser = new DefaultUrlSerializer();
|
|
578
|
+
class Path {
|
|
579
|
+
constructor(segments) {
|
|
580
|
+
this.segments = segments;
|
|
581
|
+
}
|
|
582
|
+
static extractVisitParameters(url) {
|
|
583
|
+
var _a, _b;
|
|
584
|
+
let result = {};
|
|
585
|
+
const urlTree = urlSerialiser.parse(url);
|
|
586
|
+
const urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
|
|
587
|
+
urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(s => {
|
|
588
|
+
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
589
|
+
});
|
|
590
|
+
return result;
|
|
591
|
+
}
|
|
592
|
+
toUrl(matrixParams) {
|
|
593
|
+
return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
(function (Path) {
|
|
597
|
+
function setUrlSerialiser(serialiser) {
|
|
598
|
+
urlSerialiser = serialiser;
|
|
599
|
+
}
|
|
600
|
+
Path.setUrlSerialiser = setUrlSerialiser;
|
|
601
|
+
class Segment {
|
|
602
|
+
constructor(path, params = {}) {
|
|
603
|
+
var _a;
|
|
604
|
+
this.path = path;
|
|
605
|
+
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
606
|
+
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
607
|
+
}
|
|
608
|
+
toUrlPart(params) {
|
|
609
|
+
let path = this.path;
|
|
610
|
+
this.visitParams.forEach(p => {
|
|
611
|
+
const value = params[p];
|
|
612
|
+
if (value) {
|
|
613
|
+
path = `${path};${p}=${value}`;
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
if (this.routeId && params[this.routeId]) {
|
|
617
|
+
path = path + '/' + params[this.routeId];
|
|
346
618
|
}
|
|
347
|
-
|
|
619
|
+
return path;
|
|
620
|
+
}
|
|
348
621
|
}
|
|
349
|
-
|
|
350
|
-
class
|
|
622
|
+
Path.Segment = Segment;
|
|
623
|
+
class Builder {
|
|
624
|
+
constructor() {
|
|
625
|
+
this.segments = [];
|
|
626
|
+
}
|
|
627
|
+
segment(name, params) {
|
|
628
|
+
const builder = new Segment(name, params);
|
|
629
|
+
this.segments.push(builder);
|
|
630
|
+
return this;
|
|
631
|
+
}
|
|
632
|
+
getPath() {
|
|
633
|
+
return new Path(this.segments);
|
|
634
|
+
}
|
|
351
635
|
}
|
|
352
|
-
|
|
636
|
+
Path.Builder = Builder;
|
|
637
|
+
})(Path || (Path = {}));
|
|
353
638
|
|
|
354
639
|
class Page extends PageElement {
|
|
355
640
|
constructor(path) {
|
|
@@ -357,7 +642,7 @@ class Page extends PageElement {
|
|
|
357
642
|
this.path = path;
|
|
358
643
|
this.rootElementSelector = 'body';
|
|
359
644
|
}
|
|
360
|
-
|
|
645
|
+
dom() {
|
|
361
646
|
return cy.get(this.rootElementSelector);
|
|
362
647
|
}
|
|
363
648
|
visit(visitParams, queryParams) {
|
|
@@ -380,7 +665,7 @@ class Page extends PageElement {
|
|
|
380
665
|
}
|
|
381
666
|
shouldBeActive(withParameters) {
|
|
382
667
|
// Note: cy.window() doesn't return a promise... it's a chainable.
|
|
383
|
-
cy[
|
|
668
|
+
cy['waitUntil'](() => {
|
|
384
669
|
return cy.window().then(window => {
|
|
385
670
|
return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
|
|
386
671
|
});
|
|
@@ -398,53 +683,43 @@ class Page extends PageElement {
|
|
|
398
683
|
}
|
|
399
684
|
}
|
|
400
685
|
(function (Page) {
|
|
401
|
-
function create(pathOrPathBuilder,
|
|
686
|
+
function create(pathOrPathBuilder, builder) {
|
|
402
687
|
const pathBuilder = new Path.Builder();
|
|
403
688
|
if (_.isString(pathOrPathBuilder)) {
|
|
404
|
-
pathOrPathBuilder.split(
|
|
689
|
+
pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
|
|
405
690
|
}
|
|
406
691
|
else {
|
|
407
692
|
pathOrPathBuilder(pathBuilder);
|
|
408
693
|
}
|
|
409
|
-
const
|
|
410
|
-
|
|
694
|
+
const instance = new Page(pathBuilder.getPath());
|
|
695
|
+
const content = builder.call(instance, new PageBuilder(instance));
|
|
696
|
+
return Mixin.createProxy(content, instance);
|
|
411
697
|
}
|
|
412
698
|
Page.create = create;
|
|
413
|
-
class PageBuilder extends Section.Mixin(Page) {
|
|
414
|
-
}
|
|
415
|
-
Page.PageBuilder = PageBuilder;
|
|
416
699
|
})(Page || (Page = {}));
|
|
417
700
|
|
|
418
701
|
class AupCommandGroup extends PageElement {
|
|
419
702
|
}
|
|
420
703
|
|
|
421
|
-
class
|
|
422
|
-
static create(parent) {
|
|
423
|
-
|
|
704
|
+
class AupToolBar extends PageElement {
|
|
705
|
+
static create(parent, face) {
|
|
706
|
+
// const findFace = AupCommandFace.createFinder(() => parent.element(), face)
|
|
707
|
+
// return new AupCommandGroup(() => findFace().closest('button'));
|
|
424
708
|
}
|
|
425
709
|
}
|
|
426
710
|
|
|
427
|
-
class AupPopupMenu extends
|
|
711
|
+
class AupPopupMenu extends AupAbstractPopupMenu {
|
|
428
712
|
constructor(parentElementAccessor, face) {
|
|
429
|
-
const
|
|
430
|
-
super(parentElementAccessor,
|
|
431
|
-
findIn(parent) {
|
|
432
|
-
return accessor.findIn(parent).closest('button');
|
|
433
|
-
},
|
|
434
|
-
shouldNotExist(parent) {
|
|
435
|
-
accessor.shouldNotExist(parent);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
713
|
+
const locator = AupCommandFace.createElementLocator(face);
|
|
714
|
+
super(parentElementAccessor, parent => locator(parent).closest('button'));
|
|
438
715
|
}
|
|
439
716
|
static create(parent, face) {
|
|
440
717
|
return new AupPopupMenu(parent, face);
|
|
441
718
|
}
|
|
442
719
|
}
|
|
443
720
|
|
|
444
|
-
class
|
|
445
|
-
|
|
446
|
-
// const findFace = AupCommandFace.createFinder(() => parent.element(), face)
|
|
447
|
-
// return new AupCommandGroup(() => findFace().closest('button'));
|
|
721
|
+
class AupTableSelectionCell extends AupTableCell {
|
|
722
|
+
selectAll() {
|
|
448
723
|
}
|
|
449
724
|
}
|
|
450
725
|
|
|
@@ -456,5 +731,5 @@ class AupToolBar extends PageElement {
|
|
|
456
731
|
* Generated bundle index. Do not edit.
|
|
457
732
|
*/
|
|
458
733
|
|
|
459
|
-
export { AupCommand, AupCommandFace, AupCommandGroup, AupInput, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Button,
|
|
734
|
+
export { AupAbstractActivity, AupAbstractPopupMenu, AupAbstractTable, AupActivity, AupAlert, AupCommand, AupCommandFace, AupCommandGroup, AupEmptyState, AupInput, AupModalActivity, AupModalAlert, AupMoreMenu, AupNavigation, AupPopupMenu, AupPopupMenuPanel, AupTable, AupTableCell, AupTableColumn, AupTableRow, AupTableSelectionCell, AupTableSelectionColumn, AupToolBar, AupTreeTable, Builder, Button, ElementLocator, FormElementMixin, MatCheckbox, Page, PageBuilder, PageElement, Path };
|
|
460
735
|
//# sourceMappingURL=coolon-angular-ui-powerups-cypress.js.map
|