@helvetia-design/playwright 0.0.0-stage → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +210 -0
- package/dist/src/index.js +8 -0
- package/dist/src/lib/components/accordion.po.js +74 -0
- package/dist/src/lib/components/app-footer.po.js +132 -0
- package/dist/src/lib/components/app-navbar.po.js +106 -0
- package/dist/src/lib/components/badge.po.js +32 -0
- package/dist/src/lib/components/brand-icon.po.js +13 -0
- package/dist/src/lib/components/button.po.js +86 -0
- package/dist/src/lib/components/card.po.js +148 -0
- package/dist/src/lib/components/carousel.po.js +92 -0
- package/dist/src/lib/components/checkbox.po.js +107 -0
- package/dist/src/lib/components/close.po.js +31 -0
- package/dist/src/lib/components/content.po.js +32 -0
- package/dist/src/lib/components/counter.po.js +121 -0
- package/dist/src/lib/components/data-item.po.js +235 -0
- package/dist/src/lib/components/data.po.js +110 -0
- package/dist/src/lib/components/datepicker.po.js +260 -0
- package/dist/src/lib/components/divider.po.js +10 -0
- package/dist/src/lib/components/drawer.po.js +55 -0
- package/dist/src/lib/components/file-upload.po.js +200 -0
- package/dist/src/lib/components/heading.po.js +32 -0
- package/dist/src/lib/components/hint.po.js +71 -0
- package/dist/src/lib/components/icon.po.js +13 -0
- package/dist/src/lib/components/index.js +49 -0
- package/dist/src/lib/components/input.po.js +107 -0
- package/dist/src/lib/components/label.po.js +32 -0
- package/dist/src/lib/components/list.po.js +68 -0
- package/dist/src/lib/components/logo.po.js +13 -0
- package/dist/src/lib/components/modal.po.js +97 -0
- package/dist/src/lib/components/notification.po.js +56 -0
- package/dist/src/lib/components/number-input.po.js +107 -0
- package/dist/src/lib/components/page-object.js +47 -0
- package/dist/src/lib/components/pagination.po.js +146 -0
- package/dist/src/lib/components/phone-input.po.js +302 -0
- package/dist/src/lib/components/popup.po.js +55 -0
- package/dist/src/lib/components/radio.po.js +89 -0
- package/dist/src/lib/components/root.po.js +32 -0
- package/dist/src/lib/components/segment.po.js +135 -0
- package/dist/src/lib/components/select.po.js +257 -0
- package/dist/src/lib/components/shape.po.js +10 -0
- package/dist/src/lib/components/sheet.po.js +88 -0
- package/dist/src/lib/components/slider.po.js +101 -0
- package/dist/src/lib/components/snackbar.po.js +115 -0
- package/dist/src/lib/components/spinner.po.js +13 -0
- package/dist/src/lib/components/stack.po.js +32 -0
- package/dist/src/lib/components/steps.po.js +112 -0
- package/dist/src/lib/components/tabs.po.js +110 -0
- package/dist/src/lib/components/tag.po.js +53 -0
- package/dist/src/lib/components/text.po.js +32 -0
- package/dist/src/lib/components/textarea.po.js +89 -0
- package/dist/src/lib/components/toast.po.js +92 -0
- package/dist/src/lib/components/toggle.po.js +107 -0
- package/dist/src/lib/components/tooltip.po.js +32 -0
- package/dist/src/lib/devices.js +6 -0
- package/dist/src/lib/extend.js +375 -0
- package/dist/src/lib/functions/a11y.js +31 -0
- package/dist/src/lib/matchers/index.js +12 -0
- package/dist/src/lib/matchers/to-have-first-received-event-detail.js +44 -0
- package/dist/src/lib/matchers/to-have-nth-received-event-detail.js +53 -0
- package/dist/src/lib/matchers/to-have-received-event-detail.js +44 -0
- package/dist/src/lib/matchers/to-have-received-event-times.js +33 -0
- package/dist/src/lib/matchers/to-have-received-event.js +33 -0
- package/dist/src/lib/page/event-spy.js +198 -0
- package/dist/src/lib/page/utils/goto.js +71 -0
- package/dist/src/lib/page/utils/index.js +6 -0
- package/dist/src/lib/page/utils/locator.js +38 -0
- package/dist/src/lib/page/utils/mount-ssr.js +118 -0
- package/dist/src/lib/page/utils/mount.js +70 -0
- package/dist/src/lib/page/utils/spy-on-event.js +34 -0
- package/dist/src/lib/page/utils/wait-for-changes.js +99 -0
- package/dist/src/lib/screenshot.js +13 -0
- package/dist/src/lib/test-expect.js +1 -0
- package/dist/src/lib/types.js +54 -0
- package/package.json +31 -3
- package/sbom.cdx.json +80470 -0
- package/README.md +0 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
3
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { expect } from '@playwright/test';
|
|
5
|
+
import { PageObject } from './page-object';
|
|
6
|
+
import { DsClose } from './close.po';
|
|
7
|
+
export var DsNotification = /*#__PURE__*/ function(PageObject) {
|
|
8
|
+
"use strict";
|
|
9
|
+
_inherits(DsNotification, PageObject);
|
|
10
|
+
function DsNotification(el) {
|
|
11
|
+
var _this;
|
|
12
|
+
_this = PageObject.call(this, el) || this;
|
|
13
|
+
_this.section = el.locator('[part="section"]');
|
|
14
|
+
_this.close = new DsClose(el.locator('[part="close"]'));
|
|
15
|
+
_this.heading = el.locator('[part="heading"]');
|
|
16
|
+
return _this;
|
|
17
|
+
}
|
|
18
|
+
var _proto = DsNotification.prototype;
|
|
19
|
+
_proto.clickClose = function clickClose() {
|
|
20
|
+
return _async_to_generator(function() {
|
|
21
|
+
return _ts_generator(this, function(_state) {
|
|
22
|
+
switch(_state.label){
|
|
23
|
+
case 0:
|
|
24
|
+
return [
|
|
25
|
+
4,
|
|
26
|
+
this.close.click()
|
|
27
|
+
];
|
|
28
|
+
case 1:
|
|
29
|
+
_state.sent();
|
|
30
|
+
return [
|
|
31
|
+
2
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}).call(this);
|
|
36
|
+
};
|
|
37
|
+
_proto.assertToContainText = function assertToContainText(text) {
|
|
38
|
+
return _async_to_generator(function() {
|
|
39
|
+
return _ts_generator(this, function(_state) {
|
|
40
|
+
switch(_state.label){
|
|
41
|
+
case 0:
|
|
42
|
+
return [
|
|
43
|
+
4,
|
|
44
|
+
expect(this.el).toContainText(text)
|
|
45
|
+
];
|
|
46
|
+
case 1:
|
|
47
|
+
_state.sent();
|
|
48
|
+
return [
|
|
49
|
+
2
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}).call(this);
|
|
54
|
+
};
|
|
55
|
+
return DsNotification;
|
|
56
|
+
}(PageObject);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
3
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { expect } from '@playwright/test';
|
|
5
|
+
import { PageObject } from './page-object';
|
|
6
|
+
export var DsNumberInput = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsNumberInput, PageObject);
|
|
9
|
+
function DsNumberInput(el) {
|
|
10
|
+
var _this;
|
|
11
|
+
_this = PageObject.call(this, el) || this;
|
|
12
|
+
_this.nativeInput = el.locator('[part="input"]');
|
|
13
|
+
return _this;
|
|
14
|
+
}
|
|
15
|
+
var _proto = DsNumberInput.prototype;
|
|
16
|
+
_proto.clear = function clear() {
|
|
17
|
+
return _async_to_generator(function() {
|
|
18
|
+
return _ts_generator(this, function(_state) {
|
|
19
|
+
switch(_state.label){
|
|
20
|
+
case 0:
|
|
21
|
+
return [
|
|
22
|
+
4,
|
|
23
|
+
this.nativeInput.clear()
|
|
24
|
+
];
|
|
25
|
+
case 1:
|
|
26
|
+
_state.sent();
|
|
27
|
+
return [
|
|
28
|
+
2
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}).call(this);
|
|
33
|
+
};
|
|
34
|
+
_proto.fill = function fill(value) {
|
|
35
|
+
return _async_to_generator(function() {
|
|
36
|
+
return _ts_generator(this, function(_state) {
|
|
37
|
+
switch(_state.label){
|
|
38
|
+
case 0:
|
|
39
|
+
return [
|
|
40
|
+
4,
|
|
41
|
+
this.nativeInput.fill(value)
|
|
42
|
+
];
|
|
43
|
+
case 1:
|
|
44
|
+
_state.sent();
|
|
45
|
+
return [
|
|
46
|
+
2
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}).call(this);
|
|
51
|
+
};
|
|
52
|
+
_proto.blur = function blur() {
|
|
53
|
+
return _async_to_generator(function() {
|
|
54
|
+
return _ts_generator(this, function(_state) {
|
|
55
|
+
switch(_state.label){
|
|
56
|
+
case 0:
|
|
57
|
+
return [
|
|
58
|
+
4,
|
|
59
|
+
this.nativeInput.blur()
|
|
60
|
+
];
|
|
61
|
+
case 1:
|
|
62
|
+
_state.sent();
|
|
63
|
+
return [
|
|
64
|
+
2
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}).call(this);
|
|
69
|
+
};
|
|
70
|
+
_proto.assertValue = function assertValue(value) {
|
|
71
|
+
return _async_to_generator(function() {
|
|
72
|
+
return _ts_generator(this, function(_state) {
|
|
73
|
+
switch(_state.label){
|
|
74
|
+
case 0:
|
|
75
|
+
return [
|
|
76
|
+
4,
|
|
77
|
+
expect(this.nativeInput).toHaveValue(value)
|
|
78
|
+
];
|
|
79
|
+
case 1:
|
|
80
|
+
_state.sent();
|
|
81
|
+
return [
|
|
82
|
+
2
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}).call(this);
|
|
87
|
+
};
|
|
88
|
+
_proto.assertToBeDisabled = function assertToBeDisabled() {
|
|
89
|
+
return _async_to_generator(function() {
|
|
90
|
+
return _ts_generator(this, function(_state) {
|
|
91
|
+
switch(_state.label){
|
|
92
|
+
case 0:
|
|
93
|
+
return [
|
|
94
|
+
4,
|
|
95
|
+
expect(this.nativeInput).toBeDisabled()
|
|
96
|
+
];
|
|
97
|
+
case 1:
|
|
98
|
+
_state.sent();
|
|
99
|
+
return [
|
|
100
|
+
2
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}).call(this);
|
|
105
|
+
};
|
|
106
|
+
return DsNumberInput;
|
|
107
|
+
}(PageObject);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
3
|
+
import { expect } from '@playwright/test';
|
|
4
|
+
export var PageObject = /*#__PURE__*/ function() {
|
|
5
|
+
"use strict";
|
|
6
|
+
function PageObject(el) {
|
|
7
|
+
this.el = el;
|
|
8
|
+
}
|
|
9
|
+
var _proto = PageObject.prototype;
|
|
10
|
+
_proto.assertToBeVisible = function assertToBeVisible() {
|
|
11
|
+
return _async_to_generator(function() {
|
|
12
|
+
return _ts_generator(this, function(_state) {
|
|
13
|
+
switch(_state.label){
|
|
14
|
+
case 0:
|
|
15
|
+
return [
|
|
16
|
+
4,
|
|
17
|
+
expect(this.el).toBeVisible()
|
|
18
|
+
];
|
|
19
|
+
case 1:
|
|
20
|
+
_state.sent();
|
|
21
|
+
return [
|
|
22
|
+
2
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}).call(this);
|
|
27
|
+
};
|
|
28
|
+
_proto.assertToBeHidden = function assertToBeHidden() {
|
|
29
|
+
return _async_to_generator(function() {
|
|
30
|
+
return _ts_generator(this, function(_state) {
|
|
31
|
+
switch(_state.label){
|
|
32
|
+
case 0:
|
|
33
|
+
return [
|
|
34
|
+
4,
|
|
35
|
+
expect(this.el).toBeHidden()
|
|
36
|
+
];
|
|
37
|
+
case 1:
|
|
38
|
+
_state.sent();
|
|
39
|
+
return [
|
|
40
|
+
2
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}).call(this);
|
|
45
|
+
};
|
|
46
|
+
return PageObject;
|
|
47
|
+
}();
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
3
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { expect } from '@playwright/test';
|
|
5
|
+
import { PageObject } from './page-object';
|
|
6
|
+
export var DsPagination = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsPagination, PageObject);
|
|
9
|
+
function DsPagination(el) {
|
|
10
|
+
var _this;
|
|
11
|
+
_this = PageObject.call(this, el) || this;
|
|
12
|
+
_this.previousButton = el.locator('#previous');
|
|
13
|
+
_this.nextButton = el.locator('#next');
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
var _proto = DsPagination.prototype;
|
|
17
|
+
_proto.clickNext = function clickNext() {
|
|
18
|
+
return _async_to_generator(function() {
|
|
19
|
+
return _ts_generator(this, function(_state) {
|
|
20
|
+
switch(_state.label){
|
|
21
|
+
case 0:
|
|
22
|
+
return [
|
|
23
|
+
4,
|
|
24
|
+
this.nextButton.click()
|
|
25
|
+
];
|
|
26
|
+
case 1:
|
|
27
|
+
_state.sent();
|
|
28
|
+
return [
|
|
29
|
+
2
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}).call(this);
|
|
34
|
+
};
|
|
35
|
+
_proto.clickPrevious = function clickPrevious() {
|
|
36
|
+
return _async_to_generator(function() {
|
|
37
|
+
return _ts_generator(this, function(_state) {
|
|
38
|
+
switch(_state.label){
|
|
39
|
+
case 0:
|
|
40
|
+
return [
|
|
41
|
+
4,
|
|
42
|
+
this.previousButton.click()
|
|
43
|
+
];
|
|
44
|
+
case 1:
|
|
45
|
+
_state.sent();
|
|
46
|
+
return [
|
|
47
|
+
2
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}).call(this);
|
|
52
|
+
};
|
|
53
|
+
_proto.clickPage = function clickPage(pageNumber) {
|
|
54
|
+
return _async_to_generator(function() {
|
|
55
|
+
return _ts_generator(this, function(_state) {
|
|
56
|
+
switch(_state.label){
|
|
57
|
+
case 0:
|
|
58
|
+
return [
|
|
59
|
+
4,
|
|
60
|
+
this.el.locator("button").filter({
|
|
61
|
+
hasText: String(pageNumber)
|
|
62
|
+
}).first().click()
|
|
63
|
+
];
|
|
64
|
+
case 1:
|
|
65
|
+
_state.sent();
|
|
66
|
+
return [
|
|
67
|
+
2
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}).call(this);
|
|
72
|
+
};
|
|
73
|
+
_proto.assertCurrentPage = function assertCurrentPage(pageNumber) {
|
|
74
|
+
return _async_to_generator(function() {
|
|
75
|
+
return _ts_generator(this, function(_state) {
|
|
76
|
+
switch(_state.label){
|
|
77
|
+
case 0:
|
|
78
|
+
return [
|
|
79
|
+
4,
|
|
80
|
+
expect(this.el.locator('button.is-primary')).toContainText(String(pageNumber))
|
|
81
|
+
];
|
|
82
|
+
case 1:
|
|
83
|
+
_state.sent();
|
|
84
|
+
return [
|
|
85
|
+
2
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}).call(this);
|
|
90
|
+
};
|
|
91
|
+
_proto.assertToBeDisabled = function assertToBeDisabled() {
|
|
92
|
+
return _async_to_generator(function() {
|
|
93
|
+
return _ts_generator(this, function(_state) {
|
|
94
|
+
switch(_state.label){
|
|
95
|
+
case 0:
|
|
96
|
+
return [
|
|
97
|
+
4,
|
|
98
|
+
expect(this.el).toHaveClass(/is-disabled/)
|
|
99
|
+
];
|
|
100
|
+
case 1:
|
|
101
|
+
_state.sent();
|
|
102
|
+
return [
|
|
103
|
+
2
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}).call(this);
|
|
108
|
+
};
|
|
109
|
+
_proto.assertPreviousToBeDisabled = function assertPreviousToBeDisabled() {
|
|
110
|
+
return _async_to_generator(function() {
|
|
111
|
+
return _ts_generator(this, function(_state) {
|
|
112
|
+
switch(_state.label){
|
|
113
|
+
case 0:
|
|
114
|
+
return [
|
|
115
|
+
4,
|
|
116
|
+
expect(this.previousButton).toBeDisabled()
|
|
117
|
+
];
|
|
118
|
+
case 1:
|
|
119
|
+
_state.sent();
|
|
120
|
+
return [
|
|
121
|
+
2
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}).call(this);
|
|
126
|
+
};
|
|
127
|
+
_proto.assertNextToBeDisabled = function assertNextToBeDisabled() {
|
|
128
|
+
return _async_to_generator(function() {
|
|
129
|
+
return _ts_generator(this, function(_state) {
|
|
130
|
+
switch(_state.label){
|
|
131
|
+
case 0:
|
|
132
|
+
return [
|
|
133
|
+
4,
|
|
134
|
+
expect(this.nextButton).toBeDisabled()
|
|
135
|
+
];
|
|
136
|
+
case 1:
|
|
137
|
+
_state.sent();
|
|
138
|
+
return [
|
|
139
|
+
2
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}).call(this);
|
|
144
|
+
};
|
|
145
|
+
return DsPagination;
|
|
146
|
+
}(PageObject);
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
3
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { expect } from '@playwright/test';
|
|
5
|
+
import { PageObject } from './page-object';
|
|
6
|
+
export var DsPhoneInput = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsPhoneInput, PageObject);
|
|
9
|
+
function DsPhoneInput(el) {
|
|
10
|
+
var _this;
|
|
11
|
+
_this = PageObject.call(this, el) || this;
|
|
12
|
+
_this.inner = el.locator('[part="inner"]');
|
|
13
|
+
_this.label = el.locator('[part="label"]');
|
|
14
|
+
_this.control = el.locator('[part="control"]');
|
|
15
|
+
_this.description = el.locator('[part="description"]');
|
|
16
|
+
_this.nativeInput = el.locator('[part="input"]');
|
|
17
|
+
_this.trigger = el.locator('[part="country-trigger"]');
|
|
18
|
+
_this.filter = el.locator('#country-filter');
|
|
19
|
+
_this.listbox = el.locator('[role="listbox"]');
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
var _proto = DsPhoneInput.prototype;
|
|
23
|
+
_proto.option = function option(code) {
|
|
24
|
+
return this.el.locator("#country-option-" + code.toUpperCase());
|
|
25
|
+
};
|
|
26
|
+
_proto.fill = function fill(value) {
|
|
27
|
+
return _async_to_generator(function() {
|
|
28
|
+
return _ts_generator(this, function(_state) {
|
|
29
|
+
switch(_state.label){
|
|
30
|
+
case 0:
|
|
31
|
+
return [
|
|
32
|
+
4,
|
|
33
|
+
this.nativeInput.fill(value)
|
|
34
|
+
];
|
|
35
|
+
case 1:
|
|
36
|
+
_state.sent();
|
|
37
|
+
return [
|
|
38
|
+
2
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}).call(this);
|
|
43
|
+
};
|
|
44
|
+
_proto.type = function type(value) {
|
|
45
|
+
return _async_to_generator(function() {
|
|
46
|
+
return _ts_generator(this, function(_state) {
|
|
47
|
+
switch(_state.label){
|
|
48
|
+
case 0:
|
|
49
|
+
return [
|
|
50
|
+
4,
|
|
51
|
+
this.nativeInput.pressSequentially(value)
|
|
52
|
+
];
|
|
53
|
+
case 1:
|
|
54
|
+
_state.sent();
|
|
55
|
+
return [
|
|
56
|
+
2
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}).call(this);
|
|
61
|
+
};
|
|
62
|
+
_proto.paste = function paste(value) {
|
|
63
|
+
return _async_to_generator(function() {
|
|
64
|
+
return _ts_generator(this, function(_state) {
|
|
65
|
+
switch(_state.label){
|
|
66
|
+
case 0:
|
|
67
|
+
return [
|
|
68
|
+
4,
|
|
69
|
+
this.nativeInput.focus()
|
|
70
|
+
];
|
|
71
|
+
case 1:
|
|
72
|
+
_state.sent();
|
|
73
|
+
return [
|
|
74
|
+
4,
|
|
75
|
+
this.nativeInput.evaluate(function(el, next) {
|
|
76
|
+
var input = el;
|
|
77
|
+
input.value = next;
|
|
78
|
+
input.dispatchEvent(new InputEvent('input', {
|
|
79
|
+
bubbles: true,
|
|
80
|
+
composed: true,
|
|
81
|
+
inputType: 'insertFromPaste',
|
|
82
|
+
data: next
|
|
83
|
+
}));
|
|
84
|
+
}, value)
|
|
85
|
+
];
|
|
86
|
+
case 2:
|
|
87
|
+
_state.sent();
|
|
88
|
+
return [
|
|
89
|
+
2
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}).call(this);
|
|
94
|
+
};
|
|
95
|
+
_proto.blur = function blur() {
|
|
96
|
+
return _async_to_generator(function() {
|
|
97
|
+
return _ts_generator(this, function(_state) {
|
|
98
|
+
switch(_state.label){
|
|
99
|
+
case 0:
|
|
100
|
+
return [
|
|
101
|
+
4,
|
|
102
|
+
this.nativeInput.blur()
|
|
103
|
+
];
|
|
104
|
+
case 1:
|
|
105
|
+
_state.sent();
|
|
106
|
+
return [
|
|
107
|
+
2
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}).call(this);
|
|
112
|
+
};
|
|
113
|
+
_proto.open = function open() {
|
|
114
|
+
return _async_to_generator(function() {
|
|
115
|
+
return _ts_generator(this, function(_state) {
|
|
116
|
+
switch(_state.label){
|
|
117
|
+
case 0:
|
|
118
|
+
return [
|
|
119
|
+
4,
|
|
120
|
+
this.trigger.click()
|
|
121
|
+
];
|
|
122
|
+
case 1:
|
|
123
|
+
_state.sent();
|
|
124
|
+
return [
|
|
125
|
+
4,
|
|
126
|
+
this.filter.waitFor({
|
|
127
|
+
state: 'visible'
|
|
128
|
+
})
|
|
129
|
+
];
|
|
130
|
+
case 2:
|
|
131
|
+
_state.sent();
|
|
132
|
+
return [
|
|
133
|
+
2
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}).call(this);
|
|
138
|
+
};
|
|
139
|
+
_proto.selectCountry = function selectCountry(code) {
|
|
140
|
+
return _async_to_generator(function() {
|
|
141
|
+
return _ts_generator(this, function(_state) {
|
|
142
|
+
switch(_state.label){
|
|
143
|
+
case 0:
|
|
144
|
+
return [
|
|
145
|
+
4,
|
|
146
|
+
this.open()
|
|
147
|
+
];
|
|
148
|
+
case 1:
|
|
149
|
+
_state.sent();
|
|
150
|
+
return [
|
|
151
|
+
4,
|
|
152
|
+
this.filter.fill(code)
|
|
153
|
+
];
|
|
154
|
+
case 2:
|
|
155
|
+
_state.sent();
|
|
156
|
+
return [
|
|
157
|
+
4,
|
|
158
|
+
this.option(code).click()
|
|
159
|
+
];
|
|
160
|
+
case 3:
|
|
161
|
+
_state.sent();
|
|
162
|
+
return [
|
|
163
|
+
2
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}).call(this);
|
|
168
|
+
};
|
|
169
|
+
_proto.assertValue = function assertValue(value) {
|
|
170
|
+
return _async_to_generator(function() {
|
|
171
|
+
return _ts_generator(this, function(_state) {
|
|
172
|
+
switch(_state.label){
|
|
173
|
+
case 0:
|
|
174
|
+
return [
|
|
175
|
+
4,
|
|
176
|
+
expect(this.el).toHaveAttribute('value', value)
|
|
177
|
+
];
|
|
178
|
+
case 1:
|
|
179
|
+
_state.sent();
|
|
180
|
+
return [
|
|
181
|
+
2
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}).call(this);
|
|
186
|
+
};
|
|
187
|
+
_proto.assertNationalNumber = function assertNationalNumber(value) {
|
|
188
|
+
return _async_to_generator(function() {
|
|
189
|
+
return _ts_generator(this, function(_state) {
|
|
190
|
+
switch(_state.label){
|
|
191
|
+
case 0:
|
|
192
|
+
return [
|
|
193
|
+
4,
|
|
194
|
+
expect(this.nativeInput).toHaveValue(value)
|
|
195
|
+
];
|
|
196
|
+
case 1:
|
|
197
|
+
_state.sent();
|
|
198
|
+
return [
|
|
199
|
+
2
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}).call(this);
|
|
204
|
+
};
|
|
205
|
+
_proto.assertToBeDisabled = function assertToBeDisabled() {
|
|
206
|
+
return _async_to_generator(function() {
|
|
207
|
+
return _ts_generator(this, function(_state) {
|
|
208
|
+
switch(_state.label){
|
|
209
|
+
case 0:
|
|
210
|
+
return [
|
|
211
|
+
4,
|
|
212
|
+
expect(this.nativeInput).toBeDisabled()
|
|
213
|
+
];
|
|
214
|
+
case 1:
|
|
215
|
+
_state.sent();
|
|
216
|
+
return [
|
|
217
|
+
4,
|
|
218
|
+
expect(this.trigger).toBeDisabled()
|
|
219
|
+
];
|
|
220
|
+
case 2:
|
|
221
|
+
_state.sent();
|
|
222
|
+
return [
|
|
223
|
+
2
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}).call(this);
|
|
228
|
+
};
|
|
229
|
+
_proto.assertPickerDisabled = function assertPickerDisabled() {
|
|
230
|
+
return _async_to_generator(function() {
|
|
231
|
+
return _ts_generator(this, function(_state) {
|
|
232
|
+
switch(_state.label){
|
|
233
|
+
case 0:
|
|
234
|
+
return [
|
|
235
|
+
4,
|
|
236
|
+
expect(this.trigger).toBeDisabled()
|
|
237
|
+
];
|
|
238
|
+
case 1:
|
|
239
|
+
_state.sent();
|
|
240
|
+
return [
|
|
241
|
+
2
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}).call(this);
|
|
246
|
+
};
|
|
247
|
+
_proto.assertOpen = function assertOpen() {
|
|
248
|
+
return _async_to_generator(function() {
|
|
249
|
+
return _ts_generator(this, function(_state) {
|
|
250
|
+
switch(_state.label){
|
|
251
|
+
case 0:
|
|
252
|
+
return [
|
|
253
|
+
4,
|
|
254
|
+
expect(this.trigger).toHaveAttribute('aria-expanded', 'true')
|
|
255
|
+
];
|
|
256
|
+
case 1:
|
|
257
|
+
_state.sent();
|
|
258
|
+
return [
|
|
259
|
+
2
|
|
260
|
+
];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}).call(this);
|
|
264
|
+
};
|
|
265
|
+
_proto.assertClosed = function assertClosed() {
|
|
266
|
+
return _async_to_generator(function() {
|
|
267
|
+
return _ts_generator(this, function(_state) {
|
|
268
|
+
switch(_state.label){
|
|
269
|
+
case 0:
|
|
270
|
+
return [
|
|
271
|
+
4,
|
|
272
|
+
expect(this.trigger).toHaveAttribute('aria-expanded', 'false')
|
|
273
|
+
];
|
|
274
|
+
case 1:
|
|
275
|
+
_state.sent();
|
|
276
|
+
return [
|
|
277
|
+
2
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}).call(this);
|
|
282
|
+
};
|
|
283
|
+
_proto.assertToContainText = function assertToContainText(text) {
|
|
284
|
+
return _async_to_generator(function() {
|
|
285
|
+
return _ts_generator(this, function(_state) {
|
|
286
|
+
switch(_state.label){
|
|
287
|
+
case 0:
|
|
288
|
+
return [
|
|
289
|
+
4,
|
|
290
|
+
expect(this.el).toContainText(text)
|
|
291
|
+
];
|
|
292
|
+
case 1:
|
|
293
|
+
_state.sent();
|
|
294
|
+
return [
|
|
295
|
+
2
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}).call(this);
|
|
300
|
+
};
|
|
301
|
+
return DsPhoneInput;
|
|
302
|
+
}(PageObject);
|