@coolon/angular-ui-powerups 12.4.0-alpha.0 → 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.
Files changed (90) hide show
  1. package/assets/empty-state.scss +11 -0
  2. package/assets/styles.scss +1 -0
  3. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +382 -263
  4. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.js +241 -251
  6. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  7. package/coolon-angular-ui-powerups.metadata.json +1 -1
  8. package/cypress/builder.d.ts +48 -0
  9. package/cypress/components/aup-abstract-activity.d.ts +8 -0
  10. package/cypress/components/aup-activity.d.ts +8 -0
  11. package/cypress/components/aup-alert.d.ts +8 -0
  12. package/cypress/components/aup-command-face.d.ts +7 -0
  13. package/cypress/components/aup-command.d.ts +6 -18
  14. package/cypress/components/aup-empty-state.d.ts +3 -0
  15. package/cypress/components/aup-input.d.ts +8 -8
  16. package/cypress/components/aup-modal-activity.d.ts +4 -0
  17. package/cypress/components/aup-modal-alert.d.ts +6 -0
  18. package/cypress/components/aup-table.d.ts +1 -2
  19. package/cypress/components/button-mixin.d.ts +3 -1
  20. package/cypress/components/button.d.ts +4 -2
  21. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  22. package/cypress/exports.d.ts +8 -1
  23. package/cypress/page-builder.d.ts +10 -0
  24. package/cypress/page-element.d.ts +5 -2
  25. package/cypress/page.d.ts +10 -32
  26. package/cypress/path.d.ts +1 -1
  27. package/esm2015/cypress/builder.js +80 -0
  28. package/esm2015/cypress/builder.js.map +1 -0
  29. package/esm2015/cypress/builder.metadata.json +1 -0
  30. package/esm2015/cypress/components/aup-abstract-activity.js +11 -0
  31. package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -0
  32. package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -0
  33. package/esm2015/cypress/components/aup-activity.js +13 -0
  34. package/esm2015/cypress/components/aup-activity.js.map +1 -0
  35. package/esm2015/cypress/components/aup-activity.metadata.json +1 -0
  36. package/esm2015/cypress/components/aup-alert.js +13 -0
  37. package/esm2015/cypress/components/aup-alert.js.map +1 -0
  38. package/esm2015/cypress/components/aup-alert.metadata.json +1 -0
  39. package/esm2015/cypress/components/aup-command-face.js +20 -18
  40. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  41. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  42. package/esm2015/cypress/components/aup-command.js +25 -9
  43. package/esm2015/cypress/components/aup-command.js.map +1 -1
  44. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  45. package/esm2015/cypress/components/aup-empty-state.js +4 -0
  46. package/esm2015/cypress/components/aup-empty-state.js.map +1 -0
  47. package/esm2015/cypress/components/aup-empty-state.metadata.json +1 -0
  48. package/esm2015/cypress/components/aup-input.js +7 -7
  49. package/esm2015/cypress/components/aup-input.js.map +1 -1
  50. package/esm2015/cypress/components/aup-modal-activity.js +7 -0
  51. package/esm2015/cypress/components/aup-modal-activity.js.map +1 -0
  52. package/esm2015/cypress/components/aup-modal-activity.metadata.json +1 -0
  53. package/esm2015/cypress/components/aup-modal-alert.js +12 -0
  54. package/esm2015/cypress/components/aup-modal-alert.js.map +1 -0
  55. package/esm2015/cypress/components/aup-modal-alert.metadata.json +1 -0
  56. package/esm2015/cypress/components/aup-table.js.map +1 -1
  57. package/esm2015/cypress/components/aup-table.metadata.json +1 -1
  58. package/esm2015/cypress/components/button.js.map +1 -1
  59. package/esm2015/cypress/components/button.metadata.json +1 -1
  60. package/esm2015/cypress/exports.js +8 -1
  61. package/esm2015/cypress/exports.js.map +1 -1
  62. package/esm2015/cypress/exports.metadata.json +1 -1
  63. package/esm2015/cypress/page-builder.js +20 -0
  64. package/esm2015/cypress/page-builder.js.map +1 -0
  65. package/esm2015/cypress/page-builder.metadata.json +1 -0
  66. package/esm2015/cypress/page-element.js +9 -3
  67. package/esm2015/cypress/page-element.js.map +1 -1
  68. package/esm2015/cypress/page-element.metadata.json +1 -1
  69. package/esm2015/cypress/page.js +13 -14
  70. package/esm2015/cypress/page.js.map +1 -1
  71. package/esm2015/cypress/page.metadata.json +1 -1
  72. package/esm2015/cypress/path.js +5 -3
  73. package/esm2015/cypress/path.js.map +1 -1
  74. package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
  75. package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
  76. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +3 -9
  77. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  78. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
  79. package/esm2015/lib/place/url-snapshot.js +1 -7
  80. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  81. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  82. package/fesm2015/coolon-angular-ui-powerups-cypress.js +284 -169
  83. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  84. package/fesm2015/coolon-angular-ui-powerups.js +225 -235
  85. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  86. package/package.json +1 -1
  87. package/cypress/section.d.ts +0 -49
  88. package/esm2015/cypress/section.js +0 -58
  89. package/esm2015/cypress/section.js.map +0 -1
  90. package/esm2015/cypress/section.metadata.json +0 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
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';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@coolon/typescript-utilities'), require('lodash'), require('@angular/router')) :
3
+ typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups/cypress', ['exports', '@coolon/typescript-utilities', 'lodash', '@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.typescriptUtilities, global._, global.ng.router));
5
+ }(this, (function (exports, typescriptUtilities, _, router) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -26,47 +26,6 @@
26
26
 
27
27
  var ___namespace = /*#__PURE__*/_interopNamespace(_);
28
28
 
29
- var PageElement = /** @class */ (function () {
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;
36
- }
37
- PageElement.prototype.element = function () {
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);
47
- };
48
- PageElement.prototype.click = function (text) {
49
- text ? this.element().contains(text).click() : this.element().click();
50
- };
51
- Object.defineProperty(PageElement.prototype, "should", {
52
- get: function () {
53
- return this.element().should;
54
- },
55
- enumerable: false,
56
- configurable: true
57
- });
58
- PageElement.prototype.shouldBeVisible = function () {
59
- this.should('be.visible');
60
- };
61
- PageElement.prototype.shouldNotBeVisible = function () {
62
- if (!this.elementAccessStrategy.shouldNotExist) {
63
- typescriptUtilities.lang.abstractMethod(this.constructor);
64
- }
65
- this.elementAccessStrategy.shouldNotExist(this.getParentElement());
66
- };
67
- return PageElement;
68
- }());
69
-
70
29
  /*! *****************************************************************************
71
30
  Copyright (c) Microsoft Corporation.
72
31
 
@@ -379,140 +338,123 @@
379
338
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
380
339
  }
381
340
 
382
- var urlSerialiser = new router.DefaultUrlSerializer();
383
- exports.Path = /** @class */ (function () {
384
- function Path(segments) {
385
- this.segments = segments;
341
+ var PageElement = /** @class */ (function () {
342
+ function PageElement(parent, selector) {
343
+ this.parentElementAccessor = parent instanceof PageElement ? function () { return parent.element(); } : parent;
344
+ this.elementAccessStrategy = ___namespace.isString(selector) ? {
345
+ findIn: function (p) { return p.find(selector); },
346
+ shouldNotExist: function (p) { return p.find(selector).should('not.exist'); }
347
+ } : selector;
386
348
  }
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;
349
+ PageElement.prototype.element = function () {
350
+ var parent = this.getParentElement();
351
+ return parent ? this.elementAccessStrategy.findIn(parent) : undefined;
394
352
  };
395
- Path.prototype.toUrl = function (params) {
396
- return this.segments.map(function (s) { return s.toUrlPart(params); }).join('/');
353
+ PageElement.prototype.getParentElement = function () {
354
+ return this.parentElementAccessor ? this.parentElementAccessor() : undefined;
397
355
  };
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 = [];
356
+ PageElement.prototype.find = function (selector) {
357
+ var _this = this;
358
+ return new PageElement(function () { return _this.element(); }, selector);
359
+ };
360
+ PageElement.prototype.click = function (text) {
361
+ text ? this.element().contains(text).click() : this.element().click();
362
+ };
363
+ Object.defineProperty(PageElement.prototype, "should", {
364
+ get: function () {
365
+ return this.getShoulder(this.getShouldElement());
366
+ },
367
+ enumerable: false,
368
+ configurable: true
369
+ });
370
+ PageElement.prototype.getShoulder = function (element) {
371
+ return element.should.bind(element);
372
+ };
373
+ PageElement.prototype.getShouldElement = function () {
374
+ return this.element();
375
+ };
376
+ PageElement.prototype.shouldBeVisible = function () {
377
+ this.should('be.visible');
378
+ };
379
+ PageElement.prototype.shouldNotBeVisible = function () {
380
+ if (!this.elementAccessStrategy.shouldNotExist) {
381
+ typescriptUtilities.lang.abstractMethod(this.constructor);
432
382
  }
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 = {}));
383
+ this.elementAccessStrategy.shouldNotExist(this.getParentElement());
384
+ };
385
+ return PageElement;
386
+ }());
445
387
 
388
+ var FaceAccessor = /** @class */ (function () {
389
+ function FaceAccessor(face) {
390
+ this.face = face;
391
+ }
392
+ FaceAccessor.prototype.findIn = function (parent) {
393
+ return this.face.text ?
394
+ parent.contains("aup-command-face", this.face.text()) :
395
+ this.face.icon ?
396
+ parent.find("aup-icon[ng-reflect-icon=" + this.face.icon() + "]").closest('aup-command-face') :
397
+ undefined;
398
+ };
399
+ FaceAccessor.prototype.shouldNotExist = function (parent) {
400
+ return this.face.text ?
401
+ parent.should('not.contain', "aup-command-face", this.face.text()) :
402
+ this.face.icon ?
403
+ parent.should('not.contain', "aup-icon[ng-reflect-icon=" + this.face.icon() + "]") :
404
+ undefined;
405
+ };
406
+ return FaceAccessor;
407
+ }());
446
408
  var AupCommandFace = /** @class */ (function (_super) {
447
409
  __extends(AupCommandFace, _super);
448
410
  function AupCommandFace(parentElement, face) {
449
411
  return _super.call(this, function () { return parentElement.element(); }, AupCommandFace.createAccessor(face)) || this;
450
412
  }
451
413
  AupCommandFace.createAccessor = function (face) {
452
- // AOT barfs if we return a lambda
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;
414
+ return new FaceAccessor(face);
470
415
  };
471
416
  return AupCommandFace;
472
417
  }(PageElement));
473
418
 
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
- }
494
-
495
419
  var AupCommand = /** @class */ (function (_super) {
496
420
  __extends(AupCommand, _super);
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");
421
+ function AupCommand(parent, faceOrSelector) {
422
+ return _super.call(this, parent, {
423
+ findIn: function (parentElement) {
424
+ if (___namespace.isString(faceOrSelector)) {
425
+ return parentElement.find(faceOrSelector);
426
+ }
427
+ else {
428
+ return AupCommandFace.createAccessor(faceOrSelector).findIn(parentElement).closest('aup-command');
429
+ }
430
+ },
431
+ shouldNotExist: function (parentElement) {
432
+ this.findIn(parentElement).should("not.exist");
503
433
  }
504
434
  }) || this;
505
- return _this;
506
435
  }
507
- Object.defineProperty(AupCommand.prototype, "should", {
508
- get: function () {
509
- return this.element().find('button').should;
510
- },
511
- enumerable: false,
512
- configurable: true
513
- });
436
+ AupCommand.prototype.click = function () {
437
+ this.getButton().click();
438
+ };
439
+ AupCommand.prototype.getShouldElement = function () {
440
+ return this.getButton();
441
+ };
442
+ AupCommand.prototype.shouldBeDisabled = function () {
443
+ this.getButton().should('be.disabled');
444
+ };
445
+ AupCommand.prototype.getButton = function () {
446
+ return this.element().find('button');
447
+ };
514
448
  return AupCommand;
515
- }(ButtonMixin(PageElement)));
449
+ }(PageElement));
450
+
451
+ var AupEmptyState = /** @class */ (function (_super) {
452
+ __extends(AupEmptyState, _super);
453
+ function AupEmptyState() {
454
+ return _super !== null && _super.apply(this, arguments) || this;
455
+ }
456
+ return AupEmptyState;
457
+ }(PageElement));
516
458
 
