@coolon/angular-ui-powerups 12.4.0-alpha.1 → 12.4.0-alpha.11

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 (86) 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 +363 -259
  4. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.js +2 -7
  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 +32 -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 +4 -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 +8 -0
  24. package/cypress/page-element.d.ts +5 -2
  25. package/cypress/page.d.ts +4 -30
  26. package/esm2015/cypress/builder.js +66 -0
  27. package/esm2015/cypress/builder.js.map +1 -0
  28. package/esm2015/cypress/builder.metadata.json +1 -0
  29. package/esm2015/cypress/components/aup-abstract-activity.js +11 -0
  30. package/esm2015/cypress/components/aup-abstract-activity.js.map +1 -0
  31. package/esm2015/cypress/components/aup-abstract-activity.metadata.json +1 -0
  32. package/esm2015/cypress/components/aup-activity.js +13 -0
  33. package/esm2015/cypress/components/aup-activity.js.map +1 -0
  34. package/esm2015/cypress/components/aup-activity.metadata.json +1 -0
  35. package/esm2015/cypress/components/aup-alert.js +13 -0
  36. package/esm2015/cypress/components/aup-alert.js.map +1 -0
  37. package/esm2015/cypress/components/aup-alert.metadata.json +1 -0
  38. package/esm2015/cypress/components/aup-command-face.js +20 -18
  39. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  40. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  41. package/esm2015/cypress/components/aup-command.js +25 -9
  42. package/esm2015/cypress/components/aup-command.js.map +1 -1
  43. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  44. package/esm2015/cypress/components/aup-empty-state.js +7 -0
  45. package/esm2015/cypress/components/aup-empty-state.js.map +1 -0
  46. package/esm2015/cypress/components/aup-empty-state.metadata.json +1 -0
  47. package/esm2015/cypress/components/aup-input.js +7 -7
  48. package/esm2015/cypress/components/aup-input.js.map +1 -1
  49. package/esm2015/cypress/components/aup-modal-activity.js +7 -0
  50. package/esm2015/cypress/components/aup-modal-activity.js.map +1 -0
  51. package/esm2015/cypress/components/aup-modal-activity.metadata.json +1 -0
  52. package/esm2015/cypress/components/aup-modal-alert.js +12 -0
  53. package/esm2015/cypress/components/aup-modal-alert.js.map +1 -0
  54. package/esm2015/cypress/components/aup-modal-alert.metadata.json +1 -0
  55. package/esm2015/cypress/components/aup-table.js.map +1 -1
  56. package/esm2015/cypress/components/aup-table.metadata.json +1 -1
  57. package/esm2015/cypress/components/button.js.map +1 -1
  58. package/esm2015/cypress/components/button.metadata.json +1 -1
  59. package/esm2015/cypress/exports.js +8 -1
  60. package/esm2015/cypress/exports.js.map +1 -1
  61. package/esm2015/cypress/exports.metadata.json +1 -1
  62. package/esm2015/cypress/page-builder.js +15 -0
  63. package/esm2015/cypress/page-builder.js.map +1 -0
  64. package/esm2015/cypress/page-builder.metadata.json +1 -0
  65. package/esm2015/cypress/page-element.js +9 -3
  66. package/esm2015/cypress/page-element.js.map +1 -1
  67. package/esm2015/cypress/page-element.metadata.json +1 -1
  68. package/esm2015/cypress/page.js +8 -10
  69. package/esm2015/cypress/page.js.map +1 -1
  70. package/esm2015/cypress/page.metadata.json +1 -1
  71. package/esm2015/cypress/path.js +3 -1
  72. package/esm2015/cypress/path.js.map +1 -1
  73. package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
  74. package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
  75. package/esm2015/lib/place/url-snapshot.js +1 -7
  76. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  77. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  78. package/fesm2015/coolon-angular-ui-powerups-cypress.js +264 -166
  79. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  80. package/fesm2015/coolon-angular-ui-powerups.js +2 -7
  81. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  82. package/package.json +1 -1
  83. package/cypress/section.d.ts +0 -49
  84. package/esm2015/cypress/section.js +0 -58
  85. package/esm2015/cypress/section.js.map +0 -1
  86. 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,126 @@
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 (matrixParams) {
396
- return this.segments.map(function (s) { return s.toUrlPart(matrixParams); }).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
+ AupEmptyState.prototype.shouldContainText = function (text) {
457
+ this.element().should("contain.text", text);
458
+ };
459
+ return AupEmptyState;
460
+ }(PageElement));
516
461
 
