@helvetia-design/playwright 0.0.0-stage → 0.0.2
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 +80472 -0
- package/README.md +0 -3
|
@@ -0,0 +1,200 @@
|
|
|
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 DsFileUpload = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsFileUpload, PageObject);
|
|
9
|
+
function DsFileUpload() {
|
|
10
|
+
var _this;
|
|
11
|
+
_this = PageObject.apply(this, arguments) || this, _this.dropZone = _this.el.locator('[part="drop-zone"]'), _this.fileList = _this.el.locator('[part="file-list"]'), _this.input = _this.el.locator('[part="input"]');
|
|
12
|
+
return _this;
|
|
13
|
+
}
|
|
14
|
+
var _proto = DsFileUpload.prototype;
|
|
15
|
+
_proto.click = function click(options) {
|
|
16
|
+
return _async_to_generator(function() {
|
|
17
|
+
return _ts_generator(this, function(_state) {
|
|
18
|
+
switch(_state.label){
|
|
19
|
+
case 0:
|
|
20
|
+
return [
|
|
21
|
+
4,
|
|
22
|
+
this.dropZone.click(options)
|
|
23
|
+
];
|
|
24
|
+
case 1:
|
|
25
|
+
_state.sent();
|
|
26
|
+
return [
|
|
27
|
+
2
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}).call(this);
|
|
32
|
+
};
|
|
33
|
+
_proto.setFocus = function setFocus() {
|
|
34
|
+
return _async_to_generator(function() {
|
|
35
|
+
return _ts_generator(this, function(_state) {
|
|
36
|
+
switch(_state.label){
|
|
37
|
+
case 0:
|
|
38
|
+
return [
|
|
39
|
+
4,
|
|
40
|
+
this.el.evaluate(function(el) {
|
|
41
|
+
return el.setFocus();
|
|
42
|
+
})
|
|
43
|
+
];
|
|
44
|
+
case 1:
|
|
45
|
+
_state.sent();
|
|
46
|
+
return [
|
|
47
|
+
2
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}).call(this);
|
|
52
|
+
};
|
|
53
|
+
_proto.clear = function clear() {
|
|
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.evaluate(function(el) {
|
|
61
|
+
return el.clear();
|
|
62
|
+
})
|
|
63
|
+
];
|
|
64
|
+
case 1:
|
|
65
|
+
_state.sent();
|
|
66
|
+
return [
|
|
67
|
+
2
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}).call(this);
|
|
72
|
+
};
|
|
73
|
+
_proto.assertToBeDisabled = function assertToBeDisabled() {
|
|
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).toHaveAttribute('disabled', '')
|
|
81
|
+
];
|
|
82
|
+
case 1:
|
|
83
|
+
_state.sent();
|
|
84
|
+
return [
|
|
85
|
+
2
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}).call(this);
|
|
90
|
+
};
|
|
91
|
+
_proto.assertToBeInvalid = function assertToBeInvalid() {
|
|
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).toHaveAttribute('invalid', '')
|
|
99
|
+
];
|
|
100
|
+
case 1:
|
|
101
|
+
_state.sent();
|
|
102
|
+
return [
|
|
103
|
+
2
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}).call(this);
|
|
108
|
+
};
|
|
109
|
+
_proto.assertToBeLoading = function assertToBeLoading() {
|
|
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.el).toHaveAttribute('loading', '')
|
|
117
|
+
];
|
|
118
|
+
case 1:
|
|
119
|
+
_state.sent();
|
|
120
|
+
return [
|
|
121
|
+
2
|
|
122
|
+
];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}).call(this);
|
|
126
|
+
};
|
|
127
|
+
_proto.assertToBeReadonly = function assertToBeReadonly() {
|
|
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.el).toHaveAttribute('readonly', '')
|
|
135
|
+
];
|
|
136
|
+
case 1:
|
|
137
|
+
_state.sent();
|
|
138
|
+
return [
|
|
139
|
+
2
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}).call(this);
|
|
144
|
+
};
|
|
145
|
+
_proto.assertToBeRequired = function assertToBeRequired() {
|
|
146
|
+
return _async_to_generator(function() {
|
|
147
|
+
return _ts_generator(this, function(_state) {
|
|
148
|
+
switch(_state.label){
|
|
149
|
+
case 0:
|
|
150
|
+
return [
|
|
151
|
+
4,
|
|
152
|
+
expect(this.el).toHaveAttribute('required', '')
|
|
153
|
+
];
|
|
154
|
+
case 1:
|
|
155
|
+
_state.sent();
|
|
156
|
+
return [
|
|
157
|
+
2
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}).call(this);
|
|
162
|
+
};
|
|
163
|
+
_proto.assertHasFileList = function assertHasFileList() {
|
|
164
|
+
return _async_to_generator(function() {
|
|
165
|
+
return _ts_generator(this, function(_state) {
|
|
166
|
+
switch(_state.label){
|
|
167
|
+
case 0:
|
|
168
|
+
return [
|
|
169
|
+
4,
|
|
170
|
+
expect(this.fileList).toBeVisible()
|
|
171
|
+
];
|
|
172
|
+
case 1:
|
|
173
|
+
_state.sent();
|
|
174
|
+
return [
|
|
175
|
+
2
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}).call(this);
|
|
180
|
+
};
|
|
181
|
+
_proto.assertHasNoFileList = function assertHasNoFileList() {
|
|
182
|
+
return _async_to_generator(function() {
|
|
183
|
+
return _ts_generator(this, function(_state) {
|
|
184
|
+
switch(_state.label){
|
|
185
|
+
case 0:
|
|
186
|
+
return [
|
|
187
|
+
4,
|
|
188
|
+
expect(this.fileList).not.toBeVisible()
|
|
189
|
+
];
|
|
190
|
+
case 1:
|
|
191
|
+
_state.sent();
|
|
192
|
+
return [
|
|
193
|
+
2
|
|
194
|
+
];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}).call(this);
|
|
198
|
+
};
|
|
199
|
+
return DsFileUpload;
|
|
200
|
+
}(PageObject);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 DsHeading = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsHeading, PageObject);
|
|
9
|
+
function DsHeading(el) {
|
|
10
|
+
return PageObject.call(this, el) || this;
|
|
11
|
+
}
|
|
12
|
+
var _proto = DsHeading.prototype;
|
|
13
|
+
_proto.assertToContainText = function assertToContainText(text) {
|
|
14
|
+
return _async_to_generator(function() {
|
|
15
|
+
return _ts_generator(this, function(_state) {
|
|
16
|
+
switch(_state.label){
|
|
17
|
+
case 0:
|
|
18
|
+
return [
|
|
19
|
+
4,
|
|
20
|
+
expect(this.el).toContainText(text)
|
|
21
|
+
];
|
|
22
|
+
case 1:
|
|
23
|
+
_state.sent();
|
|
24
|
+
return [
|
|
25
|
+
2
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}).call(this);
|
|
30
|
+
};
|
|
31
|
+
return DsHeading;
|
|
32
|
+
}(PageObject);
|
|
@@ -0,0 +1,71 @@
|
|
|
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 DsHint = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsHint, PageObject);
|
|
9
|
+
function DsHint(el) {
|
|
10
|
+
var _this;
|
|
11
|
+
_this = PageObject.call(this, el) || this;
|
|
12
|
+
_this.trigger = el.locator('[part="trigger"]');
|
|
13
|
+
return _this;
|
|
14
|
+
}
|
|
15
|
+
var _proto = DsHint.prototype;
|
|
16
|
+
_proto.clickTrigger = function clickTrigger() {
|
|
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.trigger.click()
|
|
24
|
+
];
|
|
25
|
+
case 1:
|
|
26
|
+
_state.sent();
|
|
27
|
+
return [
|
|
28
|
+
2
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}).call(this);
|
|
33
|
+
};
|
|
34
|
+
_proto.assertToBeOpen = function assertToBeOpen() {
|
|
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
|
+
expect(this.trigger).toHaveAttribute('aria-expanded', 'true')
|
|
42
|
+
];
|
|
43
|
+
case 1:
|
|
44
|
+
_state.sent();
|
|
45
|
+
return [
|
|
46
|
+
2
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}).call(this);
|
|
51
|
+
};
|
|
52
|
+
_proto.assertToBeClosed = function assertToBeClosed() {
|
|
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
|
+
expect(this.trigger).toHaveAttribute('aria-expanded', 'false')
|
|
60
|
+
];
|
|
61
|
+
case 1:
|
|
62
|
+
_state.sent();
|
|
63
|
+
return [
|
|
64
|
+
2
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}).call(this);
|
|
69
|
+
};
|
|
70
|
+
return DsHint;
|
|
71
|
+
}(PageObject);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
2
|
+
import { PageObject } from './page-object';
|
|
3
|
+
export var DsIcon = /*#__PURE__*/ function(PageObject) {
|
|
4
|
+
"use strict";
|
|
5
|
+
_inherits(DsIcon, PageObject);
|
|
6
|
+
function DsIcon(el) {
|
|
7
|
+
var _this;
|
|
8
|
+
_this = PageObject.call(this, el) || this;
|
|
9
|
+
_this.inner = el.locator('[part="inner"]');
|
|
10
|
+
return _this;
|
|
11
|
+
}
|
|
12
|
+
return DsIcon;
|
|
13
|
+
}(PageObject);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export * from './accordion.po';
|
|
2
|
+
export * from './datepicker.po';
|
|
3
|
+
export * from './carousel.po';
|
|
4
|
+
export * from './drawer.po';
|
|
5
|
+
export * from './hint.po';
|
|
6
|
+
export * from './popup.po';
|
|
7
|
+
export * from './input.po';
|
|
8
|
+
export * from './phone-input.po';
|
|
9
|
+
export * from './counter.po';
|
|
10
|
+
export * from './root.po';
|
|
11
|
+
export * from './badge.po';
|
|
12
|
+
export * from './button.po';
|
|
13
|
+
export * from './card.po';
|
|
14
|
+
export * from './close.po';
|
|
15
|
+
export * from './content.po';
|
|
16
|
+
export * from './data.po';
|
|
17
|
+
export * from './data-item.po';
|
|
18
|
+
export * from './divider.po';
|
|
19
|
+
export * from './file-upload.po';
|
|
20
|
+
export * from './app-footer.po';
|
|
21
|
+
export * from './heading.po';
|
|
22
|
+
export * from './brand-icon.po';
|
|
23
|
+
export * from './icon.po';
|
|
24
|
+
export * from './label.po';
|
|
25
|
+
export * from './number-input.po';
|
|
26
|
+
export * from './list.po';
|
|
27
|
+
export * from './logo.po';
|
|
28
|
+
export * from './modal.po';
|
|
29
|
+
export * from './app-navbar.po';
|
|
30
|
+
export * from './notification.po';
|
|
31
|
+
export * from './shape.po';
|
|
32
|
+
export * from './sheet.po';
|
|
33
|
+
export * from './slider.po';
|
|
34
|
+
export * from './snackbar.po';
|
|
35
|
+
export * from './spinner.po';
|
|
36
|
+
export * from './stack.po';
|
|
37
|
+
export * from './steps.po';
|
|
38
|
+
export * from './tabs.po';
|
|
39
|
+
export * from './tag.po';
|
|
40
|
+
export * from './text.po';
|
|
41
|
+
export * from './tooltip.po';
|
|
42
|
+
export * from './textarea.po';
|
|
43
|
+
export * from './toast.po';
|
|
44
|
+
export * from './checkbox.po';
|
|
45
|
+
export * from './radio.po';
|
|
46
|
+
export * from './segment.po';
|
|
47
|
+
export * from './select.po';
|
|
48
|
+
export * from './toggle.po';
|
|
49
|
+
export * from './pagination.po';
|
|
@@ -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 DsInput = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsInput, PageObject);
|
|
9
|
+
function DsInput(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 = DsInput.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 DsInput;
|
|
107
|
+
}(PageObject);
|
|
@@ -0,0 +1,32 @@
|
|
|
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 DsLabel = /*#__PURE__*/ function(PageObject) {
|
|
7
|
+
"use strict";
|
|
8
|
+
_inherits(DsLabel, PageObject);
|
|
9
|
+
function DsLabel(el) {
|
|
10
|
+
return PageObject.call(this, el) || this;
|
|
11
|
+
}
|
|
12
|
+
var _proto = DsLabel.prototype;
|
|
13
|
+
_proto.assertToContainText = function assertToContainText(text) {
|
|
14
|
+
return _async_to_generator(function() {
|
|
15
|
+
return _ts_generator(this, function(_state) {
|
|
16
|
+
switch(_state.label){
|
|
17
|
+
case 0:
|
|
18
|
+
return [
|
|
19
|
+
4,
|
|
20
|
+
expect(this.el).toContainText(text)
|
|
21
|
+
];
|
|
22
|
+
case 1:
|
|
23
|
+
_state.sent();
|
|
24
|
+
return [
|
|
25
|
+
2
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}).call(this);
|
|
30
|
+
};
|
|
31
|
+
return DsLabel;
|
|
32
|
+
}(PageObject);
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { DsAccordion } from './accordion.po';
|
|
7
|
+
export var DsList = /*#__PURE__*/ function(PageObject) {
|
|
8
|
+
"use strict";
|
|
9
|
+
_inherits(DsList, PageObject);
|
|
10
|
+
function DsList(el) {
|
|
11
|
+
var _this;
|
|
12
|
+
_this = PageObject.call(this, el) || this;
|
|
13
|
+
_this.list = el.locator('[part="list"]');
|
|
14
|
+
return _this;
|
|
15
|
+
}
|
|
16
|
+
var _proto = DsList.prototype;
|
|
17
|
+
_proto.assertToContainText = function assertToContainText(text) {
|
|
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
|
+
expect(this.el).toContainText(text)
|
|
25
|
+
];
|
|
26
|
+
case 1:
|
|
27
|
+
_state.sent();
|
|
28
|
+
return [
|
|
29
|
+
2
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}).call(this);
|
|
34
|
+
};
|
|
35
|
+
return DsList;
|
|
36
|
+
}(PageObject);
|
|
37
|
+
export var DsItem = /*#__PURE__*/ function(PageObject) {
|
|
38
|
+
"use strict";
|
|
39
|
+
_inherits(DsItem, PageObject);
|
|
40
|
+
function DsItem(el) {
|
|
41
|
+
var _this;
|
|
42
|
+
_this = PageObject.call(this, el) || this;
|
|
43
|
+
_this.item = el.locator('[part="item"]');
|
|
44
|
+
_this.accordion = new DsAccordion(el.locator('[part="accordion"]'));
|
|
45
|
+
_this.accordionContent = el.locator('[part="accordion-content"]');
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
var _proto = DsItem.prototype;
|
|
49
|
+
_proto.clickItem = function clickItem() {
|
|
50
|
+
return _async_to_generator(function() {
|
|
51
|
+
return _ts_generator(this, function(_state) {
|
|
52
|
+
switch(_state.label){
|
|
53
|
+
case 0:
|
|
54
|
+
return [
|
|
55
|
+
4,
|
|
56
|
+
this.item.click()
|
|
57
|
+
];
|
|
58
|
+
case 1:
|
|
59
|
+
_state.sent();
|
|
60
|
+
return [
|
|
61
|
+
2
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}).call(this);
|
|
66
|
+
};
|
|
67
|
+
return DsItem;
|
|
68
|
+
}(PageObject);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { _ as _inherits } from "@swc/helpers/_/_inherits";
|
|
2
|
+
import { PageObject } from './page-object';
|
|
3
|
+
export var DsLogo = /*#__PURE__*/ function(PageObject) {
|
|
4
|
+
"use strict";
|
|
5
|
+
_inherits(DsLogo, PageObject);
|
|
6
|
+
function DsLogo(el) {
|
|
7
|
+
var _this;
|
|
8
|
+
_this = PageObject.call(this, el) || this;
|
|
9
|
+
_this.animated = el.locator('[part="animated"]');
|
|
10
|
+
return _this;
|
|
11
|
+
}
|
|
12
|
+
return DsLogo;
|
|
13
|
+
}(PageObject);
|
|
@@ -0,0 +1,97 @@
|
|
|
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 DsModal = /*#__PURE__*/ function(PageObject) {
|
|
8
|
+
"use strict";
|
|
9
|
+
_inherits(DsModal, PageObject);
|
|
10
|
+
function DsModal(el) {
|
|
11
|
+
var _this;
|
|
12
|
+
_this = PageObject.call(this, el) || this;
|
|
13
|
+
_this.dialog = el.locator('[part="dialog"]');
|
|
14
|
+
_this.title = el.locator('[part="title"]');
|
|
15
|
+
_this.body = el.locator('[part="body"]');
|
|
16
|
+
_this.close = new DsClose(el.locator('[part="close"]'));
|
|
17
|
+
return _this;
|
|
18
|
+
}
|
|
19
|
+
var _proto = DsModal.prototype;
|
|
20
|
+
_proto.clickClose = function clickClose() {
|
|
21
|
+
return _async_to_generator(function() {
|
|
22
|
+
return _ts_generator(this, function(_state) {
|
|
23
|
+
switch(_state.label){
|
|
24
|
+
case 0:
|
|
25
|
+
return [
|
|
26
|
+
4,
|
|
27
|
+
this.close.click()
|
|
28
|
+
];
|
|
29
|
+
case 1:
|
|
30
|
+
_state.sent();
|
|
31
|
+
return [
|
|
32
|
+
2
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}).call(this);
|
|
37
|
+
};
|
|
38
|
+
_proto.assertToBeOpen = function assertToBeOpen() {
|
|
39
|
+
return _async_to_generator(function() {
|
|
40
|
+
return _ts_generator(this, function(_state) {
|
|
41
|
+
switch(_state.label){
|
|
42
|
+
case 0:
|
|
43
|
+
return [
|
|
44
|
+
4,
|
|
45
|
+
expect(this.dialog).toHaveAttribute('open')
|
|
46
|
+
];
|
|
47
|
+
case 1:
|
|
48
|
+
_state.sent();
|
|
49
|
+
return [
|
|
50
|
+
2
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}).call(this);
|
|
55
|
+
};
|
|
56
|
+
_proto.assertToBeClosed = function assertToBeClosed() {
|
|
57
|
+
return _async_to_generator(function() {
|
|
58
|
+
return _ts_generator(this, function(_state) {
|
|
59
|
+
switch(_state.label){
|
|
60
|
+
case 0:
|
|
61
|
+
return [
|
|
62
|
+
4,
|
|
63
|
+
expect(this.el).not.toHaveAttribute('open')
|
|
64
|
+
];
|
|
65
|
+
case 1:
|
|
66
|
+
_state.sent();
|
|
67
|
+
return [
|
|
68
|
+
2
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}).call(this);
|
|
73
|
+
};
|
|
74
|
+
_proto.assertTitleText = function assertTitleText(text) {
|
|
75
|
+
return _async_to_generator(function() {
|
|
76
|
+
return _ts_generator(this, function(_state) {
|
|
77
|
+
switch(_state.label){
|
|
78
|
+
case 0:
|
|
79
|
+
// The shadow h2[part="title"] contains a <slot name="header"> — slotted text
|
|
80
|
+
// is in light DOM and not readable via the shadow locator. Query the slotted
|
|
81
|
+
// element directly (ds-modal-header sets slot="header" on itself; direct usage
|
|
82
|
+
// also uses slot="header").
|
|
83
|
+
return [
|
|
84
|
+
4,
|
|
85
|
+
expect(this.el.locator('[slot="header"]')).toContainText(text)
|
|
86
|
+
];
|
|
87
|
+
case 1:
|
|
88
|
+
_state.sent();
|
|
89
|
+
return [
|
|
90
|
+
2
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}).call(this);
|
|
95
|
+
};
|
|
96
|
+
return DsModal;
|
|
97
|
+
}(PageObject);
|