@coolon/angular-ui-powerups 12.3.0 → 12.4.0-alpha.0
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 +297 -93
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +410 -290
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/cypress/components/aup-command-face.d.ts +2 -5
- package/cypress/components/aup-command.d.ts +18 -4
- package/cypress/components/aup-navigation.d.ts +0 -1
- package/cypress/components/aup-popup-menu.d.ts +2 -0
- package/cypress/components/aup-table.d.ts +19 -0
- package/cypress/components/button-mixin.d.ts +17 -0
- package/cypress/components/button.d.ts +17 -3
- package/cypress/coolon-angular-ui-powerups-cypress.d.ts +1 -0
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/exports.d.ts +3 -0
- package/cypress/page-element.d.ts +11 -2
- package/cypress/page.d.ts +16 -13
- package/cypress/path.d.ts +26 -0
- package/cypress/section.d.ts +8 -1
- package/esm2015/cypress/components/aup-command-face.js +20 -11
- 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 +10 -7
- 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-more-menu.js +1 -2
- package/esm2015/cypress/components/aup-more-menu.js.map +1 -1
- package/esm2015/cypress/components/aup-more-menu.metadata.json +1 -1
- package/esm2015/cypress/components/aup-navigation.js +1 -5
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.js +12 -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 +36 -0
- package/esm2015/cypress/components/aup-table.js.map +1 -0
- package/esm2015/cypress/components/aup-table.metadata.json +1 -0
- package/esm2015/cypress/components/button-mixin.js +15 -0
- package/esm2015/cypress/components/button-mixin.js.map +1 -0
- package/esm2015/cypress/components/button-mixin.metadata.json +1 -0
- package/esm2015/cypress/components/button.js +11 -7
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/esm2015/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/esm2015/cypress/exports.js +3 -0
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-element.js +21 -5
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +32 -22
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/esm2015/cypress/path.js +61 -0
- package/esm2015/cypress/path.js.map +1 -0
- package/esm2015/cypress/path.metadata.json +1 -0
- package/esm2015/cypress/section.js +20 -10
- package/esm2015/cypress/section.js.map +1 -1
- package/esm2015/lib/components/switch-case/switch-case.component.js +7 -0
- package/esm2015/lib/components/switch-case/switch-case.component.js.map +1 -1
- package/esm2015/lib/components/switch-case/switch-case.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/abstract-table.component.js +1 -1
- package/esm2015/lib/components/tables/abstract-table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.js +1 -1
- package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.js +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
- package/esm2015/lib/place/guards/consolidated-param-map.js +7 -2
- package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
- package/esm2015/lib/place/guards/consolidated-param-map.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +1 -22
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +24 -14
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -1
- package/esm2015/lib/place/place-component.js +67 -5
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-component.metadata.json +1 -1
- package/esm2015/lib/place/place-definition.js +3 -3
- package/esm2015/lib/place/place-definition.js.map +1 -1
- package/esm2015/lib/place/place-router.js +9 -4
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +13 -14
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
- package/esm2015/lib/place/route/parameter-definition.js +21 -3
- package/esm2015/lib/place/route/parameter-definition.js.map +1 -1
- package/esm2015/lib/place/route/parameter-definition.metadata.json +1 -1
- package/esm2015/lib/place/route/visit-sanitiser.js +1 -1
- package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.js +30 -7
- package/esm2015/lib/place/url-snapshot.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
- package/esm2015/lib/place/visit.js +7 -7
- package/esm2015/lib/place/visit.js.map +1 -1
- package/esm2015/lib/place/visit.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups-cypress.js +235 -74
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +369 -269
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/switch-case/switch-case.component.d.ts +7 -0
- package/lib/place/guards/consolidated-param-map.d.ts +2 -2
- package/lib/place/navigation/place-component-deactivation-handler.d.ts +3 -1
- package/lib/place/place-component.d.ts +26 -3
- package/lib/place/route/parameter-definition.d.ts +8 -0
- package/lib/place/url-snapshot.d.ts +1 -0
- package/lib/place/visit.d.ts +4 -4
- package/package.json +1 -1
- package/schematics/activity/schema.json +1 -1
- package/schematics/activity/templates/component/__name@dasherize__.component.html.template +1 -1
- package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +2 -2
- package/schematics/aup-i18n/schema.json +1 -1
- package/schematics/bootstrap-app/schema.json +1 -1
- package/schematics/component/schema.json +1 -1
- package/schematics/place-add/schema.json +1 -1
- package/schematics/place-bootstrap/schema.json +1 -1
- package/schematics/place-routes/schema.json +1 -1
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@coolon/typescript-utilities')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups/cypress', ['exports', '@coolon/typescript-utilities'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = global.coolon['angular-ui-powerups'] || {}, global.coolon['angular-ui-powerups'].cypress = {}), global.typescriptUtilities));
|
|
5
|
-
}(this, (function (exports, typescriptUtilities) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('@coolon/typescript-utilities'), require('@angular/router')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups/cypress', ['exports', 'lodash', '@coolon/typescript-utilities', '@angular/router'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = global.coolon['angular-ui-powerups'] || {}, global.coolon['angular-ui-powerups'].cypress = {}), global._, global.typescriptUtilities, global.ng.router));
|
|
5
|
+
}(this, (function (exports, _, typescriptUtilities, router) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return e[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n['default'] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var ___namespace = /*#__PURE__*/_interopNamespace(_);
|
|
6
28
|
|
|
7
29
|
var PageElement = /** @class */ (function () {
|
|
8
|
-
function PageElement(
|
|
9
|
-
this.
|
|
30
|
+
function PageElement(parent, selector) {
|
|
31
|
+
this.parentElementAccessor = parent instanceof PageElement ? function () { return parent.element(); } : parent;
|
|
32
|
+
this.elementAccessStrategy = ___namespace.isString(selector) ? {
|
|
33
|
+
findIn: function (p) { return p.find(selector); },
|
|
34
|
+
shouldNotExist: function (p) { return p.should('not.have', selector); }
|
|
35
|
+
} : selector;
|
|
10
36
|
}
|
|
11
37
|
PageElement.prototype.element = function () {
|
|
12
|
-
|
|
38
|
+
var parent = this.getParentElement();
|
|
39
|
+
return parent ? this.elementAccessStrategy.findIn(parent) : undefined;
|
|
40
|
+
};
|
|
41
|
+
PageElement.prototype.getParentElement = function () {
|
|
42
|
+
return this.parentElementAccessor ? this.parentElementAccessor() : undefined;
|
|
43
|
+
};
|
|
44
|
+
PageElement.prototype.find = function (selector) {
|
|
45
|
+
var _this = this;
|
|
46
|
+
return new PageElement(function () { return _this.element(); }, selector);
|
|
13
47
|
};
|
|
14
48
|
PageElement.prototype.click = function (text) {
|
|
15
49
|
text ? this.element().contains(text).click() : this.element().click();
|
|
@@ -22,10 +56,13 @@
|
|
|
22
56
|
configurable: true
|
|
23
57
|
});
|
|
24
58
|
PageElement.prototype.shouldBeVisible = function () {
|
|
25
|
-
this.should(
|
|
59
|
+
this.should('be.visible');
|
|
26
60
|
};
|
|
27
61
|
PageElement.prototype.shouldNotBeVisible = function () {
|
|
28
|
-
this.
|
|
62
|
+
if (!this.elementAccessStrategy.shouldNotExist) {
|
|
63
|
+
typescriptUtilities.lang.abstractMethod(this.constructor);
|
|
64
|
+
}
|
|
65
|
+
this.elementAccessStrategy.shouldNotExist(this.getParentElement());
|
|
29
66
|
};
|
|
30
67
|
return PageElement;
|
|
31
68
|
}());
|
|
@@ -342,54 +379,131 @@
|
|
|
342
379
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
343
380
|
}
|
|
344
381
|
|
|
382
|
+
var urlSerialiser = new router.DefaultUrlSerializer();
|
|
383
|
+
exports.Path = /** @class */ (function () {
|
|
384
|
+
function Path(segments) {
|
|
385
|
+
this.segments = segments;
|
|
386
|
+
}
|
|
387
|
+
Path.extractVisitParameters = function (url) {
|
|
388
|
+
var result = {};
|
|
389
|
+
var urlTree = urlSerialiser.parse(url);
|
|
390
|
+
urlTree.root.children.primary.segments.forEach(function (s) {
|
|
391
|
+
result = Object.assign(Object.assign({}, result), s.parameters);
|
|
392
|
+
});
|
|
393
|
+
return result;
|
|
394
|
+
};
|
|
395
|
+
Path.prototype.toUrl = function (params) {
|
|
396
|
+
return this.segments.map(function (s) { return s.toUrlPart(params); }).join('/');
|
|
397
|
+
};
|
|
398
|
+
return Path;
|
|
399
|
+
}());
|
|
400
|
+
(function (Path) {
|
|
401
|
+
function setUrlSerialiser(serialiser) {
|
|
402
|
+
urlSerialiser = serialiser;
|
|
403
|
+
}
|
|
404
|
+
Path.setUrlSerialiser = setUrlSerialiser;
|
|
405
|
+
var Segment = /** @class */ (function () {
|
|
406
|
+
function Segment(path, params) {
|
|
407
|
+
if (params === void 0) { params = {}; }
|
|
408
|
+
var _a;
|
|
409
|
+
this.path = path;
|
|
410
|
+
this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
|
|
411
|
+
this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
|
|
412
|
+
}
|
|
413
|
+
Segment.prototype.toUrlPart = function (params) {
|
|
414
|
+
var path = this.path;
|
|
415
|
+
this.visitParams.forEach(function (p) {
|
|
416
|
+
var value = params[p];
|
|
417
|
+
if (value) {
|
|
418
|
+
path = path + ";" + p + "=" + value;
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
if (this.routeId && params[this.routeId]) {
|
|
422
|
+
path = path + '/' + params[this.routeId];
|
|
423
|
+
}
|
|
424
|
+
return path;
|
|
425
|
+
};
|
|
426
|
+
return Segment;
|
|
427
|
+
}());
|
|
428
|
+
Path.Segment = Segment;
|
|
429
|
+
var Builder = /** @class */ (function () {
|
|
430
|
+
function Builder() {
|
|
431
|
+
this.segments = [];
|
|
432
|
+
}
|
|
433
|
+
Builder.prototype.segment = function (name, params) {
|
|
434
|
+
var builder = new Segment(name, params);
|
|
435
|
+
this.segments.push(builder);
|
|
436
|
+
return this;
|
|
437
|
+
};
|
|
438
|
+
Builder.prototype.getPath = function () {
|
|
439
|
+
return new Path(this.segments);
|
|
440
|
+
};
|
|
441
|
+
return Builder;
|
|
442
|
+
}());
|
|
443
|
+
Path.Builder = Builder;
|
|
444
|
+
})(exports.Path || (exports.Path = {}));
|
|
445
|
+
|
|
345
446
|
var AupCommandFace = /** @class */ (function (_super) {
|
|
346
447
|
__extends(AupCommandFace, _super);
|
|
347
|
-
function AupCommandFace() {
|
|
348
|
-
return _super
|
|
448
|
+
function AupCommandFace(parentElement, face) {
|
|
449
|
+
return _super.call(this, function () { return parentElement.element(); }, AupCommandFace.createAccessor(face)) || this;
|
|
349
450
|
}
|
|
350
|
-
AupCommandFace.
|
|
351
|
-
var parentFinder = function () { return parent.element(); };
|
|
352
|
-
var rootElementAccessor = this.createFinder(parentFinder, face);
|
|
353
|
-
return new AupCommandFace(rootElementAccessor);
|
|
354
|
-
};
|
|
355
|
-
AupCommandFace.createFinder = function (parent, face) {
|
|
451
|
+
AupCommandFace.createAccessor = function (face) {
|
|
356
452
|
// AOT barfs if we return a lambda
|
|
357
|
-
var
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
453
|
+
var accessor = {
|
|
454
|
+
findIn: function (parent) {
|
|
455
|
+
return face.text ?
|
|
456
|
+
parent.contains("aup-command-face", face.text()) :
|
|
457
|
+
face.icon ?
|
|
458
|
+
parent.find("aup-icon[ng-reflect-icon=" + face.icon() + "]").closest('aup-command-face') :
|
|
459
|
+
undefined;
|
|
460
|
+
},
|
|
461
|
+
shouldNotExist: function (parent) {
|
|
462
|
+
return face.text ?
|
|
463
|
+
parent.should("not.contain", "aup-command-face", face.text()) :
|
|
464
|
+
face.icon ?
|
|
465
|
+
parent.should("not.contain", "aup-icon[ng-reflect-icon=" + face.icon() + "]") :
|
|
466
|
+
undefined;
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
return accessor;
|
|
363
470
|
};
|
|
364
471
|
return AupCommandFace;
|
|
365
472
|
}(PageElement));
|
|
366
473
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
474
|
+
function ButtonMixin(Base) {
|
|
475
|
+
return /** @class */ (function (_super) {
|
|
476
|
+
__extends(class_1, _super);
|
|
477
|
+
function class_1() {
|
|
478
|
+
var args = [];
|
|
479
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
480
|
+
args[_i] = arguments[_i];
|
|
481
|
+
}
|
|
482
|
+
return _super.apply(this, __spreadArray([], __read(args))) || this;
|
|
483
|
+
}
|
|
484
|
+
class_1.prototype.click = function () {
|
|
485
|
+
return this.element().click();
|
|
486
|
+
};
|
|
487
|
+
class_1.prototype.shouldBeDisabled = function () {
|
|
488
|
+
this.should("be.disabled");
|
|
489
|
+
// this.should("have.css", "color", "rgba(0,0,0,0.26)")
|
|
490
|
+
};
|
|
491
|
+
return class_1;
|
|
492
|
+
}(Base));
|
|
493
|
+
}
|
|
381
494
|
|
|
382
495
|
var AupCommand = /** @class */ (function (_super) {
|
|
383
496
|
__extends(AupCommand, _super);
|
|
384
|
-
function AupCommand() {
|
|
385
|
-
|
|
497
|
+
function AupCommand(parentElementAccessor, face) {
|
|
498
|
+
var _this = this;
|
|
499
|
+
var faceAccessor = AupCommandFace.createAccessor(face);
|
|
500
|
+
_this = _super.call(this, parentElementAccessor, {
|
|
501
|
+
findIn: function (parent) {
|
|
502
|
+
return faceAccessor.findIn(parent).closest("aup-command");
|
|
503
|
+
}
|
|
504
|
+
}) || this;
|
|
505
|
+
return _this;
|
|
386
506
|
}
|
|
387
|
-
AupCommand.create = function (parent, face) {
|
|
388
|
-
var parentFinder = function () { return parent.element().find('aup-command'); };
|
|
389
|
-
var findFace = AupCommandFace.createFinder(parentFinder, face);
|
|
390
|
-
var commandFinder = function () { return findFace().closest("aup-command"); };
|
|
391
|
-
return new AupCommand(commandFinder);
|
|
392
|
-
};
|
|
393
507
|
Object.defineProperty(AupCommand.prototype, "should", {
|
|
394
508
|
get: function () {
|
|
395
509
|
return this.element().find('button').should;
|
|
@@ -398,7 +512,7 @@
|
|
|
398
512
|
configurable: true
|
|
399
513
|
});
|
|
400
514
|
return AupCommand;
|
|
401
|
-
}(
|
|
515
|
+
}(ButtonMixin(PageElement)));
|
|
402
516
|
|
|
403
517
|
exports.AupInput = /** @class */ (function (_super) {
|
|
404
518
|
__extends(AupInput, _super);
|
|
@@ -508,15 +622,11 @@
|
|
|
508
622
|
function AupNavigation() {
|
|
509
623
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
510
624
|
}
|
|
511
|
-
AupNavigation.create = function (parent, selector) {
|
|
512
|
-
var rootElementAccessor = function () { return parent.element().find(selector); };
|
|
513
|
-
return new AupNavigation(rootElementAccessor);
|
|
514
|
-
};
|
|
515
625
|
AupNavigation.prototype.click = function (label) {
|
|
516
626
|
return _super.prototype.click.call(this, label);
|
|
517
627
|
};
|
|
518
628
|
AupNavigation.prototype.face = function (label) {
|
|
519
|
-
return AupCommandFace
|
|
629
|
+
return new AupCommandFace(this, { text: function () { return label; } });
|
|
520
630
|
};
|
|
521
631
|
AupNavigation.prototype.shouldHaveLink = function (label) {
|
|
522
632
|
this.face(label).shouldBeVisible();
|
|
@@ -527,6 +637,70 @@
|
|
|
527
637
|
return AupNavigation;
|
|
528
638
|
}(PageElement));
|
|
529
639
|
|
|
640
|
+
exports.AupTable = /** @class */ (function (_super) {
|
|
641
|
+
__extends(AupTable, _super);
|
|
642
|
+
function AupTable(parentElementAccessor, selector) {
|
|
643
|
+
return _super.call(this, parentElementAccessor, selector) || this;
|
|
644
|
+
}
|
|
645
|
+
AupTable.prototype.row = function (rowId) {
|
|
646
|
+
var _this = this;
|
|
647
|
+
return new AupTable.Row(function () { return _this.element(); }, "tr[aup-table-id=" + rowId + "]");
|
|
648
|
+
};
|
|
649
|
+
AupTable.prototype.column = function (columnId) {
|
|
650
|
+
return new AupTable.Column(this, columnId);
|
|
651
|
+
};
|
|
652
|
+
return AupTable;
|
|
653
|
+
}(PageElement));
|
|
654
|
+
(function (AupTable) {
|
|
655
|
+
var Row = /** @class */ (function (_super) {
|
|
656
|
+
__extends(Row, _super);
|
|
657
|
+
function Row() {
|
|
658
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
659
|
+
}
|
|
660
|
+
return Row;
|
|
661
|
+
}(PageElement));
|
|
662
|
+
AupTable.Row = Row;
|
|
663
|
+
var Column = /** @class */ (function () {
|
|
664
|
+
function Column(table, columnId) {
|
|
665
|
+
this.table = table;
|
|
666
|
+
this.columnId = columnId;
|
|
667
|
+
}
|
|
668
|
+
Column.prototype.cell = function (content) {
|
|
669
|
+
var self = this;
|
|
670
|
+
return new Cell(this.table, {
|
|
671
|
+
findIn: function (parent) {
|
|
672
|
+
return parent.contains("aup-table-cell-renderer[column-id=" + self.columnId + "]", content);
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
};
|
|
676
|
+
return Column;
|
|
677
|
+
}());
|
|
678
|
+
AupTable.Column = Column;
|
|
679
|
+
var Cell = /** @class */ (function (_super) {
|
|
680
|
+
__extends(Cell, _super);
|
|
681
|
+
function Cell() {
|
|
682
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
683
|
+
}
|
|
684
|
+
return Cell;
|
|
685
|
+
}(PageElement));
|
|
686
|
+
AupTable.Cell = Cell;
|
|
687
|
+
})(exports.AupTable || (exports.AupTable = {}));
|
|
688
|
+
|
|
689
|
+
var Button = /** @class */ (function (_super) {
|
|
690
|
+
__extends(Button, _super);
|
|
691
|
+
function Button(parentElementAccessor, buttonText) {
|
|
692
|
+
return _super.call(this, parentElementAccessor, {
|
|
693
|
+
findIn: function (parent) {
|
|
694
|
+
return parent.contains('button', buttonText);
|
|
695
|
+
},
|
|
696
|
+
shouldNotExist: function (parent) {
|
|
697
|
+
return parent.should('not.contain', buttonText);
|
|
698
|
+
}
|
|
699
|
+
}) || this;
|
|
700
|
+
}
|
|
701
|
+
return Button;
|
|
702
|
+
}(ButtonMixin(PageElement)));
|
|
703
|
+
|
|
530
704
|
exports.Section = void 0;
|
|
531
705
|
(function (Section) {
|
|
532
706
|
function Mixin(Base) {
|
|
@@ -537,41 +711,55 @@
|
|
|
537
711
|
}
|
|
538
712
|
class_1.prototype.section = function (selector, section) {
|
|
539
713
|
var _this = this;
|
|
540
|
-
var impl = new Impl(function () { return _this.element()
|
|
714
|
+
var impl = new Impl(function () { return _this.element(); }, selector);
|
|
541
715
|
return typescriptUtilities.Mixin.createProxy(section(impl), impl);
|
|
542
716
|
};
|
|
717
|
+
class_1.prototype.find = function (selector) {
|
|
718
|
+
var _this = this;
|
|
719
|
+
return new PageElement(function () { return _this.element(); }, selector);
|
|
720
|
+
};
|
|
543
721
|
class_1.prototype.contains = function (text) {
|
|
544
722
|
var _this = this;
|
|
545
|
-
return new PageElement(function () { return _this.element()
|
|
723
|
+
return new PageElement(function () { return _this.element(); }, {
|
|
724
|
+
findIn: function (parent) { return parent.contains(text); },
|
|
725
|
+
shouldNotExist: function (parent) { return parent.should("not.contain", text); }
|
|
726
|
+
});
|
|
546
727
|
};
|
|
547
728
|
class_1.prototype.button = function (text) {
|
|
548
729
|
var _this = this;
|
|
549
|
-
return new Button(function () { return _this.element()
|
|
730
|
+
return new Button(function () { return _this.element(); }, text);
|
|
550
731
|
};
|
|
551
732
|
class_1.prototype.aupStringInput = function (selector) {
|
|
552
733
|
var _this = this;
|
|
553
|
-
return new exports.AupInput.HtmlInput(function () { return _this.element()
|
|
734
|
+
return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
|
|
554
735
|
};
|
|
555
736
|
class_1.prototype.aupTextInput = function (selector) {
|
|
556
737
|
var _this = this;
|
|
557
|
-
return new exports.AupInput.TextAreaInput(function () { return _this.element()
|
|
738
|
+
return new exports.AupInput.TextAreaInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
|
|
558
739
|
};
|
|
559
740
|
class_1.prototype.aupPasswordInput = function (selector) {
|
|
560
741
|
var _this = this;
|
|
561
|
-
return new exports.AupInput.HtmlInput(function () { return _this.element()
|
|
742
|
+
return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
|
|
562
743
|
};
|
|
563
744
|
class_1.prototype.aupNumberInput = function (selector) {
|
|
564
745
|
var _this = this;
|
|
565
|
-
return new exports.AupInput.HtmlInput(function () { return _this.element()
|
|
746
|
+
return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
|
|
566
747
|
};
|
|
567
748
|
class_1.prototype.aupCommand = function (face) {
|
|
568
|
-
|
|
749
|
+
var _this = this;
|
|
750
|
+
return new AupCommand(function () { return _this.element(); }, face);
|
|
569
751
|
};
|
|
570
752
|
class_1.prototype.aupTabbedNavigation = function () {
|
|
571
|
-
|
|
753
|
+
var _this = this;
|
|
754
|
+
return new AupNavigation(function () { return _this.element(); }, 'aup-tabbed-place-navigation');
|
|
572
755
|
};
|
|
573
756
|
class_1.prototype.aupSideNavigation = function () {
|
|
574
|
-
|
|
757
|
+
var _this = this;
|
|
758
|
+
return new AupNavigation(function () { return _this.element(); }, 'aup-list-place-nav');
|
|
759
|
+
};
|
|
760
|
+
class_1.prototype.aupTable = function (selector) {
|
|
761
|
+
var _this = this;
|
|
762
|
+
return new exports.AupTable(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-table');
|
|
575
763
|
};
|
|
576
764
|
return class_1;
|
|
577
765
|
}(Base));
|
|
@@ -589,7 +777,7 @@
|
|
|
589
777
|
exports.Page = /** @class */ (function (_super) {
|
|
590
778
|
__extends(Page, _super);
|
|
591
779
|
function Page(path) {
|
|
592
|
-
var _this = _super.call(this) || this;
|
|
780
|
+
var _this = _super.call(this, undefined, undefined) || this;
|
|
593
781
|
_this.path = path;
|
|
594
782
|
_this.rootElementSelector = 'body';
|
|
595
783
|
return _this;
|
|
@@ -597,12 +785,12 @@
|
|
|
597
785
|
Page.prototype.element = function () {
|
|
598
786
|
return cy.get(this.rootElementSelector);
|
|
599
787
|
};
|
|
600
|
-
Page.prototype.visit = function () {
|
|
601
|
-
this.tryAndVisit();
|
|
602
|
-
this.shouldBeActive();
|
|
788
|
+
Page.prototype.visit = function (params) {
|
|
789
|
+
this.tryAndVisit(params);
|
|
790
|
+
this.shouldBeActive(params);
|
|
603
791
|
};
|
|
604
|
-
Page.prototype.tryAndVisit = function () {
|
|
605
|
-
cy.visit(this.path);
|
|
792
|
+
Page.prototype.tryAndVisit = function (params) {
|
|
793
|
+
cy.visit("/" + this.path.toUrl(params !== null && params !== void 0 ? params : {}));
|
|
606
794
|
};
|
|
607
795
|
Page.prototype.shouldHaveActivityIds = function () {
|
|
608
796
|
var ids = [];
|
|
@@ -614,42 +802,50 @@
|
|
|
614
802
|
Page.prototype.shouldNotHaveActivityIds = function () {
|
|
615
803
|
cy.location('search').should('not.contain', "?aup-interactions");
|
|
616
804
|
};
|
|
617
|
-
Page.prototype.
|
|
805
|
+
Page.prototype.shouldHaveTitle = function (title) {
|
|
806
|
+
cy.title().should('eq', title);
|
|
807
|
+
};
|
|
808
|
+
Page.prototype.shouldBeActive = function (withParameters) {
|
|
618
809
|
// Note: cy.window() doesn't return a promise... it's a chainable.
|
|
619
810
|
cy.window().then(function (window) {
|
|
620
811
|
cy['waitUntil'](function () {
|
|
621
812
|
return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
|
|
622
813
|
});
|
|
623
814
|
});
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
if (options && options.withTitle) {
|
|
634
|
-
cy.title().should('eq', options.withTitle);
|
|
815
|
+
if (withParameters) {
|
|
816
|
+
cy.location('pathname').then(function (path) {
|
|
817
|
+
var urlParams = exports.Path.extractVisitParameters(path);
|
|
818
|
+
Object.keys(withParameters).forEach(function (param) {
|
|
819
|
+
var expected = withParameters[param];
|
|
820
|
+
// @ts-ignore
|
|
821
|
+
expect(urlParams[param]).to.equal(expected);
|
|
822
|
+
});
|
|
823
|
+
});
|
|
635
824
|
}
|
|
636
825
|
};
|
|
637
826
|
return Page;
|
|
638
827
|
}(PageElement));
|
|
639
828
|
(function (Page) {
|
|
640
|
-
function create(
|
|
641
|
-
var
|
|
829
|
+
function create(pathOrPathBuilder, page) {
|
|
830
|
+
var pathBuilder = new exports.Path.Builder();
|
|
831
|
+
if (___namespace.isString(pathOrPathBuilder)) {
|
|
832
|
+
pathOrPathBuilder.split("/").filter(function (p) { return !___namespace.isEmpty(p); }).forEach(function (p) { return pathBuilder.segment(p); });
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
pathOrPathBuilder(pathBuilder);
|
|
836
|
+
}
|
|
837
|
+
var builder = new PageBuilder(pathBuilder.getPath());
|
|
642
838
|
return typescriptUtilities.Mixin.createProxy(page(builder), builder);
|
|
643
839
|
}
|
|
644
840
|
Page.create = create;
|
|
645
|
-
var
|
|
646
|
-
__extends(
|
|
647
|
-
function
|
|
841
|
+
var PageBuilder = /** @class */ (function (_super) {
|
|
842
|
+
__extends(PageBuilder, _super);
|
|
843
|
+
function PageBuilder() {
|
|
648
844
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
649
845
|
}
|
|
650
|
-
return
|
|
846
|
+
return PageBuilder;
|
|
651
847
|
}(exports.Section.Mixin(Page)));
|
|
652
|
-
Page.
|
|
848
|
+
Page.PageBuilder = PageBuilder;
|
|
653
849
|
})(exports.Page || (exports.Page = {}));
|
|
654
850
|
|
|
655
851
|
var AupCommandGroup = /** @class */ (function (_super) {
|
|
@@ -666,21 +862,28 @@
|
|
|
666
862
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
667
863
|
}
|
|
668
864
|
AupMoreMenu.create = function (parent) {
|
|
669
|
-
|
|
670
|
-
return new AupMoreMenu(finder);
|
|
865
|
+
return new AupMoreMenu(parent, 'aup-more-menu');
|
|
671
866
|
};
|
|
672
867
|
return AupMoreMenu;
|
|
673
868
|
}(PageElement));
|
|
674
869
|
|
|
675
870
|
var AupPopupMenu = /** @class */ (function (_super) {
|
|
676
871
|
__extends(AupPopupMenu, _super);
|
|
677
|
-
function AupPopupMenu() {
|
|
678
|
-
|
|
872
|
+
function AupPopupMenu(parentElementAccessor, face) {
|
|
873
|
+
var _this = this;
|
|
874
|
+
var accessor = AupCommandFace.createAccessor(face);
|
|
875
|
+
_this = _super.call(this, parentElementAccessor, {
|
|
876
|
+
findIn: function (parent) {
|
|
877
|
+
return accessor.findIn(parent).closest('button');
|
|
878
|
+
},
|
|
879
|
+
shouldNotExist: function (parent) {
|
|
880
|
+
accessor.shouldNotExist(parent);
|
|
881
|
+
}
|
|
882
|
+
}) || this;
|
|
883
|
+
return _this;
|
|
679
884
|
}
|
|
680
885
|
AupPopupMenu.create = function (parent, face) {
|
|
681
|
-
|
|
682
|
-
var buttonFinder = function () { return faceFinder().closest('button'); };
|
|
683
|
-
return new AupPopupMenu(buttonFinder);
|
|
886
|
+
return new AupPopupMenu(parent, face);
|
|
684
887
|
};
|
|
685
888
|
return AupPopupMenu;
|
|
686
889
|
}(PageElement));
|
|
@@ -713,6 +916,7 @@
|
|
|
713
916
|
exports.AupPopupMenu = AupPopupMenu;
|
|
714
917
|
exports.AupToolBar = AupToolBar;
|
|
715
918
|
exports.Button = Button;
|
|
919
|
+
exports.ButtonMixin = ButtonMixin;
|
|
716
920
|
exports.PageElement = PageElement;
|
|
717
921
|
|
|
718
922
|
Object.defineProperty(exports, '__esModule', { value: true });
|