@coolon/angular-ui-powerups 12.4.0-alpha.16 → 12.4.0-alpha.18
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/bundles/coolon-angular-ui-powerups-cypress.umd.js +244 -93
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/cypress/builder.d.ts +7 -2
- package/cypress/components/aup-abstract-activity.d.ts +2 -1
- package/cypress/components/aup-activity.d.ts +2 -1
- package/cypress/components/aup-alert.d.ts +2 -1
- package/cypress/components/aup-command-face.d.ts +5 -4
- package/cypress/components/aup-command.d.ts +1 -1
- package/cypress/components/aup-input.d.ts +2 -0
- package/cypress/components/aup-modal-alert.d.ts +2 -1
- package/cypress/components/aup-popup-menu.d.ts +1 -2
- package/cypress/components/aup-table.d.ts +30 -3
- package/cypress/components/button.d.ts +8 -6
- package/cypress/components/{button-mixin.d.ts → form-element-mixin.d.ts} +7 -6
- package/cypress/components/mat-checkbox.d.ts +29 -0
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/element-locator.d.ts +10 -0
- package/cypress/exports.d.ts +3 -1
- package/cypress/page-element.d.ts +8 -10
- package/cypress/page.d.ts +1 -1
- package/esm2015/cypress/builder.js +26 -18
- package/esm2015/cypress/builder.js.map +1 -1
- package/esm2015/cypress/builder.metadata.json +1 -1
- package/esm2015/cypress/components/aup-abstract-activity.js +1 -0
- package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -1
- package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -1
- package/esm2015/cypress/components/aup-activity.js.map +1 -1
- package/esm2015/cypress/components/aup-activity.metadata.json +1 -1
- package/esm2015/cypress/components/aup-alert.js.map +1 -1
- package/esm2015/cypress/components/aup-alert.metadata.json +1 -1
- package/esm2015/cypress/components/aup-command-face.js +6 -6
- 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 +3 -3
- 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 +1 -1
- package/esm2015/cypress/components/aup-empty-state.js.map +1 -1
- package/esm2015/cypress/components/aup-input.js +11 -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 +1 -1
- package/esm2015/cypress/components/aup-modal-activity.js.map +1 -1
- package/esm2015/cypress/components/aup-modal-alert.js +1 -1
- package/esm2015/cypress/components/aup-modal-alert.js.map +1 -1
- package/esm2015/cypress/components/aup-modal-alert.metadata.json +1 -1
- package/esm2015/cypress/components/aup-navigation.js +1 -1
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.js +3 -3
- package/esm2015/cypress/components/aup-popup-menu.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.metadata.json +1 -1
- package/esm2015/cypress/components/aup-table.js +85 -7
- 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 +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/element-locator.js +22 -0
- package/esm2015/cypress/element-locator.js.map +1 -0
- package/esm2015/cypress/element-locator.metadata.json +1 -0
- package/esm2015/cypress/exports.js +3 -1
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-element.js +21 -18
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +1 -1
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups-cypress.js +213 -77
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/package.json +1 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,OAAO,IAAK,SAAQ,WAAW;IAInC,YAAqB,IAAU;QAC7B,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QADT,SAAI,GAAJ,IAAI,CAAM;QAFrB,wBAAmB,GAAG,MAAM,CAAC;IAIvC,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/cypress/src/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA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AAC,CAAC,CAAC,CAAC;SAC9F;aAAM;YACL,iBAAiB,CAAC,WAAW,CAAC,CAAC;SAChC;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAa,CAAC;IAC1D,CAAC;IAVe,WAAM,SAUrB,CAAA;AACH,CAAC,EAhBgB,IAAI,KAAJ,IAAI,QAgBpB","sourcesContent":["import { Mixin } from '@coolon/typescript-utilities';\nimport * as _ from 'lodash';\nimport { Builder } from './builder';\nimport { PageBuilder } from './page-builder';\nimport { PageElement } from './page-element';\nimport { Path } from './path';\n\nexport class Page extends PageElement {\n\n protected rootElementSelector = 'body';\n\n constructor(readonly path: Path) {\n super(undefined, undefined);\n }\n\n dom(): Cypress.Chainable<JQuery<HTMLElement>> {\n return cy.get(this.rootElementSelector);\n }\n\n visit(visitParams?: object, queryParams?: { [key: string]: string }) {\n this.tryAndVisit(visitParams, queryParams);\n this.shouldBeActive(visitParams);\n }\n\n tryAndVisit(params?: object, queryParams?: { [key: string]: string }) {\n const path = this.path.toUrl(params ?? {});\n const queryString = queryParams ? `?${new URLSearchParams(queryParams).toString()}` : '';\n cy.visit(`/${path}${queryString}`);\n }\n\n shouldHaveActivityIds(...ids: string[]) {\n cy.location('search').should('contain', `?aup-interactions=${ids.join('--')}`);\n }\n\n shouldNotHaveActivityIds() {\n cy.location('search').should('not.contain', `?aup-interactions`);\n }\n\n shouldHaveTitle(title: string) {\n cy.title().should('eq', title);\n }\n\n shouldBeActive(withParameters?: object) {\n // Note: cy.window() doesn't return a promise... it's a chainable.\n cy['waitUntil'](() => {\n return cy.window().then(window => {\n return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();\n });\n });\n\n if (withParameters) {\n cy.location('pathname').then(path => {\n const urlParams = Path.extractVisitParameters(path);\n Object.keys(withParameters).forEach(param => {\n const expected = withParameters[param];\n // @ts-ignore\n expect(urlParams[param]).to.equal(expected);\n });\n });\n }\n }\n\n}\n\n\nexport namespace Page {\n\n export function create<T extends object>(path: string, builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page\n // tslint:disable-next-line:unified-signatures\n export function create<T extends object>(pathBuilder: ((pathBuilder: Path.Builder) => void), builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page\n export function create<T extends object>(pathOrPathBuilder: string | ((pathBuilder: Path.Builder) => void), builder: Builder.ContainerCallback<T, Page, PageBuilder>): T & Page {\n const pathBuilder = new Path.Builder();\n if (_.isString(pathOrPathBuilder)) {\n pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));\n } else {\n pathOrPathBuilder(pathBuilder);\n }\n const instance = new Page(pathBuilder.getPath());\n const content = builder.call(instance, new PageBuilder(instance));\n return Mixin.createProxy(content, instance) as T & Page;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"Page":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./page-element","name":"PageElement","line":7,"character":26},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./path","name":"Path","line":11,"character":29}]}],"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"Page":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./page-element","name":"PageElement","line":7,"character":26},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./path","name":"Path","line":11,"character":29}]}],"dom":[{"__symbolic":"method"}],"visit":[{"__symbolic":"method"}],"tryAndVisit":[{"__symbolic":"method"}],"shouldHaveActivityIds":[{"__symbolic":"method"}],"shouldNotHaveActivityIds":[{"__symbolic":"method"}],"shouldHaveTitle":[{"__symbolic":"method"}],"shouldBeActive":[{"__symbolic":"method"}]}}}}]
|
|
@@ -2,26 +2,43 @@ import { lang, Mixin } from '@coolon/typescript-utilities';
|
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
3
|
import { DefaultUrlSerializer } from '@angular/router';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
findIn:
|
|
10
|
-
shouldNotExist: (p) => p.find(selector).should('not.exist')
|
|
11
|
-
}
|
|
5
|
+
var ElementLocator;
|
|
6
|
+
(function (ElementLocator) {
|
|
7
|
+
function findByCssSelector(selector) {
|
|
8
|
+
return {
|
|
9
|
+
findIn: parent => parent.dom().find(selector),
|
|
10
|
+
shouldNotExist: (p) => p.dom().find(selector).should('not.exist')
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
ElementLocator.findByCssSelector = findByCssSelector;
|
|
14
|
+
function findByTextContent(selector, text) {
|
|
15
|
+
return {
|
|
16
|
+
findIn(parent) {
|
|
17
|
+
return parent.dom().contains(selector, text);
|
|
18
|
+
},
|
|
19
|
+
shouldNotExist(parent) {
|
|
20
|
+
return parent.dom().should('not.contain', text);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
12
23
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
24
|
+
ElementLocator.findByTextContent = findByTextContent;
|
|
25
|
+
})(ElementLocator || (ElementLocator = {}));
|
|
26
|
+
|
|
27
|
+
class PageElement {
|
|
28
|
+
constructor(parent, selectorOrLocator) {
|
|
29
|
+
this.parent = parent;
|
|
30
|
+
this.elementAccessStrategy = _.isString(selectorOrLocator) ?
|
|
31
|
+
ElementLocator.findByCssSelector(selectorOrLocator) :
|
|
32
|
+
selectorOrLocator;
|
|
16
33
|
}
|
|
17
|
-
|
|
18
|
-
return this.
|
|
34
|
+
dom() {
|
|
35
|
+
return this.elementAccessStrategy.findIn(this.parent);
|
|
19
36
|
}
|
|
20
37
|
find(selector) {
|
|
21
|
-
return new PageElement(
|
|
38
|
+
return new PageElement(this, selector);
|
|
22
39
|
}
|
|
23
40
|
click(text) {
|
|
24
|
-
text ? this.
|
|
41
|
+
text ? this.dom().contains(text).click() : this.dom().click();
|
|
25
42
|
}
|
|
26
43
|
get should() {
|
|
27
44
|
return this.getShoulder(this.getShouldElement());
|
|
@@ -30,28 +47,36 @@ class PageElement {
|
|
|
30
47
|
return element.should.bind(element);
|
|
31
48
|
}
|
|
32
49
|
getShouldElement() {
|
|
33
|
-
return this.
|
|
50
|
+
return this.dom();
|
|
34
51
|
}
|
|
35
52
|
shouldBeVisible() {
|
|
36
53
|
this.should('be.visible');
|
|
37
54
|
}
|
|
38
55
|
shouldNotBeVisible() {
|
|
56
|
+
this.should('not.be.visible');
|
|
57
|
+
}
|
|
58
|
+
shouldExist() {
|
|
59
|
+
this.dom().should('exist');
|
|
60
|
+
}
|
|
61
|
+
shouldNotExist() {
|
|
39
62
|
if (!this.elementAccessStrategy.shouldNotExist) {
|
|
40
|
-
|
|
63
|
+
this.dom().should("not.exist");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.elementAccessStrategy.shouldNotExist(this.parent);
|
|
41
67
|
}
|
|
42
|
-
this.elementAccessStrategy.shouldNotExist(this.getParentElement());
|
|
43
68
|
}
|
|
44
69
|
}
|
|
45
70
|
|
|
46
|
-
class
|
|
71
|
+
class FaceElementLocator {
|
|
47
72
|
constructor(face) {
|
|
48
73
|
this.face = face;
|
|
49
74
|
}
|
|
50
75
|
findIn(parent) {
|
|
51
76
|
return this.face.text ?
|
|
52
|
-
parent.contains(`aup-command-face`, this.face.text()) :
|
|
77
|
+
parent.dom().contains(`aup-command-face`, this.face.text()) :
|
|
53
78
|
this.face.icon ?
|
|
54
|
-
parent.find(`aup-icon[ng-reflect-icon=${this.face.icon()}]`).closest('aup-command-face') :
|
|
79
|
+
parent.dom().find(`aup-icon[ng-reflect-icon=${this.face.icon()}]`).closest('aup-command-face') :
|
|
55
80
|
undefined;
|
|
56
81
|
}
|
|
57
82
|
shouldNotExist(parent) {
|
|
@@ -64,10 +89,10 @@ class FaceAccessor {
|
|
|
64
89
|
}
|
|
65
90
|
class AupCommandFace extends PageElement {
|
|
66
91
|
constructor(parentElement, face) {
|
|
67
|
-
super(
|
|
92
|
+
super(parentElement, AupCommandFace.createElementLocator(face));
|
|
68
93
|
}
|
|
69
|
-
static
|
|
70
|
-
return new
|
|
94
|
+
static createElementLocator(face) {
|
|
95
|
+
return new FaceElementLocator(face);
|
|
71
96
|
}
|
|
72
97
|
}
|
|
73
98
|
|
|
@@ -76,10 +101,10 @@ class AupCommand extends PageElement {
|
|
|
76
101
|
super(parent, {
|
|
77
102
|
findIn(parentElement) {
|
|
78
103
|
if (_.isString(faceOrSelector)) {
|
|
79
|
-
return parentElement.find(faceOrSelector);
|
|
104
|
+
return parentElement.dom().find(faceOrSelector);
|
|
80
105
|
}
|
|
81
106
|
else {
|
|
82
|
-
return AupCommandFace.
|
|
107
|
+
return AupCommandFace.createElementLocator(faceOrSelector).findIn(parentElement).closest('aup-command');
|
|
83
108
|
}
|
|
84
109
|
},
|
|
85
110
|
shouldNotExist(parentElement) {
|
|
@@ -97,25 +122,25 @@ class AupCommand extends PageElement {
|
|
|
97
122
|
this.getButton().should('be.disabled');
|
|
98
123
|
}
|
|
99
124
|
getButton() {
|
|
100
|
-
return this.
|
|
125
|
+
return this.dom().find('button');
|
|
101
126
|
}
|
|
102
127
|
}
|
|
103
128
|
|
|
104
129
|
class AupEmptyState extends PageElement {
|
|
105
130
|
shouldContainText(text) {
|
|
106
|
-
this.
|
|
131
|
+
this.dom().should("contain.text", text);
|
|
107
132
|
}
|
|
108
133
|
}
|
|
109
134
|
|
|
110
135
|
class AupInput extends PageElement {
|
|
111
136
|
label() {
|
|
112
|
-
return this.
|
|
137
|
+
return this.dom().find('label');
|
|
113
138
|
}
|
|
114
139
|
hint() {
|
|
115
|
-
return this.
|
|
140
|
+
return this.dom().find('mat-hint');
|
|
116
141
|
}
|
|
117
142
|
error() {
|
|
118
|
-
return this.
|
|
143
|
+
return this.dom().find('mat-error');
|
|
119
144
|
}
|
|
120
145
|
get labelShould() {
|
|
121
146
|
return this.getShoulder(this.label());
|
|
@@ -141,11 +166,17 @@ class AupInput extends PageElement {
|
|
|
141
166
|
shouldNotBeFocused() {
|
|
142
167
|
this.input().should("not.have.focus");
|
|
143
168
|
}
|
|
169
|
+
type(characters) {
|
|
170
|
+
this.input().type(characters);
|
|
171
|
+
}
|
|
172
|
+
hitEnter() {
|
|
173
|
+
this.type("{enter}");
|
|
174
|
+
}
|
|
144
175
|
}
|
|
145
176
|
(function (AupInput) {
|
|
146
177
|
class HtmlInput extends AupInput {
|
|
147
178
|
input() {
|
|
148
|
-
return this.
|
|
179
|
+
return this.dom().find('input');
|
|
149
180
|
}
|
|
150
181
|
clear() {
|
|
151
182
|
this.input().clear();
|
|
@@ -166,7 +197,7 @@ class AupInput extends PageElement {
|
|
|
166
197
|
return this.input();
|
|
167
198
|
}
|
|
168
199
|
input() {
|
|
169
|
-
return this.
|
|
200
|
+
return this.dom().find('textarea');
|
|
170
201
|
}
|
|
171
202
|
clear() {
|
|
172
203
|
this.input().clear();
|
|
@@ -192,115 +223,219 @@ class AupNavigation extends PageElement {
|
|
|
192
223
|
this.face(label).shouldBeVisible();
|
|
193
224
|
}
|
|
194
225
|
shouldNotHaveLink(label) {
|
|
195
|
-
this.face(label).
|
|
226
|
+
this.face(label).shouldNotExist();
|
|
196
227
|
}
|
|
197
228
|
}
|
|
198
229
|
|
|
230
|
+
/* tslint:disable:unified-signatures */
|
|
199
231
|
class AupTable extends PageElement {
|
|
200
|
-
constructor(parentElementAccessor, selector) {
|
|
201
|
-
super(parentElementAccessor, selector);
|
|
202
|
-
}
|
|
203
232
|
row(rowId) {
|
|
204
|
-
return new AupTable.Row(
|
|
233
|
+
return new AupTable.Row(this, AupTable.cssSelectorForTableRowById(rowId));
|
|
234
|
+
}
|
|
235
|
+
rowNumber(rowNumber) {
|
|
236
|
+
return new AupTable.Row(this, AupTable.cssSelectorForNthTableRow(rowNumber));
|
|
205
237
|
}
|
|
206
238
|
column(columnId) {
|
|
207
239
|
return new AupTable.Column(this, columnId);
|
|
208
240
|
}
|
|
241
|
+
selectionColumn() {
|
|
242
|
+
return new AupTable.SelectionColumn(this, 'selection-column');
|
|
243
|
+
}
|
|
209
244
|
}
|
|
210
245
|
(function (AupTable) {
|
|
246
|
+
function cssSelectorForTableRowById(rowId) {
|
|
247
|
+
return `tbody tr[aup-row-id=${rowId}]`;
|
|
248
|
+
}
|
|
249
|
+
AupTable.cssSelectorForTableRowById = cssSelectorForTableRowById;
|
|
250
|
+
function cssSelectorForNthTableRow(rowNumber) {
|
|
251
|
+
return `tbody tr:nth-child(${rowNumber})`;
|
|
252
|
+
}
|
|
253
|
+
AupTable.cssSelectorForNthTableRow = cssSelectorForNthTableRow;
|
|
254
|
+
function cssSelectorForColumnCellRendererById(columnId) {
|
|
255
|
+
return `aup-table-cell-renderer[column-id=${columnId}]`;
|
|
256
|
+
}
|
|
257
|
+
AupTable.cssSelectorForColumnCellRendererById = cssSelectorForColumnCellRendererById;
|
|
258
|
+
function cssSelectorForCell(rowId, columnId) {
|
|
259
|
+
return `${cssSelectorForTableRowById(rowId)} ${cssSelectorForColumnCellRendererById(columnId)}`;
|
|
260
|
+
}
|
|
261
|
+
AupTable.cssSelectorForCell = cssSelectorForCell;
|
|
211
262
|
class Row extends PageElement {
|
|
263
|
+
constructor(table, selectorOrLocator) {
|
|
264
|
+
// @ts-ignore
|
|
265
|
+
super(table, selectorOrLocator);
|
|
266
|
+
this.table = table;
|
|
267
|
+
}
|
|
268
|
+
rowId() {
|
|
269
|
+
return this.dom()
|
|
270
|
+
.invoke('attr', 'aup-row-id');
|
|
271
|
+
}
|
|
272
|
+
shouldHaveRowId(rowId) {
|
|
273
|
+
this.rowId().should("eq", rowId);
|
|
274
|
+
}
|
|
275
|
+
cell(columnOrId) {
|
|
276
|
+
const self = this;
|
|
277
|
+
const columnId = _.isString(columnOrId) ? columnOrId : columnOrId.columnId;
|
|
278
|
+
return new Cell(this.table, {
|
|
279
|
+
findIn(parent) {
|
|
280
|
+
return self.rowId()
|
|
281
|
+
.then(rowId => AupTable.cssSelectorForCell(rowId, columnId))
|
|
282
|
+
.then(selector => parent.dom().find(selector));
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
shouldBeSelected() {
|
|
287
|
+
this.dom().should('have.class', 'aup-row-selected');
|
|
288
|
+
}
|
|
289
|
+
shouldNotBeSelected() {
|
|
290
|
+
this.dom().should('not.have.class', 'aup-row-selected');
|
|
291
|
+
}
|
|
212
292
|
}
|
|
213
293
|
AupTable.Row = Row;
|
|
214
|
-
class Column {
|
|
294
|
+
class Column extends PageElement {
|
|
215
295
|
constructor(table, columnId) {
|
|
296
|
+
super(table, `aup-table-header-cell-renderer[column-id="${columnId}"]`);
|
|
216
297
|
this.table = table;
|
|
217
298
|
this.columnId = columnId;
|
|
218
299
|
}
|
|
219
|
-
|
|
300
|
+
cellContaining(content) {
|
|
220
301
|
const self = this;
|
|
221
302
|
return new Cell(this.table, {
|
|
222
303
|
findIn(parent) {
|
|
223
|
-
return parent.contains(
|
|
304
|
+
return parent.dom().contains(cssSelectorForColumnCellRendererById(self.columnId), content);
|
|
224
305
|
}
|
|
225
306
|
});
|
|
226
307
|
}
|
|
308
|
+
rowContaining(content) {
|
|
309
|
+
return this.cellContaining(content).row();
|
|
310
|
+
}
|
|
227
311
|
}
|
|
228
312
|
AupTable.Column = Column;
|
|
313
|
+
class SelectionColumn extends Column {
|
|
314
|
+
selectAll() {
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
AupTable.SelectionColumn = SelectionColumn;
|
|
229
318
|
class Cell extends PageElement {
|
|
319
|
+
constructor(table, elementLocator) {
|
|
320
|
+
super(table, elementLocator);
|
|
321
|
+
this.table = table;
|
|
322
|
+
}
|
|
323
|
+
rowId() {
|
|
324
|
+
return this.dom().closest('tr').invoke('attr', 'aup-row-id');
|
|
325
|
+
}
|
|
326
|
+
row() {
|
|
327
|
+
const self = this;
|
|
328
|
+
return new Row(this.table, {
|
|
329
|
+
findIn(parent) {
|
|
330
|
+
return self.rowId()
|
|
331
|
+
.then(rowId => parent.dom().find(AupTable.cssSelectorForTableRowById(rowId)));
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
230
335
|
}
|
|
231
336
|
AupTable.Cell = Cell;
|
|
337
|
+
class SelectionColumnCell extends Cell {
|
|
338
|
+
}
|
|
339
|
+
AupTable.SelectionColumnCell = SelectionColumnCell;
|
|
232
340
|
})(AupTable || (AupTable = {}));
|
|
233
341
|
|
|
234
|
-
function
|
|
342
|
+
function FormElementMixin(Base) {
|
|
235
343
|
return class extends Base {
|
|
236
344
|
constructor(...args) {
|
|
237
345
|
super(...args);
|
|
238
346
|
}
|
|
239
|
-
click() {
|
|
240
|
-
return this.element().click();
|
|
241
|
-
}
|
|
242
347
|
shouldBeDisabled() {
|
|
243
348
|
this.should("be.disabled");
|
|
244
|
-
// this.should("have.css", "color", "rgba(0,0,0,0.26)")
|
|
245
349
|
}
|
|
246
350
|
};
|
|
247
351
|
}
|
|
248
352
|
|
|
249
|
-
class Button extends
|
|
353
|
+
class Button extends FormElementMixin(PageElement) {
|
|
250
354
|
constructor(parentElementAccessor, buttonText) {
|
|
251
|
-
super(parentElementAccessor,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
355
|
+
super(parentElementAccessor, ElementLocator.findByTextContent('button', buttonText));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
class MatCheckbox extends FormElementMixin(PageElement) {
|
|
360
|
+
constructor(parentElementAccessor, text) {
|
|
361
|
+
super(parentElementAccessor, ElementLocator.findByTextContent('mat-checkbox', text));
|
|
362
|
+
}
|
|
363
|
+
shouldBeChecked() {
|
|
364
|
+
this.hiddenCheckBoxElement().should('be.checked');
|
|
365
|
+
}
|
|
366
|
+
shouldNotBeChecked() {
|
|
367
|
+
this.hiddenCheckBoxElement().should('not.be.checked');
|
|
368
|
+
}
|
|
369
|
+
hiddenCheckBoxElement() {
|
|
370
|
+
return this.dom().find('input[type=checkbox]');
|
|
371
|
+
}
|
|
372
|
+
check() {
|
|
373
|
+
this.hiddenCheckBoxElement().then(el => {
|
|
374
|
+
if (!el.prop('checked')) {
|
|
375
|
+
this.click();
|
|
376
|
+
this.shouldBeChecked();
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
uncheck() {
|
|
381
|
+
this.hiddenCheckBoxElement().then(el => {
|
|
382
|
+
if (el.prop('checked')) {
|
|
383
|
+
this.click();
|
|
384
|
+
this.shouldNotBeChecked();
|
|
257
385
|
}
|
|
258
386
|
});
|
|
259
387
|
}
|
|
260
388
|
}
|
|
261
389
|
|
|
262
390
|
class Builder {
|
|
263
|
-
constructor(
|
|
264
|
-
this.
|
|
391
|
+
constructor(parentPageElement) {
|
|
392
|
+
this.parentPageElement = parentPageElement;
|
|
265
393
|
}
|
|
266
394
|
find(selector) {
|
|
267
|
-
return new PageElement(this.
|
|
395
|
+
return new PageElement(this.parentPageElement, selector);
|
|
268
396
|
}
|
|
269
397
|
section(selector, builder) {
|
|
270
398
|
return this.createContainerElement(PageElement, selector, builder);
|
|
271
399
|
}
|
|
272
400
|
contains(text) {
|
|
273
|
-
return new PageElement(this.
|
|
274
|
-
findIn
|
|
275
|
-
|
|
401
|
+
return new PageElement(this.parentPageElement, {
|
|
402
|
+
findIn(parent) {
|
|
403
|
+
return parent.dom().contains(text);
|
|
404
|
+
},
|
|
405
|
+
shouldNotExist(parent) {
|
|
406
|
+
return parent.dom().should('not.contain', text);
|
|
407
|
+
}
|
|
276
408
|
});
|
|
277
409
|
}
|
|
278
410
|
button(text) {
|
|
279
|
-
return new Button(this.
|
|
411
|
+
return new Button(this.parentPageElement, text);
|
|
412
|
+
}
|
|
413
|
+
matCheckbox(text) {
|
|
414
|
+
return new MatCheckbox(this.parentPageElement, text);
|
|
280
415
|
}
|
|
281
416
|
aupStringInput(selector) {
|
|
282
|
-
return new AupInput.HtmlInput(this.
|
|
417
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
283
418
|
}
|
|
284
419
|
aupTextInput(selector) {
|
|
285
|
-
return new AupInput.TextAreaInput(this.
|
|
420
|
+
return new AupInput.TextAreaInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
286
421
|
}
|
|
287
422
|
aupPasswordInput(selector) {
|
|
288
|
-
return new AupInput.HtmlInput(this.
|
|
423
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
289
424
|
}
|
|
290
425
|
aupNumberInput(selector) {
|
|
291
|
-
return new AupInput.HtmlInput(this.
|
|
426
|
+
return new AupInput.HtmlInput(this.parentPageElement, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
292
427
|
}
|
|
293
428
|
aupCommand(faceOrSelector) {
|
|
294
|
-
return new AupCommand(this.
|
|
429
|
+
return new AupCommand(this.parentPageElement, faceOrSelector);
|
|
295
430
|
}
|
|
296
431
|
aupTabbedNavigation() {
|
|
297
|
-
return new AupNavigation(this.
|
|
432
|
+
return new AupNavigation(this.parentPageElement, 'aup-tabbed-place-navigation');
|
|
298
433
|
}
|
|
299
434
|
aupSideNavigation() {
|
|
300
|
-
return new AupNavigation(this.
|
|
435
|
+
return new AupNavigation(this.parentPageElement, 'aup-list-place-nav');
|
|
301
436
|
}
|
|
302
|
-
aupTable(
|
|
303
|
-
return
|
|
437
|
+
aupTable(selectorOrBuilder, optionalBuilder) {
|
|
438
|
+
return this.createContainerElement(AupTable, selectorOrBuilder, optionalBuilder, 'aup-table');
|
|
304
439
|
}
|
|
305
440
|
aupEmptyState(selectorOrBuilder, optionalBuilder) {
|
|
306
441
|
return this.createContainerElement(AupEmptyState, selectorOrBuilder, optionalBuilder, 'aup-empty-state');
|
|
@@ -312,7 +447,7 @@ class Builder {
|
|
|
312
447
|
if (!selector) {
|
|
313
448
|
lang.illegalState('This element requires a selector but none was provided');
|
|
314
449
|
}
|
|
315
|
-
const element = new klass(this.
|
|
450
|
+
const element = new klass(this.parentPageElement, selector);
|
|
316
451
|
if (builder) {
|
|
317
452
|
return Mixin.createProxy(element, builder(element));
|
|
318
453
|
}
|
|
@@ -326,7 +461,7 @@ class Builder {
|
|
|
326
461
|
if (!selector) {
|
|
327
462
|
lang.illegalState('This element requires a selector but none was provided');
|
|
328
463
|
}
|
|
329
|
-
const element = new klass(this.
|
|
464
|
+
const element = new klass(this.parentPageElement, selector);
|
|
330
465
|
if (builder) {
|
|
331
466
|
// create the B&E type that the builder has access to
|
|
332
467
|
const decoratedElement = Mixin.createProxy(element, new Builder(element));
|
|
@@ -341,6 +476,7 @@ class Builder {
|
|
|
341
476
|
|
|
342
477
|
class AupAbstractActivity extends PageElement {
|
|
343
478
|
constructor(parent, selector) {
|
|
479
|
+
// @ts-ignore
|
|
344
480
|
super(parent, selector);
|
|
345
481
|
this.title = this.find('aup-activity-title');
|
|
346
482
|
this._confirmCommand = new Builder(this).aupCommand('[data-cy=confirm-command]');
|
|
@@ -362,7 +498,7 @@ class AupActivity extends AupAbstractActivity {
|
|
|
362
498
|
|
|
363
499
|
class AupModalActivity extends AupActivity {
|
|
364
500
|
clickBackdrop() {
|
|
365
|
-
this.
|
|
501
|
+
this.dom().closest(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
366
502
|
}
|
|
367
503
|
}
|
|
368
504
|
|
|
@@ -383,7 +519,7 @@ class AupModalAlert extends AupAlert {
|
|
|
383
519
|
super(parent, selector);
|
|
384
520
|
}
|
|
385
521
|
clickBackdrop() {
|
|
386
|
-
this.
|
|
522
|
+
this.dom()
|
|
387
523
|
.closest(`.cdk-overlay-container`)
|
|
388
524
|
.find(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
389
525
|
}
|
|
@@ -469,7 +605,7 @@ class Page extends PageElement {
|
|
|
469
605
|
this.path = path;
|
|
470
606
|
this.rootElementSelector = 'body';
|
|
471
607
|
}
|
|
472
|
-
|
|
608
|
+
dom() {
|
|
473
609
|
return cy.get(this.rootElementSelector);
|
|
474
610
|
}
|
|
475
611
|
visit(visitParams, queryParams) {
|
|
@@ -536,13 +672,13 @@ class AupMoreMenu extends PageElement {
|
|
|
536
672
|
|
|
537
673
|
class AupPopupMenu extends PageElement {
|
|
538
674
|
constructor(parentElementAccessor, face) {
|
|
539
|
-
const
|
|
675
|
+
const locator = AupCommandFace.createElementLocator(face);
|
|
540
676
|
super(parentElementAccessor, {
|
|
541
677
|
findIn(parent) {
|
|
542
|
-
return
|
|
678
|
+
return locator.findIn(parent).closest('button');
|
|
543
679
|
},
|
|
544
680
|
shouldNotExist(parent) {
|
|
545
|
-
|
|
681
|
+
locator.shouldNotExist(parent);
|
|
546
682
|
}
|
|
547
683
|
});
|
|
548
684
|
}
|
|
@@ -566,5 +702,5 @@ class AupToolBar extends PageElement {
|
|
|
566
702
|
* Generated bundle index. Do not edit.
|
|
567
703
|
*/
|
|
568
704
|
|
|
569
|
-
export { AupAbstractActivity, AupActivity, AupAlert, AupCommand, AupCommandFace, AupCommandGroup, AupEmptyState, AupInput, AupModalActivity, AupModalAlert, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Builder, Button,
|
|
705
|
+
export { AupAbstractActivity, AupActivity, AupAlert, AupCommand, AupCommandFace, AupCommandGroup, AupEmptyState, AupInput, AupModalActivity, AupModalAlert, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Builder, Button, ElementLocator, FaceElementLocator, FormElementMixin, MatCheckbox, Page, PageBuilder, PageElement, Path };
|
|
570
706
|
//# sourceMappingURL=coolon-angular-ui-powerups-cypress.js.map
|