@fkui/vue 5.36.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.
@@ -0,0 +1,1692 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/pageobjects.ts
21
+ var pageobjects_exports = {};
22
+ __export(pageobjects_exports, {
23
+ AlertScreenReaderPageObject: () => AlertScreenReaderPageObject,
24
+ CalendarPageObject: () => CalendarPageObject,
25
+ FBadgePageObject: () => FBadgePageObject,
26
+ FCalenderDayPageobject: () => FCalenderDayPageobject,
27
+ FCheckboxFieldPageObject: () => FCheckboxFieldPageObject,
28
+ FCheckboxGroupFieldPageObject: () => FCheckboxFieldPageObject,
29
+ FCheckboxGroupPageObject: () => FCheckboxGroupPageObject,
30
+ FContextMenuPageObject: () => FContextMenuPageObject,
31
+ FCrudDatasetPageObject: () => FCrudDatasetPageObject,
32
+ FDatepickerFieldPageobject: () => FDatepickerFieldPageobject,
33
+ FDialogueTreeItemPageObject: () => FDialogueTreeItemPageObject,
34
+ FDialogueTreePageObject: () => FDialogueTreePageObject,
35
+ FErrorListPageObject: () => FErrorListPageObject,
36
+ FExpandablePanelPageObject: () => FExpandablePanelPageObject,
37
+ FFieldsetPageObject: () => FFieldsetPageObject,
38
+ FFileItemPageObject: () => FFileItemPageObject,
39
+ FFileSelectorPageObject: () => FFileSelectorPageObject,
40
+ FFormModalPageObject: () => FFormModalPageObject,
41
+ FFormPageObject: () => FFormPageObject,
42
+ FFormStepPageObject: () => FFormStepPageObject,
43
+ FInteractiveTablePageObject: () => FInteractiveTablePageObject,
44
+ FLabelPageObject: () => FLabelPageObject,
45
+ FListItemPageObject: () => FListItemPageObject,
46
+ FListPageObject: () => FListPageObject,
47
+ FLoaderPageObject: () => FLoaderPageObject,
48
+ FMessageBoxPageObject: () => FMessageBoxPageObject,
49
+ FModalPageObject: () => FModalPageObject,
50
+ FNavigationMenuPageobject: () => FNavigationMenuPageobject,
51
+ FOfflinePageObject: () => FOfflinePageObject,
52
+ FOutputFieldPageobject: () => FOutputFieldPageobject,
53
+ FPageHeaderPageobject: () => FPageHeaderPageobject,
54
+ FProgressbarPageObject: () => FProgressbarPageObject,
55
+ FRadioFieldPageObject: () => FRadioFieldPageObject,
56
+ FRadioGroupFieldPageObject: () => FRadioFieldPageObject,
57
+ FRadioGroupPageObject: () => FRadioGroupPageObject,
58
+ FSelectFieldPageObject: () => FSelectFieldPageObject,
59
+ FSortFilterDatasetPageObject: () => FSortFilterDatasetPageObject,
60
+ FStaticFieldPageObject: () => FStaticFieldPageObject,
61
+ FTableColumnPageObject: () => FTableColumnPageObject,
62
+ FTextFieldPageObject: () => FTextFieldPageObject,
63
+ FTextareaFieldPageObject: () => FTextareaFieldPageObject,
64
+ FTooltipPageObject: () => FTooltipPageObject,
65
+ FValidationFormPageObject: () => FValidationFormPageObject,
66
+ FWizardPageobject: () => FWizardPageobject,
67
+ FWizardStepHeaderPageobject: () => FWizardStepHeaderPageobject,
68
+ FWizardStepPageobject: () => FWizardStepPageobject,
69
+ ICalendarNavbarPageObject: () => ICalendarNavbarPageObject,
70
+ IMenuPageObject: () => IMenuPageObject,
71
+ IPopupMenuPageObject: () => IPopupMenuPageObject,
72
+ IPopupPageObject: () => IPopupPageObject,
73
+ Input: () => Input,
74
+ STATUS: () => STATUS,
75
+ dayType: () => dayType
76
+ });
77
+ module.exports = __toCommonJS(pageobjects_exports);
78
+
79
+ // src/pageobject/FCalenderDay.pageobject.ts
80
+ var dayType = /* @__PURE__ */ ((dayType2) => {
81
+ dayType2["day"] = "calendar-day";
82
+ dayType2["highlight"] = "calendar-day--highlight";
83
+ dayType2["selected"] = "calendar-day--selected";
84
+ dayType2["disabled"] = "calendar-day--disabled";
85
+ return dayType2;
86
+ })(dayType || {});
87
+ var FCalenderDayPageobject = class {
88
+ constructor(selector) {
89
+ this.selector = selector;
90
+ }
91
+ el() {
92
+ return cy.get(this.selector);
93
+ }
94
+ number() {
95
+ return cy.get(`${this.selector}>span:first`);
96
+ }
97
+ srOnly() {
98
+ return cy.get(`${this.selector}>.sr-only`);
99
+ }
100
+ button() {
101
+ return this.el().parent("button");
102
+ }
103
+ click() {
104
+ return this.button().click();
105
+ }
106
+ };
107
+
108
+ // src/pageobject/trimmed-text.ts
109
+ function getText(subject) {
110
+ if (subject !== void 0) {
111
+ return subject.get(0).innerText.replace(/[\n]/gm, "").replace(/\s+/g, " ").replace(/(^\s|\s$)*/g, "");
112
+ } else {
113
+ return "";
114
+ }
115
+ }
116
+ function trimmedText(subject, options = {}) {
117
+ const resolveText = () => {
118
+ return Cypress.Promise.try(getText, subject).then((value) => {
119
+ return cy.verifyUpcomingAssertions(value, options, {
120
+ onRetry: resolveText
121
+ });
122
+ });
123
+ };
124
+ return resolveText();
125
+ }
126
+ Cypress.Commands.add(
127
+ "__fkui_internal_trimmedText",
128
+ { prevSubject: "element" },
129
+ trimmedText
130
+ );
131
+
132
+ // src/pageobject/FBadge.pageobject.ts
133
+ var FBadgePageObject = class {
134
+ /**
135
+ * @param selector - the root of the badge.
136
+ */
137
+ constructor(selector) {
138
+ this.selector = selector;
139
+ }
140
+ el() {
141
+ return cy.get(this.selector);
142
+ }
143
+ /**
144
+ * @deprecated Use assertion `label().should('trimmedText', '...')` instead.
145
+ */
146
+ trimmedText() {
147
+ return this.el().__fkui_internal_trimmedText();
148
+ }
149
+ status() {
150
+ return this.el().then(
151
+ (el) => el[0].className.replace(/.*badge--(\w+).*/, "$1")
152
+ );
153
+ }
154
+ isInverted() {
155
+ return this.el().then(
156
+ (el) => el[0].className.replace(/.*badge--(\w+)-(\w+).*/, "$2") === "inverted"
157
+ );
158
+ }
159
+ };
160
+
161
+ // src/pageobject/FCheckboxField.pageobject.ts
162
+ var FCheckboxFieldPageObject = class {
163
+ /**
164
+ * @param selector - the root of the checkbox, usually `<div class="checkbox">...</div>`.
165
+ * @param index - the index of matched radiobuttons
166
+ */
167
+ constructor(selector, index) {
168
+ if (index) {
169
+ this.selector = `${selector}:nth(${index})`;
170
+ } else {
171
+ this.selector = selector;
172
+ }
173
+ this.el = () => cy.get(this.selector);
174
+ }
175
+ checkbox() {
176
+ return cy.get(`${this.selector} input`);
177
+ }
178
+ label() {
179
+ return cy.get(`${this.selector} .checkbox__label`);
180
+ }
181
+ /**
182
+ * @deprecated Use assertion `label().should('trimmedText', '...')` instead.
183
+ */
184
+ trimmedText() {
185
+ return cy.get(`${this.selector} label`).__fkui_internal_trimmedText();
186
+ }
187
+ select() {
188
+ return this.label().click();
189
+ }
190
+ isSelected() {
191
+ return this.checkbox().then((el) => {
192
+ return el.get(0).checked;
193
+ });
194
+ }
195
+ value() {
196
+ return this.checkbox().then((el) => {
197
+ return el.get(0).value;
198
+ });
199
+ }
200
+ details() {
201
+ return cy.get(`${this.selector} .checkbox__details`);
202
+ }
203
+ };
204
+
205
+ // src/pageobject/FLabel.pageobject.ts
206
+ var FLabelPageObject = class {
207
+ /**
208
+ * @param selector - the root of the label, usually `<label class="label">...</label>`.
209
+ */
210
+ constructor(selector) {
211
+ this.selector = selector;
212
+ this.el = () => cy.get(this.selector);
213
+ }
214
+ /**
215
+ * Label heading
216
+ */
217
+ trimmedText() {
218
+ return this.el().then((el) => {
219
+ const textNode = el.get(0).childNodes[0];
220
+ if (!textNode.wholeText) {
221
+ return "";
222
+ }
223
+ return textNode.wholeText.replace(/[\n\r]/gm, "").replace(/\s+/g, " ").replace(/(^\s|\s$)*/g, "");
224
+ });
225
+ }
226
+ /**
227
+ * Hjälptext
228
+ */
229
+ description() {
230
+ return cy.get(`${this.selector} .label__description`);
231
+ }
232
+ /**
233
+ * ErrorIcon
234
+ */
235
+ errorIcon() {
236
+ return cy.get(`${this.selector} .icon.label__icon--left.f-icon-error`);
237
+ }
238
+ /**
239
+ * Formatbeskrivning
240
+ */
241
+ discreteDescription() {
242
+ return cy.get(
243
+ `${this.selector} .label__description.label__description--discrete`
244
+ );
245
+ }
246
+ /**
247
+ * Felmeddelande
248
+ */
249
+ errorMessage() {
250
+ return cy.get(`${this.selector} .label__message.label__message--error`);
251
+ }
252
+ };
253
+
254
+ // src/pageobject/FTooltip.pageobject.ts
255
+ var FTooltipPageObject = class {
256
+ /**
257
+ * @param selector - the root of the tooltip
258
+ */
259
+ constructor(selector) {
260
+ this.selector = selector;
261
+ }
262
+ el() {
263
+ return cy.get(this.selector);
264
+ }
265
+ iButton() {
266
+ return cy.get(`${this.selector} .tooltip__button`);
267
+ }
268
+ header() {
269
+ return cy.get(`${this.selector} .tooltip__header`);
270
+ }
271
+ body() {
272
+ return cy.get(`${this.selector} .tooltip__body`);
273
+ }
274
+ closeButton() {
275
+ return cy.get(`${this.selector} .close-button`);
276
+ }
277
+ /**
278
+ * @deprecated Use `closeButton()`, `header()`, or `body()` instead.
279
+ */
280
+ content() {
281
+ return {
282
+ closeButtonTop: () => cy.get(`${this.selector} .close-button`),
283
+ closeButtonBottom: () => cy.get(`${this.selector} .close-button`),
284
+ heading: () => cy.get(`${this.selector} .tooltip__content .tooltip__header`),
285
+ brodtext: () => cy.get(`${this.selector} .tooltip__content .tooltip__body`)
286
+ };
287
+ }
288
+ };
289
+
290
+ // src/pageobject/FCheckboxGroup.pageobject.ts
291
+ var FCheckboxGroupPageObject = class {
292
+ /**
293
+ * @param selector - the root of the checkbox group, usually `<div class="checkbox-group">...</div>`.
294
+ */
295
+ constructor(selector) {
296
+ this.selector = selector;
297
+ this.el = () => cy.get(this.selector);
298
+ this.label = new FLabelPageObject(`${this.selector} legend.label`);
299
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
300
+ }
301
+ content() {
302
+ return cy.get(`${this.selector} .checkbox-group__content`);
303
+ }
304
+ checkBox(checkboxSelector) {
305
+ return new FCheckboxFieldPageObject(
306
+ `${this.selector} ${checkboxSelector}`
307
+ );
308
+ }
309
+ numberOfCheckboxes() {
310
+ return cy.get(`${this.selector} input`).then((el) => {
311
+ return el.length;
312
+ });
313
+ }
314
+ };
315
+
316
+ // src/pageobject/FContextMenu.pageobject.ts
317
+ var FContextMenuPageObject = class {
318
+ el() {
319
+ return cy.get(this.selector);
320
+ }
321
+ /**
322
+ * @param selector - the root of the page header, usually `<nav class="contextmenu">...</nav>`.
323
+ */
324
+ constructor(selector) {
325
+ this.selector = selector;
326
+ }
327
+ /**
328
+ * Get all items in the FContextMenu
329
+ * @returns all items
330
+ */
331
+ items() {
332
+ return cy.get(`${this.selector} .contextmenu__list__item`);
333
+ }
334
+ /**
335
+ * Get the item at position index in the FContextMenu
336
+ *
337
+ * @param index - the position index in the item array
338
+ * @returns Menu item with given index
339
+ */
340
+ item(index) {
341
+ return this.items().eq(index);
342
+ }
343
+ /**
344
+ * Get link for item at index
345
+ *
346
+ * @param index - the position index in the item array
347
+ * @returns link with given index
348
+ */
349
+ getItemLink(index) {
350
+ return cy.get(
351
+ `${this.selector} .contextmenu__list__item a:nth(${index})`
352
+ );
353
+ }
354
+ };
355
+
356
+ // src/pageobject/FErrorList.pageobject.ts
357
+ var FErrorListPageObject = class {
358
+ /**
359
+ * @param selector - the root of the errorlist.
360
+ */
361
+ constructor(selector) {
362
+ this.selector = selector;
363
+ this.el = () => cy.get(this.selector);
364
+ }
365
+ /**
366
+ * Get `li` elements. Verify count using `.should("have.length", N)`.
367
+ */
368
+ listItems() {
369
+ return cy.get(`${this.selector} li`);
370
+ }
371
+ /**
372
+ * Get `a` elements. Verify count using `.should("have.length", N)`.
373
+ */
374
+ links() {
375
+ return cy.get(`${this.selector} a`);
376
+ }
377
+ getLink(index) {
378
+ return cy.get(`${this.selector} a:nth(${index})`);
379
+ }
380
+ getLinkByName(error) {
381
+ let link = () => cy.get(`${this.selector} ${error}`);
382
+ return cy.get(`${this.selector} a`).each((el) => {
383
+ if (el.get(0).innerText.trim() === error) {
384
+ link = () => el.get(0);
385
+ }
386
+ }).then(() => {
387
+ return link();
388
+ });
389
+ }
390
+ hasError(error) {
391
+ let hasSelectedError = false;
392
+ return cy.get(`${this.selector} li`).each((el) => {
393
+ if (el.get(0).innerText.trim() === error) {
394
+ hasSelectedError = true;
395
+ }
396
+ }).then(() => {
397
+ return hasSelectedError;
398
+ });
399
+ }
400
+ };
401
+
402
+ // src/pageobject/FValidationForm.pageobject.ts
403
+ var FValidationFormPageObject = class {
404
+ /**
405
+ * @param selector - the root of the validation form.
406
+ */
407
+ constructor(selector) {
408
+ this.selector = selector;
409
+ this.errorlist = new FErrorListPageObject(
410
+ `${this.selector} .error-list`
411
+ );
412
+ }
413
+ el() {
414
+ return cy.get(this.selector);
415
+ }
416
+ };
417
+
418
+ // src/pageobject/FCrudDataset.pageobject.ts
419
+ var FCrudDatasetPageObject = class {
420
+ constructor(selector) {
421
+ this.selector = selector;
422
+ this.el = () => cy.get(this.selector);
423
+ this.form = new FValidationFormPageObject(`${this.selector} form`);
424
+ }
425
+ addButton() {
426
+ return cy.get(
427
+ `${this.selector} [data-test="f-crud-dataset-add-button"]`
428
+ );
429
+ }
430
+ cancelButton() {
431
+ return cy.get(
432
+ `${this.selector} .modal__footer > .button-group > .button--secondary`
433
+ );
434
+ }
435
+ confirmButton() {
436
+ return cy.get(
437
+ `${this.selector} .modal__footer > .button-group > .button--primary`
438
+ );
439
+ }
440
+ };
441
+
442
+ // src/pageobject/FExpandablePanel.pageobject.ts
443
+ var FExpandablePanelPageObject = class {
444
+ /**
445
+ * @param selector - the root of the expandablepanel, usually `<div class="expandable-panel">...</div>`.
446
+ */
447
+ constructor(selector) {
448
+ this.selector = selector;
449
+ this.el = () => cy.get(this.selector);
450
+ this.expandCollapseIcon = () => cy.get(`${this.selector} .expandable-panel__icon`);
451
+ this.header = () => cy.get(`${this.selector} .expandable-panel__heading button`);
452
+ this.notificationIcon = () => cy.get(
453
+ `${this.selector} .expandable-panel__heading .expandable-panel__notification`
454
+ );
455
+ this.body = () => cy.get(`${this.selector} .expandable-panel__body`);
456
+ this.relatedInfo = () => cy.get(`${this.selector} .expandable-panel__outside`);
457
+ }
458
+ /**
459
+ * Returns the number of notifications
460
+ */
461
+ numberOfNotifications() {
462
+ let nrOfNotifications = 0;
463
+ this.notificationIcon().invoke("text").then(
464
+ (text) => text.replace(/(\d+)/, (match, matchGroup1) => {
465
+ nrOfNotifications = parseInt(matchGroup1, 10);
466
+ return matchGroup1;
467
+ })
468
+ );
469
+ return cy.wrap("Count number of notifications").then(() => {
470
+ return nrOfNotifications;
471
+ });
472
+ }
473
+ isOpen() {
474
+ let isPanelOpen = false;
475
+ this.el().invoke("attr", "class").then((classes) => {
476
+ const panelClasses = classes ? classes.split(" ") : [];
477
+ isPanelOpen = panelClasses.includes(
478
+ "expandable-panel--expanded"
479
+ );
480
+ });
481
+ return cy.wrap("Check if panel is expanded").then(() => {
482
+ return isPanelOpen;
483
+ });
484
+ }
485
+ };
486
+
487
+ // src/pageobject/FRadioField.pageobject.ts
488
+ var FRadioFieldPageObject = class {
489
+ /**
490
+ * @param selector - the root of the radio button, usually `<div class="radio-button">...</div>`.
491
+ * @param index - the index of matched radiobuttons
492
+ */
493
+ constructor(selector, index) {
494
+ if (index) {
495
+ this.selector = `${selector}:nth(${index})`;
496
+ } else {
497
+ this.selector = selector;
498
+ }
499
+ this.el = () => cy.get(this.selector);
500
+ }
501
+ radioButton() {
502
+ return cy.get(`${this.selector} input`);
503
+ }
504
+ label() {
505
+ return cy.get(`${this.selector} .radio-button__label`);
506
+ }
507
+ /**
508
+ * @deprecated Use assertion `label().should('trimmedText', '...')` instead.
509
+ */
510
+ trimmedText() {
511
+ return cy.get(`${this.selector} label`).__fkui_internal_trimmedText();
512
+ }
513
+ select() {
514
+ return cy.get(`${this.selector} label`).click();
515
+ }
516
+ details() {
517
+ return cy.get(`${this.selector} .radio-button__details`);
518
+ }
519
+ isSelected() {
520
+ return this.radioButton().then((el) => {
521
+ return el.get(0).checked;
522
+ });
523
+ }
524
+ value() {
525
+ return this.radioButton().then((el) => {
526
+ return el.get(0).value;
527
+ });
528
+ }
529
+ };
530
+
531
+ // src/pageobject/FFieldset.pageobject.ts
532
+ var FFieldsetPageObject = class {
533
+ /**
534
+ * @param selector - the root of the fieldset, usually `<div class="radio-button-group">...</div>` or `<div class="checkbox-group">...</div>`.
535
+ */
536
+ constructor(selector) {
537
+ this.selector = selector;
538
+ this.el = () => cy.get(this.selector);
539
+ this.label = new FLabelPageObject(`${this.selector} .label`);
540
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
541
+ }
542
+ content() {
543
+ return cy.get(`${this.selector} .fieldset__content`);
544
+ }
545
+ radioButton(buttonSelector) {
546
+ return new FRadioFieldPageObject(`${this.selector} ${buttonSelector}`);
547
+ }
548
+ numberOfRadio() {
549
+ return cy.get(`${this.selector} .radio-button`).then((el) => {
550
+ return el.length;
551
+ });
552
+ }
553
+ checkBox(checkboxSelector) {
554
+ return new FCheckboxFieldPageObject(
555
+ `${this.selector} ${checkboxSelector}`
556
+ );
557
+ }
558
+ numberOfCheckboxes() {
559
+ return cy.get(`${this.selector} .checkbox`).then((el) => {
560
+ return el.length;
561
+ });
562
+ }
563
+ };
564
+
565
+ // src/pageobject/FProgressbar.pageobject.ts
566
+ var FProgressbarPageObject = class {
567
+ /**
568
+ * @param selector - the root of the static field, usually `<div class="progress">...</div>`.
569
+ */
570
+ constructor(selector) {
571
+ this.selector = selector;
572
+ this.el = () => cy.get(this.selector);
573
+ this.progressMeter = () => cy.get(`${this.selector} .progress__meter`);
574
+ }
575
+ progressStatus() {
576
+ return this.progressMeter().then(
577
+ (el) => el[0].classList[1].replace(/.*progress__meter--(\w+).*/, "$1")
578
+ );
579
+ }
580
+ ariaValueNow() {
581
+ return this.progressMeter().invoke("attr", "aria-valuenow");
582
+ }
583
+ };
584
+
585
+ // src/pageobject/FFileItem.pageobject.ts
586
+ var FFileItemPageObject = class {
587
+ /**
588
+ * @param selector - the root of the file item, usually `<div class="file-item">...</div>`.
589
+ */
590
+ constructor(selector) {
591
+ this.selector = selector;
592
+ this.el = () => cy.get(this.selector);
593
+ this.fileName = () => cy.get(`${this.selector} .file-item__file-name`);
594
+ this.fileIcon = () => cy.get(`${this.selector} .file-item__file-open .icon`);
595
+ this.cancelDeleteButton = () => cy.get(`${this.selector} .file-item__file-remove`);
596
+ this.cancelDeleteButtonIcon = () => cy.get(`${this.selector} .file-item__file-remove .icon`);
597
+ this.progressMeter = new FProgressbarPageObject(this.selector);
598
+ }
599
+ typeOfFileIcon() {
600
+ return this.fileIcon().then(
601
+ (el) => el[1].classList[1].replace(/.*f-icon-(\w+).*/, "$1")
602
+ );
603
+ }
604
+ typeOfButtonIcon() {
605
+ return this.cancelDeleteButtonIcon().then(
606
+ (el) => el[0].classList[2].replace(/.*f-icon-(\w+).*/, "$1")
607
+ );
608
+ }
609
+ };
610
+
611
+ // src/pageobject/FFileSelector.pageobject.ts
612
+ var FFileSelectorPageObject = class {
613
+ /**
614
+ * @param selector - the root of the file file selector, usually `<div class="file-selector">...</div>`.
615
+ */
616
+ constructor(selector) {
617
+ this.selector = selector;
618
+ this.el = () => cy.get(this.selector);
619
+ this.addFile = () => cy.get(`${this.selector} > input`);
620
+ this.icon = () => cy.get(`${this.selector} .f-icon-paper-clip`);
621
+ }
622
+ };
623
+
624
+ // src/pageobject/FMessageBox.pageobject.ts
625
+ var FMessageBoxPageObject = class {
626
+ /**
627
+ * @param selector - the root of the message box, usually `<div class="message-box">...</div>`.
628
+ */
629
+ constructor(selector) {
630
+ this.selector = selector;
631
+ this.el = () => cy.get(selector);
632
+ this.errors = new FErrorListPageObject(`${this.selector}`);
633
+ }
634
+ /**
635
+ * @deprecated Access using `content()` instead. It is not guaranteed that provided heading class is used.
636
+ */
637
+ title() {
638
+ return cy.get(`${this.selector} .message-box__heading`);
639
+ }
640
+ icon() {
641
+ return cy.get(`${this.selector} .message-box__icon`);
642
+ }
643
+ /**
644
+ * @deprecated Access using `content()` instead. It is not guaranteed that `p`-tag is used.
645
+ */
646
+ body() {
647
+ return cy.get(`${this.selector} p`);
648
+ }
649
+ content() {
650
+ return cy.get(`${this.selector} .message-box__content`);
651
+ }
652
+ typeOfMessage() {
653
+ return this.el().then(
654
+ (el) => el[0].className.replace(/.*message-box--(\w+).*/, "$1")
655
+ );
656
+ }
657
+ };
658
+
659
+ // src/pageobject/FForm.pageobject.ts
660
+ var FFormPageObject = class {
661
+ /**
662
+ * @param selector - the root of the form, usually `<form class="form">...</form>`.
663
+ */
664
+ constructor(selector) {
665
+ this.components = {};
666
+ this.selector = selector;
667
+ this.el = () => cy.get(this.selector);
668
+ }
669
+ errorMessageBox() {
670
+ return new FMessageBoxPageObject(
671
+ `${this.selector} .message-box.message-box--error`
672
+ );
673
+ }
674
+ };
675
+
676
+ // src/pageobject/FFormStep.pageobject.ts
677
+ var FFormStepPageObject = class {
678
+ /**
679
+ * @param selector - the root of the form step, usually `<div class="form-step">...</div>`.
680
+ */
681
+ constructor(selector) {
682
+ this.selector = selector;
683
+ this.el = () => cy.get(selector);
684
+ this.headerSelector = `${this.selector} .form-step__header`;
685
+ this.errors = new FErrorListPageObject(
686
+ `${this.selector} .form-step__error`
687
+ );
688
+ }
689
+ /**
690
+ * The header contains the title and the valid icon.
691
+ */
692
+ header() {
693
+ return cy.get(this.headerSelector);
694
+ }
695
+ title() {
696
+ return cy.get(`${this.headerSelector} .form-step__title`);
697
+ }
698
+ body() {
699
+ return cy.get(`${this.headerSelector} +`);
700
+ }
701
+ validIcon() {
702
+ return cy.get(
703
+ `${this.headerSelector} .icon.form-step__check.f-icon-success`
704
+ );
705
+ }
706
+ isOpen() {
707
+ return this.editConfirmButton().then((elem) => {
708
+ return elem.get(0).getAttribute("aria-expanded") === "true";
709
+ });
710
+ }
711
+ editConfirmButton() {
712
+ return cy.get(`${this.selector} button[data-form-step-button]`);
713
+ }
714
+ };
715
+
716
+ // src/pageobject/FListItem.pageobject.ts
717
+ var FListItemPageObject = class {
718
+ /**
719
+ * @param selector - the root of the li, usually `<li class="list__item">...</li>`.
720
+ * @param index - the index of matched li:s.
721
+ */
722
+ constructor(selector, index) {
723
+ this.selector = `${selector}:nth(${index})`;
724
+ this.index = index;
725
+ this.el = () => cy.get(this.selector);
726
+ }
727
+ /**
728
+ * Select checkbox page object
729
+ */
730
+ selectCheckbox() {
731
+ return new FCheckboxFieldPageObject(
732
+ `${this.selector} .list__item__selectpane__input`
733
+ );
734
+ }
735
+ /**
736
+ * Content / Clickable link if checkbox:false
737
+ */
738
+ content() {
739
+ return cy.get(`${this.selector} .list__item__itempane`);
740
+ }
741
+ };
742
+
743
+ // src/pageobject/FList.pageobject.ts
744
+ var FListPageObject = class {
745
+ /**
746
+ * @param selector - the root of the label, usually `<li class="list">...</label>`.
747
+ */
748
+ constructor(selector) {
749
+ this.selector = selector;
750
+ this.el = () => cy.get(this.selector);
751
+ }
752
+ /**
753
+ * Hämta page object för specifikt list item.
754
+ */
755
+ listItem(index) {
756
+ return new FListItemPageObject(`${this.selector} .list__item`, index);
757
+ }
758
+ /**
759
+ * Hämta alla list items.
760
+ */
761
+ listItems() {
762
+ return cy.get(`${this.selector} .list__item .list__item__itempane`);
763
+ }
764
+ /**
765
+ * Felmeddelande
766
+ */
767
+ emptyMessage() {
768
+ return cy.get(`${this.selector} .list__item`);
769
+ }
770
+ };
771
+
772
+ // src/pageobject/FLoader.pageobject.ts
773
+ var FLoaderPageObject = class {
774
+ /**
775
+ * @param selector - the root of the loader, usually `<div class="loader">...</div>`.
776
+ */
777
+ constructor(selector = ".loader") {
778
+ this.selector = selector;
779
+ }
780
+ el() {
781
+ return cy.get(this.selector);
782
+ }
783
+ /**
784
+ * Get loader root.
785
+ * Only applicable if selector is a parent of loader.
786
+ *
787
+ * @deprecated Use a direct selector and `el()` instead.
788
+ */
789
+ loader() {
790
+ return cy.get(`${this.selector} .loader`);
791
+ }
792
+ wrapper() {
793
+ return cy.get(`${this.selector} .loader__wrapper`);
794
+ }
795
+ waitText() {
796
+ return cy.get(`${this.selector} .loader__wait-text`);
797
+ }
798
+ };
799
+
800
+ // src/pageobject/FModal.pageobject.ts
801
+ var FModalPageObject = class {
802
+ /**
803
+ * @param selector - the root of the Modal, usually `<div class="modal">...</div>`.
804
+ */
805
+ constructor(selector) {
806
+ this.selector = selector;
807
+ this.el = () => cy.get(`${this.selector} .modal__dialog-container`);
808
+ }
809
+ title() {
810
+ return cy.get(
811
+ `${this.selector} .modal__dialog-container .modal__title`
812
+ );
813
+ }
814
+ body() {
815
+ return cy.get(
816
+ `${this.selector} .modal__dialog-container .modal__content`
817
+ );
818
+ }
819
+ primaryButton() {
820
+ return cy.get(
821
+ `${this.selector} .modal__dialog-container .modal__footer .button--primary`
822
+ );
823
+ }
824
+ secondaryButton() {
825
+ return cy.get(
826
+ `${this.selector} .modal__dialog-container .modal__footer .button--secondary`
827
+ );
828
+ }
829
+ closeCross() {
830
+ return cy.get(
831
+ `${this.selector} .modal__dialog-container .close-button`
832
+ );
833
+ }
834
+ typeOfModal() {
835
+ return cy.get(this.selector).then((el) => el[0].className.replace(/.*modal--(\w+).*/, "$1"));
836
+ }
837
+ };
838
+
839
+ // src/pageobject/FFormModal.pageobject.ts
840
+ var FFormModalPageObject = class extends FModalPageObject {
841
+ /**
842
+ * @param selector - the root of the Modal, usually `<div class="modal">...</div>`.
843
+ */
844
+ constructor(selector) {
845
+ super(selector);
846
+ this.selector = selector;
847
+ this.el = () => cy.get(this.selector);
848
+ }
849
+ submitButton() {
850
+ return this.primaryButton();
851
+ }
852
+ cancelButton() {
853
+ return this.secondaryButton();
854
+ }
855
+ };
856
+
857
+ // src/pageobject/IMenu.pageobject.ts
858
+ var IMenuPageObject = class {
859
+ el() {
860
+ return cy.get(this.selector);
861
+ }
862
+ /**
863
+ * @param selector - the root of the IMenu, usually `<nav class="imenu">...</nav>`.
864
+ */
865
+ constructor(selector) {
866
+ this.selector = selector;
867
+ }
868
+ /**
869
+ * Get all items in the IMenu
870
+ *
871
+ * @returns all items
872
+ */
873
+ items() {
874
+ return cy.get(`${this.selector} .imenu__list__item`);
875
+ }
876
+ /**
877
+ * Get the item at position index in the IMenu
878
+ *
879
+ * @param index - the position index in the item array
880
+ * @returns Menu item with given index
881
+ */
882
+ item(index) {
883
+ return this.items().eq(index);
884
+ }
885
+ /**
886
+ * Get link for item at index
887
+ *
888
+ * @param index - the position index in the item array
889
+ * @returns link with given index
890
+ */
891
+ getItemLink(index) {
892
+ return cy.get(`${this.selector} .imenu__list__item a:nth(${index})`);
893
+ }
894
+ /**
895
+ * Get currently selected menu item
896
+ *
897
+ * @returns Currently selected item
898
+ */
899
+ getSelectedItem() {
900
+ return this.items().get(
901
+ `${this.selector} .imenu__list__item--highlight`
902
+ );
903
+ }
904
+ };
905
+
906
+ // src/pageobject/IPopupMenu.pageobject.ts
907
+ var IPopupMenuPageObject = class {
908
+ el() {
909
+ return cy.get(this.selector);
910
+ }
911
+ /**
912
+ * @param selector - the root of the IPopupMenu, usually `<nav class="IPopupMenu">...</nav>`.
913
+ */
914
+ constructor(selector) {
915
+ this.selector = selector;
916
+ }
917
+ /**
918
+ * Get all items in the IPopupMenu
919
+ * @returns all items
920
+ */
921
+ items() {
922
+ return cy.get(`${this.selector} .ipopupmenu__list__item`);
923
+ }
924
+ /**
925
+ * Get the item at position index in the IPopupMenu
926
+ *
927
+ * @param index - the position index in the item array
928
+ * @returns Menu item with given index
929
+ */
930
+ item(index) {
931
+ return this.items().eq(index);
932
+ }
933
+ /**
934
+ * Get link for item at index
935
+ *
936
+ * @param index - the position index in the item array
937
+ * @returns link with given index
938
+ */
939
+ getItemLink(index) {
940
+ return cy.get(
941
+ `${this.selector} .ipopupmenu__list__item a:nth(${index})`
942
+ );
943
+ }
944
+ /**
945
+ * Get currently selected menu item
946
+ *
947
+ * @returns Currently selected item
948
+ */
949
+ getSelectedItem() {
950
+ return this.items().get(
951
+ `${this.selector} .ipopupmenu__list__item--highlight`
952
+ );
953
+ }
954
+ };
955
+
956
+ // src/pageobject/FNavigationMenu/FNavigationMenu.pageobject.ts
957
+ var FNavigationMenuPageobject = class {
958
+ el() {
959
+ return cy.get(this.selector);
960
+ }
961
+ /**
962
+ * @param selector - the root of the navigation menu, usually `div > nav.imenu`.
963
+ */
964
+ constructor(selector) {
965
+ this.selector = selector;
966
+ }
967
+ menu() {
968
+ return new IMenuPageObject(`${this.selector}.imenu > ul.imenu__list`);
969
+ }
970
+ popupMenu() {
971
+ return new IPopupMenuPageObject(
972
+ `${this.selector}.ipopupmenu > ul.ipopupmenu__list`
973
+ );
974
+ }
975
+ };
976
+
977
+ // src/pageobject/FOffline.pageobject.ts
978
+ var FOfflinePageObject = class {
979
+ /**
980
+ * @param selector - optional custom selector to offline component.
981
+ */
982
+ constructor(selector = "body > .offline__wrapper") {
983
+ this.selector = selector;
984
+ this.el = () => cy.get(this.selector);
985
+ this.banner = () => cy.get(`${this.selector} .offline`);
986
+ }
987
+ };
988
+
989
+ // src/pageobject/FOutputField.pageobject.ts
990
+ var FOutputFieldPageobject = class {
991
+ constructor(selector) {
992
+ this.selector = selector;
993
+ this.el = () => cy.get(this.selector);
994
+ this.label = new FLabelPageObject(`${this.selector} .label`);
995
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
996
+ this.body = () => cy.get(`${this.selector} .output-field__output`);
997
+ }
998
+ };
999
+
1000
+ // src/pageobject/Input.ts
1001
+ var Input = class {
1002
+ constructor(selector, inputSelector) {
1003
+ this.selector = selector;
1004
+ this.inputSelector = inputSelector;
1005
+ this.el = () => cy.get(this.selector);
1006
+ }
1007
+ enter(text) {
1008
+ return cy.get(`${this.selector} ${this.inputSelector}`).clear().type(text).blur();
1009
+ }
1010
+ value() {
1011
+ return cy.get(`${this.selector} ${this.inputSelector}`).then((el) => {
1012
+ return el.get(0).value;
1013
+ });
1014
+ }
1015
+ };
1016
+
1017
+ // src/pageobject/FTextField.pageobject.ts
1018
+ var FTextFieldPageObject = class extends Input {
1019
+ /**
1020
+ * @param selector - the root of the text field, usually `<div class="text-field">...</div>`.
1021
+ */
1022
+ constructor(selector) {
1023
+ super(selector, "input");
1024
+ this.selector = selector;
1025
+ this.el = () => cy.get(this.selector);
1026
+ this.label = new FLabelPageObject(`${this.selector} .label`);
1027
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
1028
+ }
1029
+ input() {
1030
+ return cy.get(`${this.selector} input`);
1031
+ }
1032
+ errorIcon() {
1033
+ return cy.get(`${this.selector} .icon.text-field__icon.f-icon-error`);
1034
+ }
1035
+ };
1036
+
1037
+ // src/pageobject/ICalendarNavbar.pageobject.ts
1038
+ var ICalendarNavbarPageObject = class {
1039
+ /**
1040
+ * @param selector - CSS selector to the ICalendarNavbar object
1041
+ */
1042
+ constructor(selector = ".calendar-navbar") {
1043
+ this.selector = selector;
1044
+ }
1045
+ el() {
1046
+ return cy.get(this.selector);
1047
+ }
1048
+ text() {
1049
+ return cy.get(`${this.selector} .calendar-navbar__month`);
1050
+ }
1051
+ prevButton() {
1052
+ return cy.get(`${this.selector} .calendar-navbar__arrow--previous`);
1053
+ }
1054
+ nextButton() {
1055
+ return cy.get(`${this.selector} .calendar-navbar__arrow--next`);
1056
+ }
1057
+ };
1058
+
1059
+ // src/pageobject/FDatepickerField.pageobject.ts
1060
+ var FDatepickerFieldPageobject = class {
1061
+ constructor(selector) {
1062
+ this.selector = selector;
1063
+ this.textField = new FTextFieldPageObject(
1064
+ `${this.selector} .text-field`
1065
+ );
1066
+ this.calendarNavbar = new ICalendarNavbarPageObject(
1067
+ `${this.selector} .calendar-navbar`
1068
+ );
1069
+ }
1070
+ el() {
1071
+ return cy.get(this.selector);
1072
+ }
1073
+ input() {
1074
+ return this.textField.input();
1075
+ }
1076
+ textFieldErrorMessage() {
1077
+ return this.textField.label.errorMessage();
1078
+ }
1079
+ toggleCalendarButton() {
1080
+ return cy.get(`${this.selector} [data-test="calendar-button"]`);
1081
+ }
1082
+ closeCalendarButton() {
1083
+ return cy.get(`${this.selector}__close__button`);
1084
+ }
1085
+ popup() {
1086
+ return cy.get(`${this.selector} .popup`);
1087
+ }
1088
+ calendar() {
1089
+ return cy.get(`${this.selector} .calendar__wrapper`);
1090
+ }
1091
+ calendarCaption() {
1092
+ return this.calendarNavbar.text();
1093
+ }
1094
+ navPrevButton() {
1095
+ return this.calendarNavbar.prevButton();
1096
+ }
1097
+ navNextButton() {
1098
+ return this.calendarNavbar.nextButton();
1099
+ }
1100
+ dayButton(date) {
1101
+ return cy.get(`${this.selector} [data-date="${date}"]`);
1102
+ }
1103
+ disabledDay(date) {
1104
+ return cy.get(
1105
+ `${this.selector} [data-date="${date}"] .calendar-day--disabled`
1106
+ );
1107
+ }
1108
+ selectedDay() {
1109
+ return cy.get(`${this.selector} [data-date] .calendar-day--selected`);
1110
+ }
1111
+ highlightedDay() {
1112
+ return cy.get(`${this.selector} [data-date] .calendar-day--today`);
1113
+ }
1114
+ };
1115
+
1116
+ // src/pageobject/FPageHeader/pageheader.pageobject.ts
1117
+ var FPageHeaderPageobject = class {
1118
+ /**
1119
+ * @param selector - the root of the page header, usually `div.page-header__root`.
1120
+ */
1121
+ constructor(selector) {
1122
+ this.selector = selector;
1123
+ this.el = () => cy.get(this.selector);
1124
+ }
1125
+ skipLink() {
1126
+ return cy.get(`${this.selector} .iskiplink`).then(($el) => {
1127
+ $el.css({ top: 45, left: 10 });
1128
+ });
1129
+ }
1130
+ applicationName() {
1131
+ return cy.get(`${this.selector} .page-header__app-name`);
1132
+ }
1133
+ rightSlot() {
1134
+ return cy.get(`${this.selector} .page-header__right-slot`);
1135
+ }
1136
+ logoSlot() {
1137
+ return cy.get(`${this.selector} div.page-header__logo`);
1138
+ }
1139
+ logoRouterLink() {
1140
+ return cy.get(`${this.selector} .page-header__logo > a`);
1141
+ }
1142
+ };
1143
+
1144
+ // src/pageobject/FRadioGroup.pageobject.ts
1145
+ var FRadioGroupPageObject = class {
1146
+ /**
1147
+ * @param selector - the root of the radio group, usually `<div class="radio-button-group">...</div>`.
1148
+ */
1149
+ constructor(selector) {
1150
+ this.selector = selector;
1151
+ this.el = () => cy.get(this.selector);
1152
+ this.label = new FLabelPageObject(`${this.selector} legend.label`);
1153
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
1154
+ }
1155
+ content() {
1156
+ return cy.get(`${this.selector} .radio-button-group__content`);
1157
+ }
1158
+ radioButton(buttonSelector) {
1159
+ return new FRadioFieldPageObject(`${this.selector} ${buttonSelector}`);
1160
+ }
1161
+ numberOfOptions() {
1162
+ return cy.get(`${this.selector} .radio-button`).then((el) => {
1163
+ return el.length;
1164
+ });
1165
+ }
1166
+ };
1167
+
1168
+ // src/pageobject/FSelectField.pageobject.ts
1169
+ var FSelectFieldPageObject = class {
1170
+ /**
1171
+ * @param selector - the root of the select field, usually `<div class="select-field">...</div>`.
1172
+ */
1173
+ constructor(selector) {
1174
+ this.selector = selector;
1175
+ this.el = () => cy.get(this.selector);
1176
+ this.label = new FLabelPageObject(`${this.selector} .label`);
1177
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
1178
+ }
1179
+ dropdown() {
1180
+ return cy.get(`${this.selector} select`);
1181
+ }
1182
+ arrowIcon() {
1183
+ return cy.get(
1184
+ `${this.selector} .icon.select-field__icon.f-icon-arrow-down`
1185
+ );
1186
+ }
1187
+ numberOfOptions() {
1188
+ return this.dropdown().then(
1189
+ (el) => el.find("option").not('[disabled="disabled"]').length
1190
+ );
1191
+ }
1192
+ listOfOptions() {
1193
+ const listItem = [];
1194
+ return cy.get(`${this.selector} select option`).not('[disabled="disabled"]').each((el) => {
1195
+ return listItem.push(el.get(0).innerText);
1196
+ }).then(() => listItem);
1197
+ }
1198
+ selectedValue() {
1199
+ return this.dropdown().then((el) => {
1200
+ return el.get(0).value;
1201
+ });
1202
+ }
1203
+ trimmedText() {
1204
+ return this.dropdown().then((el) => {
1205
+ return el.get(0).options.selectedIndex >= 0 ? el.get(0)[el.get(0).options.selectedIndex].innerText.replace(
1206
+ /[\n\r]/gm,
1207
+ ""
1208
+ ).replace(/\s+/g, " ").replace(/(^\s|\s$)*/g, "") : "";
1209
+ });
1210
+ }
1211
+ };
1212
+
1213
+ // src/pageobject/FSortFilterDataset.pageobject.ts
1214
+ var FSortFilterDatasetPageObject = class {
1215
+ constructor(selector) {
1216
+ this.selector = selector;
1217
+ this.el = () => cy.get(this.selector);
1218
+ this.selectField = new FSelectFieldPageObject(
1219
+ `${this.selector} .select-field--inline`
1220
+ );
1221
+ this.textField = new FTextFieldPageObject(
1222
+ `${this.selector} .sort-filter-dataset__search`
1223
+ );
1224
+ }
1225
+ header() {
1226
+ return cy.get(
1227
+ `${this.selector} .iflex .sort-filter-dataset__toolbar__header`
1228
+ );
1229
+ }
1230
+ };
1231
+
1232
+ // src/pageobject/FStaticField.pageobject.ts
1233
+ var FStaticFieldPageObject = class {
1234
+ /**
1235
+ * @param selector - the root of the static field, usually `<div class="output-field">...</div>`.
1236
+ */
1237
+ constructor(selector) {
1238
+ this.selector = selector;
1239
+ this.el = () => cy.get(this.selector);
1240
+ this.label = new FLabelPageObject(`${this.selector} .label`);
1241
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
1242
+ }
1243
+ body() {
1244
+ return cy.get(`${this.selector} p`);
1245
+ }
1246
+ };
1247
+
1248
+ // src/pageobject/FTableColumn.pageobject.ts
1249
+ var FTableColumnPageObject = class {
1250
+ constructor(selector, index) {
1251
+ this.selector = `${selector}:nth(${index})`;
1252
+ this.index = index;
1253
+ this.el = () => cy.get(this.selector);
1254
+ }
1255
+ tableRowBodyContent(position) {
1256
+ return cy.get(`${this.selector} td:nth(${position})`);
1257
+ }
1258
+ tableRowHeaderContent() {
1259
+ return cy.get(`${this.selector} th`);
1260
+ }
1261
+ checkbox() {
1262
+ return new FCheckboxFieldPageObject(this.selector);
1263
+ }
1264
+ };
1265
+
1266
+ // src/pageobject/FInteractiveTable.pageobject.ts
1267
+ var FInteractiveTablePageObject = class {
1268
+ /**
1269
+ * @param selector - table selector.
1270
+ */
1271
+ constructor(selector) {
1272
+ this.selector = selector;
1273
+ this.el = () => cy.get(this.selector);
1274
+ }
1275
+ caption() {
1276
+ return cy.get(`${this.selector} caption`);
1277
+ }
1278
+ bodyRow() {
1279
+ return cy.get(`${this.selector} tbody tr`);
1280
+ }
1281
+ headersRow() {
1282
+ return cy.get(`${this.selector} thead th`);
1283
+ }
1284
+ /**
1285
+ * Hämta page object för specifikt Table row item.
1286
+ */
1287
+ columnItem(index) {
1288
+ return new FTableColumnPageObject(
1289
+ `${this.selector} .table__row`,
1290
+ index
1291
+ );
1292
+ }
1293
+ /**
1294
+ * Hämta page object för specifikt Header row item.
1295
+ */
1296
+ headerRowItem() {
1297
+ return new FTableColumnPageObject(`${this.selector} .table__row`, 0);
1298
+ }
1299
+ getColumnSortedByIcon(index, order) {
1300
+ let iconName;
1301
+ switch (order) {
1302
+ case "ascending":
1303
+ iconName = "f-icon-caret-up";
1304
+ break;
1305
+ case "descending":
1306
+ iconName = "f-icon-caret-down";
1307
+ break;
1308
+ case "unsorted":
1309
+ iconName = "f-icon-sort";
1310
+ break;
1311
+ default:
1312
+ throw Error("Invalid order");
1313
+ }
1314
+ const column = this.headerRowItem().tableRowHeaderContent().eq(index);
1315
+ return column.find(`svg.${iconName}`);
1316
+ }
1317
+ };
1318
+
1319
+ // src/pageobject/FTextareaField.pageobject.ts
1320
+ var FTextareaFieldPageObject = class extends Input {
1321
+ /**
1322
+ * @param selector - the root of the textarea field, usually `<div class="textarea-field">...</div>`.
1323
+ */
1324
+ constructor(selector) {
1325
+ super(selector, "textarea");
1326
+ this.selector = selector;
1327
+ this.el = () => cy.get(this.selector);
1328
+ this.label = new FLabelPageObject(`${this.selector} .label`);
1329
+ this.tooltip = new FTooltipPageObject(`${this.selector} .tooltip`);
1330
+ }
1331
+ input() {
1332
+ return cy.get(`${this.selector} textarea`);
1333
+ }
1334
+ errorIcon() {
1335
+ return cy.get(
1336
+ `${this.selector} .icon.textarea-field__icon.f-icon-error`
1337
+ );
1338
+ }
1339
+ };
1340
+
1341
+ // src/pageobject/IAnimateExpand.pageobject.ts
1342
+ var IAnimateExpandPageobject = class {
1343
+ el() {
1344
+ return cy.get(this.selector);
1345
+ }
1346
+ content() {
1347
+ return cy.get(`${this.selector} [data-test="animation-content"]`);
1348
+ }
1349
+ animationClass() {
1350
+ return cy.get(`${this.selector} .animate-expand--expanded`);
1351
+ }
1352
+ /**
1353
+ * Wait for open animation to finish.
1354
+ */
1355
+ waitOnOpen() {
1356
+ cy.log("Wait for open animation to finish");
1357
+ this.animationClass().should("exist");
1358
+ this.waitOnAnimationCompleted();
1359
+ }
1360
+ /**
1361
+ * Wait for open animation to not exist.
1362
+ */
1363
+ waitOnAnimationCompleted() {
1364
+ cy.log("Wait for open animation to complete");
1365
+ this.animationClass().should("not.exist");
1366
+ }
1367
+ /**
1368
+ * Wait for close animation to finish.
1369
+ */
1370
+ waitOnClose() {
1371
+ cy.log("Wait for close animation to finish");
1372
+ cy.get(`${this.selector} [data-test="animation-content"] > *`).should(
1373
+ "not.exist"
1374
+ );
1375
+ }
1376
+ constructor(selector) {
1377
+ this.selector = selector;
1378
+ }
1379
+ };
1380
+
1381
+ // src/pageobject/FWizard/FWizardStepHeader.pageobject.ts
1382
+ var FWizardStepHeaderPageobject = class {
1383
+ constructor(selector) {
1384
+ this.selector = selector;
1385
+ this.el = () => cy.get(this.selector);
1386
+ this.successIcon = () => cy.get(`${this.selector} .icon-stack .f-icon-success`);
1387
+ this.stepNumber = () => cy.get(`${this.selector} [data-test="step-number"]`).invoke("text");
1388
+ this.stepOf = () => cy.get(`${this.selector} .wizard-step__header__step-of`);
1389
+ this.title = () => cy.get(`${this.selector} .wizard-step__header__title`);
1390
+ }
1391
+ };
1392
+
1393
+ // src/pageobject/FWizard/FWizardStep.pageobject.ts
1394
+ var STATUS = /* @__PURE__ */ ((STATUS2) => {
1395
+ STATUS2["done"] = "done";
1396
+ STATUS2["open"] = "open";
1397
+ STATUS2["pending"] = "pending";
1398
+ return STATUS2;
1399
+ })(STATUS || {});
1400
+ var FWizardStepPageobject = class {
1401
+ el() {
1402
+ return cy.get(this.selector);
1403
+ }
1404
+ /**
1405
+ * Get the primary button element of the FWizardStep
1406
+ */
1407
+ continue() {
1408
+ this.waitOnAnimationCompleted();
1409
+ return cy.get(`${this.selector} .button-group:last .button--primary`);
1410
+ }
1411
+ /**
1412
+ * Get the secondary button element of the FWizardStep
1413
+ */
1414
+ cancel() {
1415
+ this.waitOnAnimationCompleted();
1416
+ return cy.get(`${this.selector} .button-group:last .button--secondary`);
1417
+ }
1418
+ /**
1419
+ * Get the body element of the FWizardStep
1420
+ */
1421
+ body() {
1422
+ return cy.get(`${this.selector} .wizard-step-body`);
1423
+ }
1424
+ /**
1425
+ * Wait for open animation to finish.
1426
+ */
1427
+ waitOnOpen() {
1428
+ this.animateExpand.waitOnOpen();
1429
+ }
1430
+ /**
1431
+ * Wait for close animation to finish.
1432
+ */
1433
+ waitOnClose() {
1434
+ this.animateExpand.waitOnClose();
1435
+ }
1436
+ /**
1437
+ * Wait for any animation to complete.
1438
+ */
1439
+ waitOnAnimationCompleted() {
1440
+ this.animateExpand.waitOnAnimationCompleted();
1441
+ }
1442
+ constructor(selector) {
1443
+ this.selector = selector;
1444
+ this.errors = new FErrorListPageObject(`${this.selector} .error-list`);
1445
+ this.header = new FWizardStepHeaderPageobject(
1446
+ `${this.selector} .wizard-step__header`
1447
+ );
1448
+ this.animateExpand = new IAnimateExpandPageobject(this.selector);
1449
+ }
1450
+ /**
1451
+ * Get the status of the wizard step.
1452
+ * @see STATUS
1453
+ */
1454
+ status() {
1455
+ return this.el().then(
1456
+ (el) => el[0].className.replace(/.*wizard-step--(\w+).*/, "$1")
1457
+ );
1458
+ }
1459
+ };
1460
+
1461
+ // src/pageobject/FWizard/FWizard.pageobject.ts
1462
+ var FWizardPageobject = class {
1463
+ el() {
1464
+ return cy.get(this.selector);
1465
+ }
1466
+ /**
1467
+ * Get all FWizardSteps in the FWizard
1468
+ *
1469
+ * @returns all steps
1470
+ */
1471
+ steps() {
1472
+ return cy.get(`${this.selector} .wizard-step`);
1473
+ }
1474
+ /**
1475
+ * Get specfic step in wizard.
1476
+ *
1477
+ * @param index - step to retrieve (0-indexed)
1478
+ * @returns FWizardStepPageObject
1479
+ */
1480
+ getStep(index) {
1481
+ return new FWizardStepPageobject(
1482
+ `${this.selector} .wizard-step:nth(${index})`
1483
+ );
1484
+ }
1485
+ /**
1486
+ * Turns off the animation att css class level.
1487
+ */
1488
+ turnOffAnimation() {
1489
+ cy.get(".wizard-step__connector").invoke("css", "transition", "none");
1490
+ }
1491
+ constructor(selector) {
1492
+ this.selector = selector;
1493
+ }
1494
+ };
1495
+
1496
+ // src/pageobject/ICalendar/Calendar.pageobject.ts
1497
+ var monthList = [
1498
+ "januari",
1499
+ "februari",
1500
+ "mars",
1501
+ "april",
1502
+ "maj",
1503
+ "juni",
1504
+ "juli",
1505
+ "augusti",
1506
+ "september",
1507
+ "oktober",
1508
+ "november",
1509
+ "december"
1510
+ ];
1511
+ var CalendarPageObject = class {
1512
+ constructor(selector) {
1513
+ this.selector = selector;
1514
+ this.navigationBar = new ICalendarNavbarPageObject(
1515
+ `${this.selector} .calendar-navbar`
1516
+ );
1517
+ }
1518
+ el() {
1519
+ return cy.get(this.selector);
1520
+ }
1521
+ /**
1522
+ * return the weeknumbers surrounding the days in the calendar
1523
+ */
1524
+ weekNumbers() {
1525
+ return cy.get(`${this.selector} .calendar-month__cell--week-number`);
1526
+ }
1527
+ /**
1528
+ * return the weekday names surrounding the days in the calendar
1529
+ */
1530
+ headerCells() {
1531
+ return cy.get(
1532
+ `${this.selector} .calendar-month__header-cell:not([aria-hidden="true"])`
1533
+ );
1534
+ }
1535
+ /**
1536
+ * Day to select in the calendar day-view via day number
1537
+ */
1538
+ dayButton(day = 1) {
1539
+ return cy.get(
1540
+ `${this.selector} .calendar-month__button:nth(${day - 1})`
1541
+ );
1542
+ }
1543
+ day(day = 1) {
1544
+ return new FCalenderDayPageobject(
1545
+ `${this.selector} .calendar-month__button:nth(${day - 1}) .calendar-day`
1546
+ );
1547
+ }
1548
+ /**
1549
+ * Uses the calendar navigation bar navigate to selected year and month
1550
+ * jan = 0, dec = 11
1551
+ * @param targetYear - Selected year
1552
+ * @param targetMonth - Selected month 0-11, 0 = Jan 11 = dec
1553
+ */
1554
+ navigateTo(targetYear, targetMonth) {
1555
+ cy.log(`Navigate to ${monthList[targetMonth]} ${targetYear}`);
1556
+ this.navigationBar.text().then((el) => {
1557
+ let currYear = 2023;
1558
+ let currentMonth = 0;
1559
+ el.text().replace(/(\w+)\s+(\d+)/, (match, p1, p2) => {
1560
+ currentMonth = monthList.findIndex((month) => month === p1);
1561
+ currYear = parseInt(p2, 10);
1562
+ return `${currYear}`;
1563
+ });
1564
+ const yearDiff = Math.abs(currYear - targetYear);
1565
+ const monthDiff = Math.abs(currentMonth - targetMonth);
1566
+ let diffInMonths = currYear > targetYear ? yearDiff * -12 : yearDiff * 12;
1567
+ diffInMonths += currentMonth > targetMonth ? -monthDiff : monthDiff;
1568
+ if (diffInMonths !== 0) {
1569
+ const stepMonth = diffInMonths < 0 ? this.navigationBar.prevButton() : this.navigationBar.nextButton();
1570
+ for (let i = 0; i < Math.abs(diffInMonths); i++) {
1571
+ stepMonth.click();
1572
+ }
1573
+ }
1574
+ });
1575
+ }
1576
+ };
1577
+
1578
+ // src/pageobject/IPopup.pageobject.ts
1579
+ var IPopupPageObject = class {
1580
+ /**
1581
+ * @param selector - the root of the IPopup.
1582
+ */
1583
+ constructor(selector = ".popup") {
1584
+ this.selector = selector;
1585
+ }
1586
+ el() {
1587
+ return cy.get(this.selector);
1588
+ }
1589
+ };
1590
+
1591
+ // src/pageobject/AlertScreenReader.pageobject.ts
1592
+ var AlertScreenReaderPageObject = class {
1593
+ constructor() {
1594
+ this.selector = "#fkui-alert-screen-reader";
1595
+ }
1596
+ /**
1597
+ * Returns the alertScreenReader element with text.
1598
+ */
1599
+ el() {
1600
+ return cy.get(this.selector);
1601
+ }
1602
+ };
1603
+
1604
+ // src/pageobject/FDialogueTreeItem.pageobject.ts
1605
+ var FDialogueTreeItemPageObject = class {
1606
+ constructor(selector) {
1607
+ this.selector = selector;
1608
+ this.el = () => cy.get(this.selector);
1609
+ }
1610
+ title() {
1611
+ return cy.get(`${this.selector}`);
1612
+ }
1613
+ button() {
1614
+ return cy.get(`${this.selector} button`);
1615
+ }
1616
+ select() {
1617
+ return this.button().click();
1618
+ }
1619
+ };
1620
+
1621
+ // src/pageobject/FDialogueTree.pageobject.ts
1622
+ var FDialogueTreePageObject = class {
1623
+ constructor(selector) {
1624
+ this.selector = selector;
1625
+ this.el = () => cy.get(this.selector);
1626
+ }
1627
+ options() {
1628
+ return cy.get(`${this.selector} li`);
1629
+ }
1630
+ option(index) {
1631
+ return new FDialogueTreeItemPageObject(
1632
+ `${this.selector} li:nth(${index})`
1633
+ );
1634
+ }
1635
+ };
1636
+ // Annotate the CommonJS export names for ESM import in node:
1637
+ 0 && (module.exports = {
1638
+ AlertScreenReaderPageObject,
1639
+ CalendarPageObject,
1640
+ FBadgePageObject,
1641
+ FCalenderDayPageobject,
1642
+ FCheckboxFieldPageObject,
1643
+ FCheckboxGroupFieldPageObject,
1644
+ FCheckboxGroupPageObject,
1645
+ FContextMenuPageObject,
1646
+ FCrudDatasetPageObject,
1647
+ FDatepickerFieldPageobject,
1648
+ FDialogueTreeItemPageObject,
1649
+ FDialogueTreePageObject,
1650
+ FErrorListPageObject,
1651
+ FExpandablePanelPageObject,
1652
+ FFieldsetPageObject,
1653
+ FFileItemPageObject,
1654
+ FFileSelectorPageObject,
1655
+ FFormModalPageObject,
1656
+ FFormPageObject,
1657
+ FFormStepPageObject,
1658
+ FInteractiveTablePageObject,
1659
+ FLabelPageObject,
1660
+ FListItemPageObject,
1661
+ FListPageObject,
1662
+ FLoaderPageObject,
1663
+ FMessageBoxPageObject,
1664
+ FModalPageObject,
1665
+ FNavigationMenuPageobject,
1666
+ FOfflinePageObject,
1667
+ FOutputFieldPageobject,
1668
+ FPageHeaderPageobject,
1669
+ FProgressbarPageObject,
1670
+ FRadioFieldPageObject,
1671
+ FRadioGroupFieldPageObject,
1672
+ FRadioGroupPageObject,
1673
+ FSelectFieldPageObject,
1674
+ FSortFilterDatasetPageObject,
1675
+ FStaticFieldPageObject,
1676
+ FTableColumnPageObject,
1677
+ FTextFieldPageObject,
1678
+ FTextareaFieldPageObject,
1679
+ FTooltipPageObject,
1680
+ FValidationFormPageObject,
1681
+ FWizardPageobject,
1682
+ FWizardStepHeaderPageobject,
1683
+ FWizardStepPageobject,
1684
+ ICalendarNavbarPageObject,
1685
+ IMenuPageObject,
1686
+ IPopupMenuPageObject,
1687
+ IPopupPageObject,
1688
+ Input,
1689
+ STATUS,
1690
+ dayType
1691
+ });
1692
+ //# sourceMappingURL=pageobject.js.map