517
459
  exports.AupInput = /** @class */ (function (_super) {
518
460
  __extends(AupInput, _super);
@@ -530,21 +472,21 @@
530
472
  };
531
473
  Object.defineProperty(AupInput.prototype, "labelShould", {
532
474
  get: function () {
533
- return this.label().should;
475
+ return this.getShoulder(this.label());
534
476
  },
535
477
  enumerable: false,
536
478
  configurable: true
537
479
  });
538
480
  Object.defineProperty(AupInput.prototype, "hintShould", {
539
481
  get: function () {
540
- return this.hint().should;
482
+ return this.getShoulder(this.hint());
541
483
  },
542
484
  enumerable: false,
543
485
  configurable: true
544
486
  });
545
487
  Object.defineProperty(AupInput.prototype, "errorShould", {
546
488
  get: function () {
547
- return this.error().should;
489
+ return this.getShoulder(this.error());
548
490
  },
549
491
  enumerable: false,
550
492
  configurable: true
@@ -578,13 +520,9 @@
578
520
  input.type("" + value);
579
521
  this.input().should('have.value', "" + value);
580
522
  };
581
- Object.defineProperty(HtmlInput.prototype, "should", {
582
- get: function () {
583
- return this.input().should;
584
- },
585
- enumerable: false,
586
- configurable: true
587
- });
523
+ HtmlInput.prototype.getShouldElement = function () {
524
+ return this.input();
525
+ };
588
526
  return HtmlInput;
589
527
  }(AupInput));