517
462
  exports.AupInput = /** @class */ (function (_super) {
518
463
  __extends(AupInput, _super);
@@ -530,21 +475,21 @@
530
475
  };
531
476
  Object.defineProperty(AupInput.prototype, "labelShould", {
532
477
  get: function () {
533
- return this.label().should;
478
+ return this.getShoulder(this.label());
534
479
  },
535
480
  enumerable: false,
536
481
  configurable: true
537
482
  });
538
483
  Object.defineProperty(AupInput.prototype, "hintShould", {
539
484
  get: function () {
540
- return this.hint().should;
485
+ return this.getShoulder(this.hint());
541
486
  },
542
487
  enumerable: false,
543
488
  configurable: true
544
489
  });
545
490
  Object.defineProperty(AupInput.prototype, "errorShould", {
546
491
  get: function () {
547
- return this.error().should;
492
+ return this.getShoulder(this.error());
548
493
  },
549
494
  enumerable: false,
550
495
  configurable: true
@@ -578,13 +523,9 @@
578
523
  input.type("" + value);
579
524
  this.input().should('have.value', "" + value);
580
525
  };
581
- Object.defineProperty(HtmlInput.prototype, "should", {
582
- get: function () {
583
- return this.input().should;
584
- },
585
- enumerable: false,
586
- configurable: true
587
- });
526
+ HtmlInput.prototype.getShouldElement = function () {
527
+ return this.input();
528
+ };
588
529
  return HtmlInput;
589
530
  }(AupInput));
590
531
  AupInput.HtmlInput = HtmlInput;
@@ -593,13 +534,9 @@
593
534
  function TextAreaInput() {
594
535
  return _super !== null && _super.apply(this, arguments) || this;
595
536
  }
596
- Object.defineProperty(TextAreaInput.prototype, "should", {
597
- get: function () {
598
- return this.input().should;
599
- },
600
- enumerable: false,
601
- configurable: true
602
- });
537
+ TextAreaInput.prototype.getShouldElement = function () {
538
+ return this.input();
539
+ };
603
540
  TextAreaInput.prototype.input = function () {
604
541
  return this.element().find('textarea');
605
542
  };
@@ -686,6 +623,27 @@
686
623
  AupTable.Cell = Cell;
687
624
  })(exports.AupTable || (exports.AupTable = {}));
688
625
 
