@coolon/angular-ui-powerups 12.3.1 → 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.
Files changed (113) hide show
  1. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +297 -93
  2. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.js +408 -288
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/cypress/components/aup-command-face.d.ts +2 -5
  7. package/cypress/components/aup-command.d.ts +18 -4
  8. package/cypress/components/aup-navigation.d.ts +0 -1
  9. package/cypress/components/aup-popup-menu.d.ts +2 -0
  10. package/cypress/components/aup-table.d.ts +19 -0
  11. package/cypress/components/button-mixin.d.ts +17 -0
  12. package/cypress/components/button.d.ts +17 -3
  13. package/cypress/coolon-angular-ui-powerups-cypress.d.ts +1 -0
  14. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  15. package/cypress/exports.d.ts +3 -0
  16. package/cypress/page-element.d.ts +11 -2
  17. package/cypress/page.d.ts +16 -13
  18. package/cypress/path.d.ts +26 -0
  19. package/cypress/section.d.ts +8 -1
  20. package/esm2015/cypress/components/aup-command-face.js +20 -11
  21. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  22. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  23. package/esm2015/cypress/components/aup-command.js +10 -7
  24. package/esm2015/cypress/components/aup-command.js.map +1 -1
  25. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  26. package/esm2015/cypress/components/aup-more-menu.js +1 -2
  27. package/esm2015/cypress/components/aup-more-menu.js.map +1 -1
  28. package/esm2015/cypress/components/aup-more-menu.metadata.json +1 -1
  29. package/esm2015/cypress/components/aup-navigation.js +1 -5
  30. package/esm2015/cypress/components/aup-navigation.js.map +1 -1
  31. package/esm2015/cypress/components/aup-popup-menu.js +12 -3
  32. package/esm2015/cypress/components/aup-popup-menu.js.map +1 -1
  33. package/esm2015/cypress/components/aup-popup-menu.metadata.json +1 -1
  34. package/esm2015/cypress/components/aup-table.js +36 -0
  35. package/esm2015/cypress/components/aup-table.js.map +1 -0
  36. package/esm2015/cypress/components/aup-table.metadata.json +1 -0
  37. package/esm2015/cypress/components/button-mixin.js +15 -0
  38. package/esm2015/cypress/components/button-mixin.js.map +1 -0
  39. package/esm2015/cypress/components/button-mixin.metadata.json +1 -0
  40. package/esm2015/cypress/components/button.js +11 -7
  41. package/esm2015/cypress/components/button.js.map +1 -1
  42. package/esm2015/cypress/components/button.metadata.json +1 -1
  43. package/esm2015/cypress/coolon-angular-ui-powerups-cypress.js.map +1 -1
  44. package/esm2015/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  45. package/esm2015/cypress/exports.js +3 -0
  46. package/esm2015/cypress/exports.js.map +1 -1
  47. package/esm2015/cypress/exports.metadata.json +1 -1
  48. package/esm2015/cypress/page-element.js +21 -5
  49. package/esm2015/cypress/page-element.js.map +1 -1
  50. package/esm2015/cypress/page-element.metadata.json +1 -1
  51. package/esm2015/cypress/page.js +32 -22
  52. package/esm2015/cypress/page.js.map +1 -1
  53. package/esm2015/cypress/page.metadata.json +1 -1
  54. package/esm2015/cypress/path.js +61 -0
  55. package/esm2015/cypress/path.js.map +1 -0
  56. package/esm2015/cypress/path.metadata.json +1 -0
  57. package/esm2015/cypress/section.js +20 -10
  58. package/esm2015/cypress/section.js.map +1 -1
  59. package/esm2015/lib/components/switch-case/switch-case.component.js +7 -0
  60. package/esm2015/lib/components/switch-case/switch-case.component.js.map +1 -1
  61. package/esm2015/lib/components/switch-case/switch-case.component.metadata.json +1 -1
  62. package/esm2015/lib/components/tables/table/table.component.js +1 -1
  63. package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
  64. package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
  65. package/esm2015/lib/components/tables/tree-table/tree-table-component.js +1 -1
  66. package/esm2015/lib/components/tables/tree-table/tree-table-component.js.map +1 -1
  67. package/esm2015/lib/components/tables/tree-table/tree-table-component.metadata.json +1 -1
  68. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  69. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  70. package/esm2015/lib/place/guards/consolidated-param-map.js +7 -2
  71. package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
  72. package/esm2015/lib/place/guards/consolidated-param-map.metadata.json +1 -1
  73. package/esm2015/lib/place/guards/place.guard.js +1 -22
  74. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  75. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +24 -14
  76. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  77. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
  78. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
  79. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -1
  80. package/esm2015/lib/place/place-component.js +67 -5
  81. package/esm2015/lib/place/place-component.js.map +1 -1
  82. package/esm2015/lib/place/place-component.metadata.json +1 -1
  83. package/esm2015/lib/place/place-definition.js +3 -3
  84. package/esm2015/lib/place/place-definition.js.map +1 -1
  85. package/esm2015/lib/place/place-router.js +9 -4
  86. package/esm2015/lib/place/place-router.js.map +1 -1
  87. package/esm2015/lib/place/place-router.metadata.json +1 -1
  88. package/esm2015/lib/place/route/parameter-decorators.js +13 -14
  89. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  90. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  91. package/esm2015/lib/place/route/parameter-definition.js +21 -3
  92. package/esm2015/lib/place/route/parameter-definition.js.map +1 -1
  93. package/esm2015/lib/place/route/parameter-definition.metadata.json +1 -1
  94. package/esm2015/lib/place/route/visit-sanitiser.js +1 -1
  95. package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
  96. package/esm2015/lib/place/url-snapshot.js +30 -7
  97. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  98. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  99. package/esm2015/lib/place/visit.js +7 -7
  100. package/esm2015/lib/place/visit.js.map +1 -1
  101. package/esm2015/lib/place/visit.metadata.json +1 -1
  102. package/fesm2015/coolon-angular-ui-powerups-cypress.js +235 -74
  103. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  104. package/fesm2015/coolon-angular-ui-powerups.js +367 -267
  105. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  106. package/lib/components/switch-case/switch-case.component.d.ts +7 -0
  107. package/lib/place/guards/consolidated-param-map.d.ts +2 -2
  108. package/lib/place/navigation/place-component-deactivation-handler.d.ts +3 -1
  109. package/lib/place/place-component.d.ts +26 -3
  110. package/lib/place/route/parameter-definition.d.ts +8 -0
  111. package/lib/place/url-snapshot.d.ts +1 -0
  112. package/lib/place/visit.d.ts +4 -4
  113. package/package.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(rootElementAccessor) {
9
- this.rootElementAccessor = rootElementAccessor;
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
- return this.rootElementAccessor ? this.rootElementAccessor() : undefined;
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("be.visible");
59
+ this.should('be.visible');
26
60
  };