590
528
  AupInput.HtmlInput = HtmlInput;
@@ -593,13 +531,9 @@
593
531
  function TextAreaInput() {
594
532
  return _super !== null && _super.apply(this, arguments) || this;
595
533
  }
596
- Object.defineProperty(TextAreaInput.prototype, "should", {
597
- get: function () {
598
- return this.input().should;
599
- },
600
- enumerable: false,
601
- configurable: true
602
- });
534
+ TextAreaInput.prototype.getShouldElement = function () {
535
+ return this.input();
536
+ };
603
537
  TextAreaInput.prototype.input = function () {
604
538
  return this.element().find('textarea');
605
539
  };
@@ -686,6 +620,27 @@
686
620
  AupTable.Cell = Cell;
687
621
  })(exports.AupTable || (exports.AupTable = {}));
688
622
 
623
+ function ButtonMixin(Base) {
624
+ return /** @class */ (function (_super) {
625
+ __extends(class_1, _super);
626
+ function class_1() {
627
+ var args = [];
628
+ for (var _i = 0; _i < arguments.length; _i++) {
629
+ args[_i] = arguments[_i];
630
+ }
631
+ return _super.apply(this, __spreadArray([], __read(args))) || this;
632
+ }
633
+ class_1.prototype.click = function () {
634
+ return this.element().click();
635
+ };
636
+ class_1.prototype.shouldBeDisabled = function () {
637
+ this.should("be.disabled");
638
+ // this.should("have.css", "color", "rgba(0,0,0,0.26)")
639
+ };
640
+ return class_1;
641
+ }(Base));
642
+ }
643
+
689
644
  var Button = /** @class */ (function (_super) {
690
645
  __extends(Button, _super);
691
646
  function Button(parentElementAccessor, buttonText) {
@@ -701,78 +656,240 @@
701
656
  return Button;
702
657
  }(ButtonMixin(PageElement)));
703
658
 
704
- exports.Section = void 0;
705
- (function (Section) {
706
- function Mixin(Base) {
707
- return /** @class */ (function (_super) {
708
- __extends(class_1, _super);
709
- function class_1() {
710
- return _super !== null && _super.apply(this, arguments) || this;
659
+ exports.Builder = /** @class */ (function () {
660
+ function Builder(source) {
661
+ this.source = source;
662
+ this._sectionFactory = Builder.createFactoryMethod(this.source, PageElement);
663
+ this.aupEmptyState = Builder.createFactoryMethod(this.source, AupEmptyState, 'aup-empty-state');
664
+ }
665
+ Builder.prototype.find = function (selector) {
666
+ return new PageElement(this.source, selector);
667
+ };
668
+ Builder.prototype.section = function (selector, builder) {
669
+ return this._sectionFactory(selector, builder);
670
+ };
671
+ Builder.prototype.contains = function (text) {
672
+ return new PageElement(this.source, {
673
+ findIn: function (parent) { return parent.contains(text); },
674
+ shouldNotExist: function (parent) { return parent.should('not.contain', text); }
675
+ });
676
+ };
677
+ Builder.prototype.button = function (text) {
678
+ return new Button(this.source, text);
679
+ };
680
+ Builder.prototype.aupStringInput = function (selector) {
681
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
682
+ };
683
+ Builder.prototype.aupTextInput = function (selector) {
684
+ return new exports.AupInput.TextAreaInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
685
+ };
686
+ Builder.prototype.aupPasswordInput = function (selector) {
687
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
688
+ };
689
+ Builder.prototype.aupNumberInput = function (selector) {
690
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
691
+ };
692
+ Builder.prototype.aupCommand = function (faceOrSelector) {
693
+ return new AupCommand(this.source, faceOrSelector);
694
+ };
695
+ Builder.prototype.aupTabbedNavigation = function () {
696
+ return new AupNavigation(this.source, 'aup-tabbed-place-navigation');
697
+ };
698
+ Builder.prototype.aupSideNavigation = function () {
699
+ return new AupNavigation(this.source, 'aup-list-place-nav');
700
+ };
701
+ Builder.prototype.aupTable = function (selector) {
702
+ return new exports.AupTable(this.source, selector !== null && selector !== void 0 ? selector : 'aup-table');
703
+ };
704
+ return Builder;
705
+ }());
706
+ (function (Builder) {
707
+ var Factory = /** @class */ (function () {
708
+ function Factory(parent, klass, defaultSelector) {
709
+ this.parent = parent;
710
+ this.klass = klass;
711
+ this.defaultSelector = defaultSelector;
712
+ }
713
+ Factory.prototype.create = function (selectorOrBuilder, optionalBuilder) {
714
+ var selector = ___namespace.isFunction(selectorOrBuilder) ? this.defaultSelector : selectorOrBuilder;
715
+ if (!selector) {
716
+ typescriptUtilities.lang.illegalState('This element requires a selector but none was provided');
711
717
  }
712
- class_1.prototype.section = function (selector, section) {
713
- var _this = this;
714
- var impl = new Impl(function () { return _this.element(); }, selector);
715
- return typescriptUtilities.Mixin.createProxy(section(impl), impl);
716
- };
717
- class_1.prototype.find = function (selector) {
718
- var _this = this;
719
- return new PageElement(function () { return _this.element(); }, selector);
720
- };
721
- class_1.prototype.contains = function (text) {
722
- var _this = this;
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
- });
727
- };
728
- class_1.prototype.button = function (text) {
729
- var _this = this;
730
- return new Button(function () { return _this.element(); }, text);
731
- };
732
- class_1.prototype.aupStringInput = function (selector) {
733
- var _this = this;
734
- return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
735
- };
736
- class_1.prototype.aupTextInput = function (selector) {
737
- var _this = this;
738
- return new exports.AupInput.TextAreaInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
739
- };
740
- class_1.prototype.aupPasswordInput = function (selector) {
741
- var _this = this;
742
- return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
743
- };
744
- class_1.prototype.aupNumberInput = function (selector) {
745
- var _this = this;
746
- return new exports.AupInput.HtmlInput(function () { return _this.element(); }, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
747
- };
748
- class_1.prototype.aupCommand = function (face) {
749
- var _this = this;
750
- return new AupCommand(function () { return _this.element(); }, face);
751
- };
752
- class_1.prototype.aupTabbedNavigation = function () {
753
- var _this = this;
754
- return new AupNavigation(function () { return _this.element(); }, 'aup-tabbed-place-navigation');
755
- };
756
- class_1.prototype.aupSideNavigation = function () {
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');
763
- };
764
- return class_1;
765
- }(Base));
766
- }
767
- Section.Mixin = Mixin;
768
- var Impl = /** @class */ (function (_super) {
769
- __extends(Impl, _super);
770
- function Impl() {
771
- return _super !== null && _super.apply(this, arguments) || this;
718
+ var callback = ___namespace.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
719
+ var element = new this.klass(this.parent, selector);
720
+ return callback ? typescriptUtilities.Mixin.createProxy(element, callback(new Builder(this.parent))) : element;
721
+ };
722
+ return Factory;
723
+ }());
724
+ Builder.Factory = Factory;
725
+ function createFactoryMethod(element, klass, defaultSelector) {
726
+ var factory = new Factory(element, klass, defaultSelector);
727
+ return factory.create.bind(factory);
728
+ }
729
+ Builder.createFactoryMethod = createFactoryMethod;
730
+ })(exports.Builder || (exports.Builder = {}));
731
+
732
+ var AupAbstractActivity = /** @class */ (function (_super) {
733
+ __extends(AupAbstractActivity, _super);
734
+ function AupAbstractActivity(parent, selector) {
735
+ var _this = _super.call(this, parent, selector) || this;
736
+ _this.title = _this.find('aup-activity-title');
737
+ _this._confirmCommand = new exports.Builder(_this).aupCommand('[data-cy=confirm-command]');
738
+ _this._cancelCommand = new exports.Builder(_this).aupCommand('[data-cy=cancel-command]');
739
+ return _this;
740
+ }
741
+ return AupAbstractActivity;
742
+ }(PageElement));
743
+
744
+ var AupActivity = /** @class */ (function (_super) {
745
+ __extends(AupActivity, _super);
746
+ function AupActivity(parent, selector) {
747
+ return _super.call(this, parent, selector) || this;
748
+ }
749
+ Object.defineProperty(AupActivity.prototype, "confirmCommand", {
750
+ get: function () {
751
+ return this._confirmCommand;
752
+ },
753
+ enumerable: false,
754
+ configurable: true
755
+ });
756
+ Object.defineProperty(AupActivity.prototype, "cancelCommand", {
757
+ get: function () {
758
+ return this._cancelCommand;
759
+ },
760
+ enumerable: false,
761
+ configurable: true
762
+ });
763
+ return AupActivity;
764
+ }(AupAbstractActivity));
765
+
766
+ var AupModalActivity = /** @class */ (function (_super) {
767
+ __extends(AupModalActivity, _super);
768
+ function AupModalActivity() {
769
+ return _super !== null && _super.apply(this, arguments) || this;
770
+ }
771
+ AupModalActivity.prototype.clickBackdrop = function () {
772
+ this.element().closest(".cdk-overlay-backdrop").click(-50, -50, { force: true });
773
+ };
774
+ return AupModalActivity;
775
+ }(AupActivity));
776
+
777
+ var AupAlert = /** @class */ (function (_super) {
778
+ __extends(AupAlert, _super);
779
+ function AupAlert(parent, selector) {
780
+ return _super.call(this, parent, selector) || this;
781
+ }
782
+ Object.defineProperty(AupAlert.prototype, "closeCommand", {
783
+ get: function () {
784
+ return this._confirmCommand;
785
+ },
786
+ enumerable: false,
787
+ configurable: true
788
+ });
789
+ AupAlert.prototype.clickClose = function () {
790
+ this.closeCommand.click();
791
+ };
792
+ return AupAlert;
793
+ }(AupAbstractActivity));
794
+
795
+ var AupModalAlert = /** @class */ (function (_super) {
796
+ __extends(AupModalAlert, _super);
797
+ function AupModalAlert(parent, selector) {
798
+ return _super.call(this, parent, selector) || this;
799
+ }
800
+ AupModalAlert.prototype.clickBackdrop = function () {
801
+ this.element()
802
+ .closest(".cdk-overlay-container")
803
+ .find(".cdk-overlay-backdrop").click(-50, -50, { force: true });
804
+ };
805
+ return AupModalAlert;
806
+ }(AupAlert));
807
+
808
+ var PageBuilder = /** @class */ (function (_super) {
809
+ __extends(PageBuilder, _super);
810
+ function PageBuilder() {
811
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
812
+ _this._modalInteractionFactory = exports.Builder.createFactoryMethod(_this.source, AupModalActivity);
813
+ _this._modalAlertFactory = exports.Builder.createFactoryMethod(_this.source, AupModalAlert);
814
+ return _this;
815
+ }
816
+ PageBuilder.prototype.aupModalActivity = function (selector, builder) {
817
+ return this._modalInteractionFactory(".dialog-interaction-context " + selector, builder);
818
+ };
819
+ PageBuilder.prototype.aupModalAlert = function (builder) {
820
+ return this._modalAlertFactory(".dialog-interaction-context aup-alert-dialog", builder);
821
+ };
822
+ PageBuilder.prototype.aupModelConfirm = function (builder) {
823
+ return this._modalInteractionFactory(".dialog-interaction-context aup-confirm-dialog", builder);
824
+ };
825
+ return PageBuilder;
826
+ }(exports.Builder));
827
+
828
+ var urlSerialiser = new router.DefaultUrlSerializer();
829
+ exports.Path = /** @class */ (function () {
830
+ function Path(segments) {
831
+ this.segments = segments;
832
+ }
833
+ Path.extractVisitParameters = function (url) {
834
+ var _a, _b;
835
+ var result = {};
836
+ var urlTree = urlSerialiser.parse(url);
837
+ var urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
838
+ urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(function (s) {
839
+ result = Object.assign(Object.assign({}, result), s.parameters);
840
+ });
841
+ return result;
842
+ };
843
+ Path.prototype.toUrl = function (matrixParams) {
844
+ return this.segments.map(function (s) { return s.toUrlPart(matrixParams); }).join('/');
845
+ };
846
+ return Path;
847
+ }());
848
+ (function (Path) {
849
+ function setUrlSerialiser(serialiser) {
850
+ urlSerialiser = serialiser;
851
+ }
852
+ Path.setUrlSerialiser = setUrlSerialiser;
853
+ var Segment = /** @class */ (function () {
854
+ function Segment(path, params) {
855
+ if (params === void 0) { params = {}; }
856
+ var _a;
857
+ this.path = path;
858
+ this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
859
+ this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
772
860
  }
773
- return Impl;
774
- }(Mixin(PageElement)));
775
- })(exports.Section || (exports.Section = {}));
861
+ Segment.prototype.toUrlPart = function (params) {
862
+ var path = this.path;
863
+ this.visitParams.forEach(function (p) {
864
+ var value = params[p];
865
+ if (value) {
866
+ path = path + ";" + p + "=" + value;
867
+ }
868
+ });
869
+ if (this.routeId && params[this.routeId]) {
870
+ path = path + '/' + params[this.routeId];
871
+ }
872
+ return path;
873
+ };
874
+ return Segment;
875
+ }());
876
+ Path.Segment = Segment;
877
+ var Builder = /** @class */ (function () {
878
+ function Builder() {
879
+ this.segments = [];
880
+ }
881
+ Builder.prototype.segment = function (name, params) {
882
+ var builder = new Segment(name, params);
883
+ this.segments.push(builder);
884
+ return this;
885
+ };
886
+ Builder.prototype.getPath = function () {
887
+ return new Path(this.segments);
888
+ };
889
+ return Builder;
890
+ }());
891
+ Path.Builder = Builder;
892
+ })(exports.Path || (exports.Path = {}));
776
893
 
777
894
  exports.Page = /** @class */ (function (_super) {
778
895
  __extends(Page, _super);
@@ -785,12 +902,14 @@
785
902
  Page.prototype.element = function () {
786
903
  return cy.get(this.rootElementSelector);
787
904
  };
788
- Page.prototype.visit = function (params) {
789
- this.tryAndVisit(params);
790
- this.shouldBeActive(params);
905
+ Page.prototype.visit = function (visitParams, queryParams) {
906
+ this.tryAndVisit(visitParams, queryParams);
907
+ this.shouldBeActive(visitParams);
791
908
  };
792
- Page.prototype.tryAndVisit = function (params) {
793
- cy.visit("/" + this.path.toUrl(params !== null && params !== void 0 ? params : {}));
909
+ Page.prototype.tryAndVisit = function (params, queryParams) {
910
+ var path = this.path.toUrl(params !== null && params !== void 0 ? params : {});
911
+ var queryString = queryParams ? "?" + new URLSearchParams(queryParams).toString() : '';
912
+ cy.visit("/" + path + queryString);
794
913
  };
795
914
  Page.prototype.shouldHaveActivityIds = function () {
796
915
  var ids = [];
@@ -807,8 +926,8 @@
807
926
  };
808
927
  Page.prototype.shouldBeActive = function (withParameters) {
809
928
  // Note: cy.window() doesn't return a promise... it's a chainable.
810
- cy.window().then(function (window) {
811
- cy['waitUntil'](function () {
929
+ cy['waitUntil'](function () {
930
+ return cy.window().then(function (window) {
812
931
  return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
813
932
  });
814
933
  });
@@ -829,23 +948,15 @@
829
948
  function create(pathOrPathBuilder, page) {
830
949
  var pathBuilder = new exports.Path.Builder();
831
950
  if (___namespace.isString(pathOrPathBuilder)) {
832
- pathOrPathBuilder.split("/").filter(function (p) { return !___namespace.isEmpty(p); }).forEach(function (p) { return pathBuilder.segment(p); });
951
+ pathOrPathBuilder.split('/').filter(function (p) { return !___namespace.isEmpty(p); }).forEach(function (p) { return pathBuilder.segment(p); });
833
952
  }
834
953
  else {
835
954
  pathOrPathBuilder(pathBuilder);
836
955
  }
837
- var builder = new PageBuilder(pathBuilder.getPath());
838
- return typescriptUtilities.Mixin.createProxy(page(builder), builder);
956
+ var instance = new Page(pathBuilder.getPath());
957
+ return typescriptUtilities.Mixin.createProxy(page(new PageBuilder(instance)), instance);
839
958
  }
840
959
  Page.create = create;
841
- var PageBuilder = /** @class */ (function (_super) {
842
- __extends(PageBuilder, _super);
843
- function PageBuilder() {
844
- return _super !== null && _super.apply(this, arguments) || this;
845
- }
846
- return PageBuilder;
847
- }(exports.Section.Mixin(Page)));
848
- Page.PageBuilder = PageBuilder;
849
960
  })(exports.Page || (exports.Page = {}));
850
961
 
851
962
  var AupCommandGroup = /** @class */ (function (_super) {
@@ -908,15 +1019,23 @@
908
1019
  * Generated bundle index. Do not edit.
909
1020
  */
910
1021
 
1022
+ exports.AupAbstractActivity = AupAbstractActivity;
1023
+ exports.AupActivity = AupActivity;
1024
+ exports.AupAlert = AupAlert;
911
1025
  exports.AupCommand = AupCommand;
912
1026
  exports.AupCommandFace = AupCommandFace;
913
1027
  exports.AupCommandGroup = AupCommandGroup;
1028
+ exports.AupEmptyState = AupEmptyState;
1029
+ exports.AupModalActivity = AupModalActivity;
1030
+ exports.AupModalAlert = AupModalAlert;
914
1031
  exports.AupMoreMenu = AupMoreMenu;
915
1032
  exports.AupNavigation = AupNavigation;
916
1033
  exports.AupPopupMenu = AupPopupMenu;
917
1034
  exports.AupToolBar = AupToolBar;
918
1035
  exports.Button = Button;
919
1036
  exports.ButtonMixin = ButtonMixin;
1037
+ exports.FaceAccessor = FaceAccessor;
1038
+ exports.PageBuilder = PageBuilder;
920
1039
  exports.PageElement = PageElement;
921
1040
 
922
1041
  Object.defineProperty(exports, '__esModule', { value: true });