626
+ function ButtonMixin(Base) {
627
+ return /** @class */ (function (_super) {
628
+ __extends(class_1, _super);
629
+ function class_1() {
630
+ var args = [];
631
+ for (var _i = 0; _i < arguments.length; _i++) {
632
+ args[_i] = arguments[_i];
633
+ }
634
+ return _super.apply(this, __spreadArray([], __read(args))) || this;
635
+ }
636
+ class_1.prototype.click = function () {
637
+ return this.element().click();
638
+ };
639
+ class_1.prototype.shouldBeDisabled = function () {
640
+ this.should("be.disabled");
641
+ // this.should("have.css", "color", "rgba(0,0,0,0.26)")
642
+ };
643
+ return class_1;
644
+ }(Base));
645
+ }
646
+
689
647
  var Button = /** @class */ (function (_super) {
690
648
  __extends(Button, _super);
691
649
  function Button(parentElementAccessor, buttonText) {
@@ -701,78 +659,222 @@
701
659
  return Button;
702
660
  }(ButtonMixin(PageElement)));
703
661
 
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;
662
+ var Builder = /** @class */ (function () {
663
+ function Builder(source) {
664
+ this.source = source;
665
+ }
666
+ Builder.prototype.find = function (selector) {
667
+ return new PageElement(this.source, selector);
668
+ };
669
+ Builder.prototype.section = function (selector, builder) {
670
+ return this.createContainerElement(PageElement, selector, builder);
671
+ };
672
+ Builder.prototype.contains = function (text) {
673
+ return new PageElement(this.source, {
674
+ findIn: function (parent) { return parent.contains(text); },
675
+ shouldNotExist: function (parent) { return parent.should('not.contain', text); }
676
+ });
677
+ };
678
+ Builder.prototype.button = function (text) {
679
+ return new Button(this.source, text);
680
+ };
681
+ Builder.prototype.aupStringInput = function (selector) {
682
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-string-input');
683
+ };
684
+ Builder.prototype.aupTextInput = function (selector) {
685
+ return new exports.AupInput.TextAreaInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-text-input');
686
+ };
687
+ Builder.prototype.aupPasswordInput = function (selector) {
688
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-password-input');
689
+ };
690
+ Builder.prototype.aupNumberInput = function (selector) {
691
+ return new exports.AupInput.HtmlInput(this.source, selector !== null && selector !== void 0 ? selector : 'aup-number-input');
692
+ };
693
+ Builder.prototype.aupCommand = function (faceOrSelector) {
694
+ return new AupCommand(this.source, faceOrSelector);
695
+ };
696
+ Builder.prototype.aupTabbedNavigation = function () {
697
+ return new AupNavigation(this.source, 'aup-tabbed-place-navigation');
698
+ };
699
+ Builder.prototype.aupSideNavigation = function () {
700
+ return new AupNavigation(this.source, 'aup-list-place-nav');
701
+ };
702
+ Builder.prototype.aupTable = function (selector) {
703
+ return new exports.AupTable(this.source, selector !== null && selector !== void 0 ? selector : 'aup-table');
704
+ };
705
+ Builder.prototype.aupEmptyState = function (selectorOrBuilder, optionalBuilder) {
706
+ return this.createContainerElement(AupEmptyState, selectorOrBuilder, optionalBuilder, 'aup-empty-state');
707
+ };
708
+ Builder.prototype.createContainerElement = function (klass, selectorOrBuilder, optionalBuilder, defaultSelector) {
709
+ var selector = ___namespace.isString(selectorOrBuilder) ? selectorOrBuilder : defaultSelector;
710
+ var builder = ___namespace.isFunction(selectorOrBuilder) ? selectorOrBuilder : optionalBuilder;
711
+ if (!selector) {
712
+ typescriptUtilities.lang.illegalState('This element requires a selector but none was provided');
713
+ }
714
+ var element = new klass(this.source, selector);
715
+ return builder ? typescriptUtilities.Mixin.createProxy(element, builder(new Builder(element))) : element;
716
+ };
717
+ return Builder;
718
+ }());
719
+
720
+ var AupAbstractActivity = /** @class */ (function (_super) {
721
+ __extends(AupAbstractActivity, _super);
722
+ function AupAbstractActivity(parent, selector) {
723
+ var _this = _super.call(this, parent, selector) || this;
724
+ _this.title = _this.find('aup-activity-title');
725
+ _this._confirmCommand = new Builder(_this).aupCommand('[data-cy=confirm-command]');
726
+ _this._cancelCommand = new Builder(_this).aupCommand('[data-cy=cancel-command]');
727
+ return _this;
728
+ }
729
+ return AupAbstractActivity;
730
+ }(PageElement));
731
+
732
+ var AupActivity = /** @class */ (function (_super) {
733
+ __extends(AupActivity, _super);
734
+ function AupActivity(parent, selector) {
735
+ return _super.call(this, parent, selector) || this;
736
+ }
737
+ Object.defineProperty(AupActivity.prototype, "confirmCommand", {
738
+ get: function () {
739
+ return this._confirmCommand;
740
+ },
741
+ enumerable: false,
742
+ configurable: true
743
+ });
744
+ Object.defineProperty(AupActivity.prototype, "cancelCommand", {
745
+ get: function () {
746
+ return this._cancelCommand;
747
+ },
748
+ enumerable: false,
749
+ configurable: true
750
+ });
751
+ return AupActivity;
752
+ }(AupAbstractActivity));
753
+
754
+ var AupModalActivity = /** @class */ (function (_super) {
755
+ __extends(AupModalActivity, _super);
756
+ function AupModalActivity() {
757
+ return _super !== null && _super.apply(this, arguments) || this;
758
+ }
759
+ AupModalActivity.prototype.clickBackdrop = function () {
760
+ this.element().closest(".cdk-overlay-backdrop").click(-50, -50, { force: true });
761
+ };
762
+ return AupModalActivity;
763
+ }(AupActivity));
764
+
765
+ var AupAlert = /** @class */ (function (_super) {
766
+ __extends(AupAlert, _super);
767
+ function AupAlert(parent, selector) {
768
+ return _super.call(this, parent, selector) || this;
769
+ }
770
+ Object.defineProperty(AupAlert.prototype, "closeCommand", {
771
+ get: function () {
772
+ return this._confirmCommand;
773
+ },
774
+ enumerable: false,
775
+ configurable: true
776
+ });
777
+ AupAlert.prototype.clickClose = function () {
778
+ this.closeCommand.click();
779
+ };
780
+ return AupAlert;
781
+ }(AupAbstractActivity));
782
+
783
+ var AupModalAlert = /** @class */ (function (_super) {
784
+ __extends(AupModalAlert, _super);
785
+ function AupModalAlert(parent, selector) {
786
+ return _super.call(this, parent, selector) || this;
787
+ }
788
+ AupModalAlert.prototype.clickBackdrop = function () {
789
+ this.element()
790
+ .closest(".cdk-overlay-container")
791
+ .find(".cdk-overlay-backdrop").click(-50, -50, { force: true });
792
+ };
793
+ return AupModalAlert;
794
+ }(AupAlert));
795
+
796
+ var PageBuilder = /** @class */ (function (_super) {
797
+ __extends(PageBuilder, _super);
798
+ function PageBuilder() {
799
+ return _super !== null && _super.apply(this, arguments) || this;
800
+ }
801
+ PageBuilder.prototype.aupModalActivity = function (selector, builder) {
802
+ return this.createContainerElement(AupModalActivity, ".dialog-interaction-context " + selector, builder);
803
+ };
804
+ PageBuilder.prototype.aupModalAlert = function (builder) {
805
+ return this.createContainerElement(AupModalAlert, ".dialog-interaction-context aup-alert-dialog", builder);
806
+ };
807
+ PageBuilder.prototype.aupModelConfirm = function (builder) {
808
+ return this.aupModalActivity("aup-confirm-dialog", builder);
809
+ };
810
+ return PageBuilder;
811
+ }(Builder));
812
+
813
+ var urlSerialiser = new router.DefaultUrlSerializer();
814
+ exports.Path = /** @class */ (function () {
815
+ function Path(segments) {
816
+ this.segments = segments;
817
+ }
818
+ Path.extractVisitParameters = function (url) {
819
+ var _a, _b;
820
+ var result = {};
821
+ var urlTree = urlSerialiser.parse(url);
822
+ var urlSegments = (_b = (_a = urlTree.root.children.primary) === null || _a === void 0 ? void 0 : _a.segments) !== null && _b !== void 0 ? _b : [];
823
+ urlSegments === null || urlSegments === void 0 ? void 0 : urlSegments.forEach(function (s) {
824
+ result = Object.assign(Object.assign({}, result), s.parameters);
825
+ });
826
+ return result;
827
+ };
828
+ Path.prototype.toUrl = function (matrixParams) {
829
+ return this.segments.map(function (s) { return s.toUrlPart(matrixParams); }).join('/');
830
+ };
831
+ return Path;
832
+ }());
833
+ (function (Path) {
834
+ function setUrlSerialiser(serialiser) {
835
+ urlSerialiser = serialiser;
836
+ }
837
+ Path.setUrlSerialiser = setUrlSerialiser;
838
+ var Segment = /** @class */ (function () {
839
+ function Segment(path, params) {
840
+ if (params === void 0) { params = {}; }
841
+ var _a;
842
+ this.path = path;
843
+ this.routeId = params === null || params === void 0 ? void 0 : params.routeId;
844
+ this.visitParams = (_a = params === null || params === void 0 ? void 0 : params.visitParams) !== null && _a !== void 0 ? _a : [];
845
+ }
846
+ Segment.prototype.toUrlPart = function (params) {
847
+ var path = this.path;
848
+ this.visitParams.forEach(function (p) {
849
+ var value = params[p];
850
+ if (value) {
851
+ path = path + ";" + p + "=" + value;
852
+ }
853
+ });
854
+ if (this.routeId && params[this.routeId]) {
855
+ path = path + '/' + params[this.routeId];
711
856
  }
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;
857
+ return path;
858
+ };
859
+ return Segment;
860
+ }());
861
+ Path.Segment = Segment;
862
+ var Builder = /** @class */ (function () {
863
+ function Builder() {
864
+ this.segments = [];
772
865
  }
773
- return Impl;
774
- }(Mixin(PageElement)));
775
- })(exports.Section || (exports.Section = {}));
866
+ Builder.prototype.segment = function (name, params) {
867
+ var builder = new Segment(name, params);
868
+ this.segments.push(builder);
869
+ return this;
870
+ };
871
+ Builder.prototype.getPath = function () {
872
+ return new Path(this.segments);
873
+ };
874
+ return Builder;
875
+ }());
876
+ Path.Builder = Builder;
877
+ })(exports.Path || (exports.Path = {}));
776
878
 