27
61
  PageElement.prototype.shouldNotBeVisible = function () {
28
- this.should("not.be.visible");
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 !== null && _super.apply(this, arguments) || this;
448
+ function AupCommandFace(parentElement, face) {
449
+ return _super.call(this, function () { return parentElement.element(); }, AupCommandFace.createAccessor(face)) || this;
349
450
  }
350
- AupCommandFace.create = function (parent, face) {
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 finder = function () { return face.text ?
358
- parent().contains("aup-command-face", face.text()) :
359
- face.icon ?
360
- parent().find("aup-icon[ng-reflect-icon=" + face.icon() + "]").closest('aup-command-face') :
361
- undefined; };
362
- return finder;
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
- var Button = /** @class */ (function (_super) {
368
- __extends(Button, _super);
369
- function Button() {
370
- return _super !== null && _super.apply(this, arguments) || this;
371
- }
372
- Button.prototype.click = function () {
373
- return this.element().click();
374
- };
375
- Button.prototype.shouldBeDisabled = function () {
376
- this.should("be.disabled");
377
- // this.should("have.css", "color", "rgba(0,0,0,0.26)")
378
- };
379
- return Button;
380
- }(PageElement));
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
- return _super !== null && _super.apply(this, arguments) || this;
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
- }(Button));
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.create(this, { text: function () { return label; } });
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().find(selector); });
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().contains(text); });
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().contains("button", text); });
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().find(selector !== null && selector !== void 0 ? selector : 'aup-string-input'); });
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().find(selector !== null && selector !== void 0 ? selector : 'aup-text-input'); });
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().find(selector !== null && selector !== void 0 ? selector : 'aup-password-input'); });
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().find(selector !== null && selector !== void 0 ? selector : 'aup-number-input'); });
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
- return AupCommand.create(this, face);
749
+ var _this = this;
750
+ return new AupCommand(function () { return _this.element(); }, face);
569
751
  };
570
752
  class_1.prototype.aupTabbedNavigation = function () {
571
- return AupNavigation.create(this, 'aup-tabbed-place-navigation');
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
- return AupNavigation.create(this, 'aup-list-place-nav');
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.shouldBeActive = function (options) {
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
- var bits = [this.path];
625
- // TODO: add support for parameter names...
626
- if (options && options.withParameters) {
627
- bits.push(";([^?]+)");
628
- }
629
- if (options && options.withActivities) {
630
- bits.push("?aup-interactions=" + options.withActivities.join('--') + ")");
631
- }
632
- cy.location('pathname').should('match', new RegExp("^" + bits.join('') + "$"));
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(path, page) {
641
- var builder = new Builder(path);
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 Builder = /** @class */ (function (_super) {
646
- __extends(Builder, _super);
647
- function Builder() {
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 Builder;
846
+ return PageBuilder;
651
847
  }(exports.Section.Mixin(Page)));
652
- Page.Builder = Builder;
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
- var finder = function () { return parent.element().contains('aup-more-menu'); };
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
- return _super !== null && _super.apply(this, arguments) || this;
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
- var faceFinder = AupCommandFace.createFinder(function () { return parent.element(); }, face);
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 });