@coolon/angular-ui-powerups 12.4.0-alpha.1 → 12.4.0-alpha.10
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 +375 -258
- 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 +48 -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 +3 -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 +10 -0
- package/cypress/page-element.d.ts +5 -2
- package/cypress/page.d.ts +4 -30
- package/esm2015/cypress/builder.js +80 -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 +4 -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 +20 -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 +6 -9
- 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 +277 -164
- 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
|
-
{"version":3,"file":"url-snapshot.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/url-snapshot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"url-snapshot.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/url-snapshot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,SAAS,sBAAsB,CAAC,OAAgB;IAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;AAChD,CAAC;AAED,MAAM,OAAO,WAAW;IAItB,iIAAiI;IACjI,YAAqB,aAA4B,EAAW,GAAW;QAAlD,kBAAa,GAAb,aAAa,C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C,WAAW,CAAC,WAAW,CAAC,uBAAuB,CAAC,GAAG,WAAW,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAC5F,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAED,WAAW;IACX,oBAAoB;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE;YACnF,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC,CAAA,yCAAyC;SACnE;QACD,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,QAAQ;QACN,OAAO,eAAe,IAAI,CAAC,GAAG,GAAG,CAAC;IACpC,CAAC;CAWF;AAhFC;IADC,OAAO,EAAE;;;;qDAGT;AAgFH,WAAiB,WAAW;IAEb,mCAAuB,GAAG,kBAAkB,CAAC;IAC7C,oCAAwB,GAAG,IAAI,CAAC;IAE7C,SAAgB,mBAAmB,CAAC,IAAY;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,YAAA,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAFe,+BAAmB,sBAElC,CAAA;IAED,SAAgB,eAAe,CAAC,cAAwB;QACtD,OAAO,cAAc,CAAC,IAAI,CAAC,YAAA,wBAAwB,CAAC,CAAC;IACvD,CAAC;IAFe,2BAAe,kBAE9B,CAAA;AAKH,CAAC,EAhBgB,WAAW,KAAX,WAAW,QAgB3B","sourcesContent":["import { UrlSegment, UrlSerializer, UrlTree } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { ConsolidatedParameterMap } from './guards/consolidated-param-map';\nimport { PlaceDefinition } from './place-definition';\nimport { Visit } from './visit';\n\nfunction extractPrimarySegments(urlTree: UrlTree): UrlSegment[] {\n return urlTree.root.children.primary.segments;\n}\n\nexport class UrlSnapshot {\n\n readonly urlTree: UrlTree;\n\n // TODO: Update this accept a url Parser so it can be immutable and generate new trees on mutation using toString() are parseUrl.\n constructor(readonly urlSerializer: UrlSerializer, readonly url: string) {\n this.urlTree = urlSerializer.parse(url);\n }\n\n // @Trace()\n public updateVisitSegments(visit: Visit): UrlSnapshot {\n const newUrlTree = this.urlSerializer.parse(this.url);\n // Ugly, but it works for now.\n const segments = [...extractPrimarySegments(newUrlTree)];\n const visitSegments = this.getSegmentsFor(visit);\n const replaceAt = segments.findIndex(segment => segment.path === visitSegments[0].path);\n // do not use the return value, it's the items that were removed!\n segments.splice(replaceAt, visitSegments.length, ...visitSegments);\n newUrlTree.root.children.primary.segments = segments;\n return new UrlSnapshot(this.urlSerializer, newUrlTree.toString());\n }\n\n @Memoize()\n private getPrimarySegments(): UrlSegment[] {\n return extractPrimarySegments(this.urlTree);\n }\n\n /**\n * Converts the visit into segments. Please not that these segments are not e\n * @param visit\n */\n protected getSegmentsFor(visit: Visit): UrlSegment[] {\n return visit.placeDefinition.hasRouteId() ?\n [\n // NOTE:\n // It's important to attach the params to the root path and not the id. If we attach them\n // to an empty id then the angular router won't match the pattern.\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit)),\n new UrlSegment(visit.placeDefinition.getFormattedRouteId(visit), {})]\n :\n [\n new UrlSegment(visit.placeDefinition.path, visit.placeDefinition.getFormattedRouteParameters(visit))\n ];\n }\n\n includesPathOf(placeDef: PlaceDefinition) {\n return this.getPrimarySegments().find(s => s.path === placeDef.path);\n }\n\n createVisitFor(placeDef: PlaceDefinition) {\n return new Visit(placeDef, new ConsolidatedParameterMap(this.getPrimarySegments()));\n }\n\n getInteractionIds() {\n const queryParam = this.urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM];\n if (queryParam) {\n return UrlSnapshot.parseInteractionIds(queryParam);\n } else {\n return [];\n }\n }\n\n hasInteractions() {\n return this.getInteractionIds().length > 0;\n }\n\n hasInteractionIds(ids: string[]): boolean {\n return _.isEqual(this.getInteractionIds(), ids);\n }\n\n // @Trace()\n updateInteractionIds(ids: string[]): UrlSnapshot {\n if (ids.length === 0) {\n return this.removeInteractionIds();\n } else {\n const urlTree = this.urlSerializer.parse(this.url);\n urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM] = UrlSnapshot.createPathIdFor(ids);\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n }\n\n // @Trace()\n removeInteractionIds(): UrlSnapshot {\n const urlTree = this.urlSerializer.parse(this.url);\n if (urlTree.queryParams && urlTree.queryParams[UrlSnapshot.INTERACTION_QUERY_PARAM]) {\n urlTree.queryParams = {};//[UrlSnapshot.INTERACTION_ROUTER_OUTLET]\n }\n return new UrlSnapshot(this.urlSerializer, urlTree.toString());\n }\n\n toString(): string {\n return `UrlSnapshot(${this.url})`;\n }\n\n // withOptions(options: NavigationExtras) {\n // return new UrlSnapshot(this.urlSerializer, this.url, options);\n // }\n //\n // @Trace()\n // getNavigationExtras(): NavigationExtras {\n // return this.options;\n // }\n\n}\n\nexport namespace UrlSnapshot {\n\n export const INTERACTION_QUERY_PARAM = 'aup-interactions';\n export const INTERACTION_ID_SEPARATOR = '--';\n\n export function parseInteractionIds(path: string) {\n return path.split(INTERACTION_ID_SEPARATOR);\n }\n\n export function createPathIdFor(interactionIds: string[]) {\n return interactionIds.join(INTERACTION_ID_SEPARATOR);\n }\n\n export interface NavigationOptions {\n replaceUrl?: boolean;\n }\n}\n"]}
|
|
@@ -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,119 +43,65 @@ 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');
|
|
152
98
|
}
|
|
99
|
+
getButton() {
|
|
100
|
+
return this.element().find('button');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
class AupEmptyState extends PageElement {
|
|
153
105
|
}
|
|
154
106
|
|
|
155
107
|
class AupInput extends PageElement {
|
|
@@ -163,13 +115,13 @@ class AupInput extends PageElement {
|
|
|
163
115
|
return this.element().find('mat-error');
|
|
164
116
|
}
|
|
165
117
|
get labelShould() {
|
|
166
|
-
return this.label()
|
|
118
|
+
return this.getShoulder(this.label());
|
|
167
119
|
}
|
|
168
120
|
get hintShould() {
|
|
169
|
-
return this.hint()
|
|
121
|
+
return this.getShoulder(this.hint());
|
|
170
122
|
}
|
|
171
123
|
get errorShould() {
|
|
172
|
-
return this.error()
|
|
124
|
+
return this.getShoulder(this.error());
|
|
173
125
|
}
|
|
174
126
|
labelShouldBe(text) {
|
|
175
127
|
return this.labelShould("have.text", text);
|
|
@@ -195,14 +147,14 @@ class AupInput extends PageElement {
|
|
|
195
147
|
input.type(`${value}`);
|
|
196
148
|
this.input().should('have.value', `${value}`);
|
|
197
149
|
}
|
|
198
|
-
|
|
199
|
-
return this.input()
|
|
150
|
+
getShouldElement() {
|
|
151
|
+
return this.input();
|
|
200
152
|
}
|
|
201
153
|
}
|
|
202
154
|
AupInput.HtmlInput = HtmlInput;
|
|
203
155
|
class TextAreaInput extends AupInput {
|
|
204
|
-
|
|
205
|
-
return this.input()
|
|
156
|
+
getShouldElement() {
|
|
157
|
+
return this.input();
|
|
206
158
|
}
|
|
207
159
|
input() {
|
|
208
160
|
return this.element().find('textarea');
|
|
@@ -270,6 +222,21 @@ class AupTable extends PageElement {
|
|
|
270
222
|
AupTable.Cell = Cell;
|
|
271
223
|
})(AupTable || (AupTable = {}));
|
|
272
224
|
|
|
225
|
+
function ButtonMixin(Base) {
|
|
226
|
+
return class extends Base {
|
|
227
|
+
constructor(...args) {
|
|
228
|
+
super(...args);
|
|
229
|
+
}
|
|
230
|
+
click() {
|
|
231
|
+
return this.element().click();
|
|
232
|
+
}
|
|
233
|
+
shouldBeDisabled() {
|
|
234
|
+
this.should("be.disabled");
|
|
235
|
+
// this.should("have.css", "color", "rgba(0,0,0,0.26)")
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
273
240
|
class Button extends ButtonMixin(PageElement) {
|
|
274
241
|
constructor(parentElementAccessor, buttonText) {
|
|
275
242
|
super(parentElementAccessor, {
|
|
@@ -283,56 +250,205 @@ class Button extends ButtonMixin(PageElement) {
|
|
|
283
250
|
}
|
|
284
251
|
}
|
|
285
252
|
|
|
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
|
-
|
|
253
|
+
class Builder {
|
|
254
|
+
constructor(source) {
|
|
255
|
+
this.source = source;
|
|
256
|
+
this._sectionFactory = Builder.createFactoryMethod(this.source, PageElement);
|
|
257
|
+
this.aupEmptyState = Builder.createFactoryMethod(this.source, AupEmptyState, 'aup-empty-state');
|
|
258
|
+
}
|
|
259
|
+
find(selector) {
|
|
260
|
+
return new PageElement(this.source, selector);
|
|
261
|
+
}
|
|
262
|
+
section(selector, builder) {
|
|
263
|
+
return this._sectionFactory(selector, builder);
|
|
264
|
+
}
|
|
265
|
+
contains(text) {
|
|
266
|
+
return new PageElement(this.source, {
|
|
267
|
+
findIn: parent => parent.contains(text),
|
|
268
|
+
shouldNotExist: (parent) => parent.should('not.contain', text)
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
button(text) {
|
|
272
|
+
return new Button(this.source, text);
|
|
273
|
+
}
|
|
274
|
+
aupStringInput(selector) {
|
|
275
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
276
|
+
}
|
|
277
|
+
aupTextInput(selector) {
|
|
278
|
+
return new AupInput.TextAreaInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
279
|
+
}
|
|
280
|
+
aupPasswordInput(selector) {
|
|
281
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
282
|
+
}
|
|
283
|
+
aupNumberInput(selector) {
|
|
284
|
+
return new AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
285
|
+
}
|
|
286
|
+
aupCommand(faceOrSelector) {
|
|
287
|
+
return new AupCommand(this.source, faceOrSelector);
|
|
288
|
+
}
|
|
289
|
+
aupTabbedNavigation() {
|
|
290
|
+
return new AupNavigation(this.source, 'aup-tabbed-place-navigation');
|
|
291
|
+
}
|
|
292
|
+
aupSideNavigation() {
|
|
293
|
+
return new AupNavigation(this.source, 'aup-list-place-nav');
|
|
294
|
+
}
|
|
295
|
+
aupTable(selector) {
|
|
296
|
+
return new AupTable(this.source, selector !== null && selector !== void 0 ? selector : 'aup-table');
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
(function (Builder) {
|
|
300
|
+
class Factory {
|
|
301
|
+
constructor(parent, klass, defaultSelector) {
|
|
302
|
+
this.parent = parent;
|
|
303
|
+
this.klass = klass;
|
|
304
|
+
this.defaultSelector = defaultSelector;
|
|
305
|
+
}
|
|
306
|
+
create(selectorOrBuilder, optionalBuilder) {
|
|
307
|
+
const selector = _.isFunction(selectorOrBuilder) ? this.defaultSelector : selectorOrBuilder;
|
|
308
|
+
if (!selector) {
|
|
309
|
+
lang.illegalState('This element requires a selector but none was provided');
|
|
326
310
|
}
|
|
327
|
-
|
|
328
|
-
|
|
311
|
+
const callback = _.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
|
|
312
|
+
const element = new this.klass(this.parent, selector);
|
|
313
|
+
return callback ? Mixin.createProxy(element, callback(new Builder(this.parent))) : element;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
Builder.Factory = Factory;
|
|
317
|
+
function createFactoryMethod(element, klass, defaultSelector) {
|
|
318
|
+
const factory = new Factory(element, klass, defaultSelector);
|
|
319
|
+
return factory.create.bind(factory);
|
|
320
|
+
}
|
|
321
|
+
Builder.createFactoryMethod = createFactoryMethod;
|
|
322
|
+
})(Builder || (Builder = {}));
|
|
323
|
+
|
|
324
|
+
class AupAbstractActivity extends PageElement {
|
|
325
|
+
constructor(parent, selector) {
|
|
326
|
+
super(parent, selector);
|
|
327
|
+
this.title = this.find('aup-activity-title');
|
|
328
|
+
this._confirmCommand = new Builder(this).aupCommand('[data-cy=confirm-command]');
|
|
329
|
+
this._cancelCommand = new Builder(this).aupCommand('[data-cy=cancel-command]');
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
class AupActivity extends AupAbstractActivity {
|
|
334
|
+
constructor(parent, selector) {
|
|
335
|
+
super(parent, selector);
|
|
336
|
+
}
|
|
337
|
+
get confirmCommand() {
|
|
338
|
+
return this._confirmCommand;
|
|
339
|
+
}
|
|
340
|
+
get cancelCommand() {
|
|
341
|
+
return this._cancelCommand;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
class AupModalActivity extends AupActivity {
|
|
346
|
+
clickBackdrop() {
|
|
347
|
+
this.element().closest(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
class AupAlert extends AupAbstractActivity {
|
|
352
|
+
constructor(parent, selector) {
|
|
353
|
+
super(parent, selector);
|
|
354
|
+
}
|
|
355
|
+
get closeCommand() {
|
|
356
|
+
return this._confirmCommand;
|
|
357
|
+
}
|
|
358
|
+
clickClose() {
|
|
359
|
+
this.closeCommand.click();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
class AupModalAlert extends AupAlert {
|
|
364
|
+
constructor(parent, selector) {
|
|
365
|
+
super(parent, selector);
|
|
366
|
+
}
|
|
367
|
+
clickBackdrop() {
|
|
368
|
+
this.element()
|
|
369
|
+
.closest(`.cdk-overlay-container`)
|
|
370
|
+
.find(`.cdk-overlay-backdrop`).click(-50, -50, { force: true });
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
class PageBuilder extends Builder {
|
|
375
|
+
constructor() {
|
|
376
|
+
super(...arguments);
|
|
377
|
+
this._modalInteractionFactory = Builder.createFactoryMethod(this.source, AupModalActivity);
|
|
378
|
+
this._modalAlertFactory = Builder.createFactoryMethod(this.source, AupModalAlert);
|
|
379
|
+
}
|
|
380
|
+
aupModalActivity(selector, builder) {
|
|
381
|
+
return this._modalInteractionFactory(`.dialog-interaction-context ${selector}`, builder);
|
|
382
|
+
}
|
|
383
|
+
aupModalAlert(builder) {
|
|
384
|
+
return this._modalAlertFactory(`.dialog-interaction-context aup-alert-dialog`, builder);
|
|
385
|
+
}
|
|
386
|
+
aupModelConfirm(builder) {
|
|
387
|
+
return this._modalInteractionFactory(`.dialog-interaction-context aup-confirm-dialog`, builder);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
let urlSerialiser = new DefaultUrlSerializer();
|
|
392
|
+
class Path {
|
|
393
|
+
constructor(segments) {
|
|
394
|
+
this.segments = segments;
|
|
395
|
+
}
|
|
396
|
+
static extractVisitParameters(url) {
|
|
397
|
+
var _a, _b;
|
|
398
|
+
let result = {};
|
|
399
|
+
const urlTree = urlSerialiser.parse(url);
|
|
400
|
+
const urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
|
|
401
|
+
urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(s => {
|
|
402
|
+
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
403
|
+
});
|
|
404
|
+
return result;
|
|
405
|
+
}
|
|
406
|
+
toUrl(matrixParams) {
|
|
407
|
+
return this.segments.map(s => s.toUrlPart(matrixParams)).join('/');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
(function (Path) {
|
|
411
|
+
function setUrlSerialiser(serialiser) {
|
|
412
|
+
urlSerialiser = serialiser;
|
|
413
|
+
}
|
|
414
|
+
Path.setUrlSerialiser = setUrlSerialiser;
|
|
415
|
+
class Segment {
|
|
416
|
+
constructor(path, params = {}) {
|
|
417
|
+
var _a;
|
|
418
|
+
this.path = path;
|
|
419
|
+
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
420
|
+
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
421
|
+
}
|
|
422
|
+
toUrlPart(params) {
|
|
423
|
+
let path = this.path;
|
|
424
|
+
this.visitParams.forEach(p => {
|
|
425
|
+
const value = params[p];
|
|
426
|
+
if (value) {
|
|
427
|
+
path = `${path};${p}=${value}`;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
if (this.routeId && params[this.routeId]) {
|
|
431
|
+
path = path + '/' + params[this.routeId];
|
|
329
432
|
}
|
|
330
|
-
|
|
433
|
+
return path;
|
|
434
|
+
}
|
|
331
435
|
}
|
|
332
|
-
|
|
333
|
-
class
|
|
436
|
+
Path.Segment = Segment;
|
|
437
|
+
class Builder {
|
|
438
|
+
constructor() {
|
|
439
|
+
this.segments = [];
|
|
440
|
+
}
|
|
441
|
+
segment(name, params) {
|
|
442
|
+
const builder = new Segment(name, params);
|
|
443
|
+
this.segments.push(builder);
|
|
444
|
+
return this;
|
|
445
|
+
}
|
|
446
|
+
getPath() {
|
|
447
|
+
return new Path(this.segments);
|
|
448
|
+
}
|
|
334
449
|
}
|
|
335
|
-
|
|
450
|
+
Path.Builder = Builder;
|
|
451
|
+
})(Path || (Path = {}));
|
|
336
452
|
|
|
337
453
|
class Page extends PageElement {
|
|
338
454
|
constructor(path) {
|
|
@@ -363,8 +479,8 @@ class Page extends PageElement {
|
|
|
363
479
|
}
|
|
364
480
|
shouldBeActive(withParameters) {
|
|
365
481
|
// Note: cy.window() doesn't return a promise... it's a chainable.
|
|
366
|
-
cy
|
|
367
|
-
cy
|
|
482
|
+
cy['waitUntil'](() => {
|
|
483
|
+
return cy.window().then(window => {
|
|
368
484
|
return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
|
|
369
485
|
});
|
|
370
486
|
});
|
|
@@ -384,18 +500,15 @@ class Page extends PageElement {
|
|
|
384
500
|
function create(pathOrPathBuilder, page) {
|
|
385
501
|
const pathBuilder = new Path.Builder();
|
|
386
502
|
if (_.isString(pathOrPathBuilder)) {
|
|
387
|
-
pathOrPathBuilder.split(
|
|
503
|
+
pathOrPathBuilder.split('/').filter(p => !_.isEmpty(p)).forEach(p => pathBuilder.segment(p));
|
|
388
504
|
}
|
|
389
505
|
else {
|
|
390
506
|
pathOrPathBuilder(pathBuilder);
|
|
391
507
|
}
|
|
392
|
-
const
|
|
393
|
-
return Mixin.createProxy(page(
|
|
508
|
+
const instance = new Page(pathBuilder.getPath());
|
|
509
|
+
return Mixin.createProxy(page(new PageBuilder(instance)), instance);
|
|
394
510
|
}
|
|
395
511
|
Page.create = create;
|
|
396
|
-
class PageBuilder extends Section.Mixin(Page) {
|
|
397
|
-
}
|
|
398
|
-
Page.PageBuilder = PageBuilder;
|
|
399
512
|
})(Page || (Page = {}));
|
|
400
513
|
|
|
401
514
|
class AupCommandGroup extends PageElement {
|
|
@@ -439,5 +552,5 @@ class AupToolBar extends PageElement {
|
|
|
439
552
|
* Generated bundle index. Do not edit.
|
|
440
553
|
*/
|
|
441
554
|
|
|
442
|
-
export { AupCommand, AupCommandFace, AupCommandGroup, AupInput, AupMoreMenu, AupNavigation, AupPopupMenu, AupTable, AupToolBar, Button, ButtonMixin, Page, PageElement, Path
|
|
555
|
+
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
556
|
//# sourceMappingURL=coolon-angular-ui-powerups-cypress.js.map
|