777
879
  exports.Page = /** @class */ (function (_super) {
778
880
  __extends(Page, _super);
@@ -809,8 +911,8 @@
809
911
  };
810
912
  Page.prototype.shouldBeActive = function (withParameters) {
811
913
  // Note: cy.window() doesn't return a promise... it's a chainable.
812
- cy.window().then(function (window) {
813
- cy['waitUntil'](function () {
914
+ cy['waitUntil'](function () {
915
+ return cy.window().then(function (window) {
814
916
  return window['aup.PlaceRouter'] && !window['aup.PlaceRouter'].isNavigating();
815
917
  });
816
918
  });
@@ -828,26 +930,19 @@
828
930
  return Page;
829
931
  }(PageElement));
830
932
  (function (Page) {
831
- function create(pathOrPathBuilder, page) {
933
+ function create(pathOrPathBuilder, builder) {
832
934
  var pathBuilder = new exports.Path.Builder();
833
935
  if (___namespace.isString(pathOrPathBuilder)) {
834
- pathOrPathBuilder.split("/").filter(function (p) { return !___namespace.isEmpty(p); }).forEach(function (p) { return pathBuilder.segment(p); });
936
+ pathOrPathBuilder.split('/').filter(function (p) { return !___namespace.isEmpty(p); }).forEach(function (p) { return pathBuilder.segment(p); });
835
937
  }
836
938
  else {
837
939
  pathOrPathBuilder(pathBuilder);
838
940
  }
839
- var builder = new PageBuilder(pathBuilder.getPath());
840
- return typescriptUtilities.Mixin.createProxy(page(builder), builder);
941
+ var instance = new Page(pathBuilder.getPath());
942
+ var content = builder(new PageBuilder(instance));
943
+ return typescriptUtilities.Mixin.createProxy(content, instance);
841
944
  }
842
945
  Page.create = create;
843
- var PageBuilder = /** @class */ (function (_super) {
844
- __extends(PageBuilder, _super);
845
- function PageBuilder() {
846
- return _super !== null && _super.apply(this, arguments) || this;
847
- }
848
- return PageBuilder;
849
- }(exports.Section.Mixin(Page)));
850
- Page.PageBuilder = PageBuilder;
851
946
  })(exports.Page || (exports.Page = {}));
852
947
 
853
948
  var AupCommandGroup = /** @class */ (function (_super) {
@@ -910,15 +1005,24 @@
910
1005
  * Generated bundle index. Do not edit.
911
1006
  */
912
1007
 
1008
+ exports.AupAbstractActivity = AupAbstractActivity;
1009
+ exports.AupActivity = AupActivity;
1010
+ exports.AupAlert = AupAlert;
913
1011
  exports.AupCommand = AupCommand;
914
1012
  exports.AupCommandFace = AupCommandFace;
915
1013
  exports.AupCommandGroup = AupCommandGroup;
1014
+ exports.AupEmptyState = AupEmptyState;
1015
+ exports.AupModalActivity = AupModalActivity;
1016
+ exports.AupModalAlert = AupModalAlert;
916
1017
  exports.AupMoreMenu = AupMoreMenu;
917
1018
  exports.AupNavigation = AupNavigation;
918
1019
  exports.AupPopupMenu = AupPopupMenu;
919
1020
  exports.AupToolBar = AupToolBar;
1021
+ exports.Builder = Builder;
920
1022
  exports.Button = Button;
921
1023
  exports.ButtonMixin = ButtonMixin;
1024
+ exports.FaceAccessor = FaceAccessor;
1025
+ exports.PageBuilder = PageBuilder;
922
1026
  exports.PageElement = PageElement;
923
1027
 
924
1028
  Object.defineProperty(exports, '__esModule', { value: true });