@agnos-ui/page-objects 0.0.1-alpha.1 → 0.0.1-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +82 -10
- package/dist/lib/index.js +1 -1
- package/dist/lib/index.mjs +164 -75
- package/package.json +50 -7
package/dist/lib/index.d.ts
CHANGED
|
@@ -149,6 +149,24 @@ export declare const paginationSelectors: {
|
|
|
149
149
|
ellipses: string;
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
+
export declare class ProgressbarPO extends BasePO {
|
|
153
|
+
selectors: {
|
|
154
|
+
rootComponent: string;
|
|
155
|
+
outerBar: string;
|
|
156
|
+
innerBar: string;
|
|
157
|
+
};
|
|
158
|
+
getComponentSelector(): string;
|
|
159
|
+
get locatorOuterBar(): Locator;
|
|
160
|
+
get locatorInnerBar(): Locator;
|
|
161
|
+
state(): Promise<State>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export declare const progressbarSelectors: {
|
|
165
|
+
rootComponent: string;
|
|
166
|
+
outerBar: string;
|
|
167
|
+
innerBar: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
152
170
|
export declare class RatingPO extends BasePO {
|
|
153
171
|
selectors: {
|
|
154
172
|
rootComponent: string;
|
|
@@ -190,6 +208,10 @@ export declare class SelectPO extends BasePO {
|
|
|
190
208
|
* Menu container
|
|
191
209
|
*/
|
|
192
210
|
get locatorMenu(): Locator_2;
|
|
211
|
+
/**
|
|
212
|
+
* Return the first menu item locator including the text
|
|
213
|
+
*/
|
|
214
|
+
get locatorMenuItems(): Locator_2;
|
|
193
215
|
/**
|
|
194
216
|
* Return the first menu item locator including the text
|
|
195
217
|
*/
|
|
@@ -202,19 +224,12 @@ export declare class SelectPO extends BasePO {
|
|
|
202
224
|
* Return the first badge locator including the text
|
|
203
225
|
*/
|
|
204
226
|
locatorBadgeItem(text: string): Locator_2;
|
|
205
|
-
/**
|
|
206
|
-
* Return the cross locator for the first badge including the text
|
|
207
|
-
*/
|
|
208
|
-
locatorBadgeItemCross(text: string): Locator_2;
|
|
209
227
|
state(): Promise<{
|
|
210
228
|
text: string;
|
|
211
|
-
badges: string[]
|
|
229
|
+
badges: (string | undefined)[];
|
|
212
230
|
isOpen: boolean;
|
|
213
|
-
list:
|
|
214
|
-
|
|
215
|
-
hasCheckBox: boolean;
|
|
216
|
-
isChecked: boolean;
|
|
217
|
-
}[];
|
|
231
|
+
list: (string | undefined)[];
|
|
232
|
+
checked: (string | undefined)[];
|
|
218
233
|
}>;
|
|
219
234
|
}
|
|
220
235
|
|
|
@@ -222,4 +237,61 @@ export declare const selectSelectors: {
|
|
|
222
237
|
rootComponent: string;
|
|
223
238
|
};
|
|
224
239
|
|
|
240
|
+
export declare class SliderPO extends BasePO {
|
|
241
|
+
selectors: {
|
|
242
|
+
rootComponent: string;
|
|
243
|
+
clickableArea: string;
|
|
244
|
+
handle: string;
|
|
245
|
+
minLabelHorizontal: string;
|
|
246
|
+
maxLabelHorizontal: string;
|
|
247
|
+
minLabelVertical: string;
|
|
248
|
+
maxLabelVertical: string;
|
|
249
|
+
valueLabel: string;
|
|
250
|
+
progress: string;
|
|
251
|
+
};
|
|
252
|
+
getComponentSelector(): string;
|
|
253
|
+
get locatorHandle(): Locator;
|
|
254
|
+
get locatorMinLabelHorizontal(): Locator;
|
|
255
|
+
get locatorMaxLabelHorizontal(): Locator;
|
|
256
|
+
get locatorMinLabelVertical(): Locator;
|
|
257
|
+
get locatorMaxLabelVertical(): Locator;
|
|
258
|
+
get locatorProgress(): Locator;
|
|
259
|
+
get locatorValueLabel(): Locator;
|
|
260
|
+
sliderHandleState(): Promise<{
|
|
261
|
+
style: string | null;
|
|
262
|
+
value: string | null;
|
|
263
|
+
min: string | null;
|
|
264
|
+
max: string | null;
|
|
265
|
+
text: string | null;
|
|
266
|
+
disabled: string | null;
|
|
267
|
+
readonly: string | null;
|
|
268
|
+
ariaLabel: string | null;
|
|
269
|
+
}[]>;
|
|
270
|
+
sliderProgressState(): Promise<(string | null)[]>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export declare const sliderSelectors: {
|
|
274
|
+
rootComponent: string;
|
|
275
|
+
clickableArea: string;
|
|
276
|
+
handle: string;
|
|
277
|
+
minLabelHorizontal: string;
|
|
278
|
+
maxLabelHorizontal: string;
|
|
279
|
+
minLabelVertical: string;
|
|
280
|
+
maxLabelVertical: string;
|
|
281
|
+
valueLabel: string;
|
|
282
|
+
progress: string;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export declare interface State {
|
|
286
|
+
ariaLabel: string | null;
|
|
287
|
+
ariaValueNow: string | null;
|
|
288
|
+
ariaValueMin: string | null;
|
|
289
|
+
ariaValueMax: string | null;
|
|
290
|
+
ariaValueText: string | null;
|
|
291
|
+
label: string | null | undefined;
|
|
292
|
+
innerClasses: string[];
|
|
293
|
+
outerHeight: string | undefined;
|
|
294
|
+
innerWidth: string | undefined;
|
|
295
|
+
}
|
|
296
|
+
|
|
225
297
|
export { }
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.defineProperty;var B=(s,a,t)=>a in s?R(s,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[a]=t;var i=(s,a,t)=>(B(s,typeof a!="symbol"?a+"":a,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@agnos-ui/base-po"),A={rootComponent:".modal",closeButton:".btn-close",backdrop:"xpath=./preceding-sibling::div[contains(@class,'modal-backdrop')]",header:".modal-header",title:".modal-title",body:".modal-body",footer:".modal-footer"};class O extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(A))}getComponentSelector(){return this.selectors.rootComponent}get locatorHeader(){return this.locatorRoot.locator(this.selectors.header)}get locatorTitle(){return this.locatorHeader.locator(this.selectors.title)}get locatorBody(){return this.locatorRoot.locator(this.selectors.body)}get locatorFooter(){return this.locatorRoot.locator(this.selectors.footer)}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}get locatorBackdrop(){return this.locatorRoot.locator(this.selectors.backdrop)}}const x={rootComponent:".au-pagination",activePage:".active",previousPage:".au-previous",nextPage:".au-next",firstPage:".au-first",lastPage:".au-last",pages:".au-page",ellipses:".au-ellipsis"};class f extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(x))}getComponentSelector(){return this.selectors.rootComponent}get locatorActivePage(){return this.locatorRoot.locator(this.selectors.activePage)}get locatorPreviousButton(){return this.locatorRoot.locator(this.selectors.previousPage)}get locatorNextButton(){return this.locatorRoot.locator(this.selectors.nextPage)}get locatorFirstButton(){return this.locatorRoot.locator(this.selectors.firstPage)}get locatorLastButton(){return this.locatorRoot.locator(this.selectors.lastPage)}get locatorPages(){return this.locatorRoot.locator(this.selectors.pages)}locatorNthPage(t){return this.locatorRoot.locator(this.selectors.pages).nth(t-1)}locatorPage(t){return this.locatorRoot.locator(this.selectors.pages,{hasText:t})}get locatorEllipses(){return this.locatorRoot.locator(this.selectors.ellipses)}}const P={rootComponent:".au-rating",star:".au-rating-star"};class L extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(P))}getComponentSelector(){return this.selectors.rootComponent}locatorStar(t){return this.locatorRoot.locator(this.selectors.star).nth(t)}async state(){return await this.locatorRoot.evaluate((t,e)=>{const c=[...t.querySelectorAll(e.star)],l=[],r=[];for(const o of c)l.push((o.textContent||"").trim()),r.push(o.className.split(" "));return{rootClasses:t.className.trim().split(" "),value:t.getAttribute("aria-valuenow"),min:t.getAttribute("aria-valuemin"),max:t.getAttribute("aria-valuemax"),text:t.getAttribute("aria-valuetext"),disabled:t.getAttribute("aria-disabled"),readonly:t.getAttribute("aria-readonly"),stars:l,classes:r}},this.selectors)}}const C={rootComponent:".au-select"};class H extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(C))}getComponentSelector(){return this.selectors.rootComponent}get locatorInput(){return this.locatorRoot.locator('input[type="text"]').nth(0)}get locatorMenu(){return this.locatorRoot.locator(".dropdown-menu")}get locatorMenuItems(){return this.locatorMenu.locator(".au-select-item")}locatorMenuItem(t){return this.locatorMenu.getByText(t).nth(0)}get locatorBadges(){return this.locatorRoot.locator("div.au-select-badge")}locatorBadgeItem(t){return this.locatorBadges.filter({hasText:t}).nth(0)}async state(){return await this.locatorRoot.evaluate(t=>{var g,b;const e=t.querySelector('div[role="combobox"]'),c=t.querySelector('input[type="text"]'),l=[];if(e){const m=e.querySelectorAll("div.au-select-badge");for(const u of m)l.push((g=u==null?void 0:u.textContent)==null?void 0:g.trim())}const r=t.querySelector("ul.dropdown-menu"),o=r!=null,d=[],h=[];if(r!=null){const m=r.querySelectorAll("li.dropdown-item");for(const u of m){const p=(b=u.textContent)==null?void 0:b.trim();d.push(p),u.classList.contains("selected")&&h.push(p)}}return{text:c.value,badges:l,isOpen:o,list:d,checked:h}})}}const y={rootComponent:".alert",closeButton:".btn-close"};class M extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(y))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}class I extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",{item:".accordion-item",collapse:".accordion-collapse",body:".accordion-body",header:".accordion-header",buttons:".accordion-button"})}getComponentSelector(){return".accordion"}get locatorAccordionItems(){return this.locatorRoot.locator(this.selectors.item)}locatorAccordionItem(t){return this.locatorRoot.locator(this.selectors.item).nth(t)}get locatorAccordionCollapses(){return this.locatorAccordionItems.locator(this.selectors.collapse)}locatorAccordionCollapse(t){return this.locatorAccordionItem(t).locator(this.selectors.collapse)}get locatorAccordionBodies(){return this.locatorAccordionCollapses.locator(this.selectors.body)}locatorAccordionBody(t){return this.locatorAccordionCollapse(t).locator(this.selectors.body)}get locatorAccordionHeaders(){return this.locatorAccordionItems.locator(this.selectors.header)}locatorAccordionHeader(t){return this.locatorAccordionItem(t).locator(this.selectors.header)}get locatorAccordionButtons(){return this.locatorAccordionHeaders.locator(this.selectors.buttons)}locatorAccordionButton(t){return this.locatorAccordionHeader(t).locator(this.selectors.buttons)}async state(){return await this.locatorRoot.evaluate(t=>{const e=[...t.querySelectorAll(".accordion-item")],c=[];for(const l of e){const r=l.querySelector(".accordion-collapse"),o=l.querySelector(".accordion-button");c.push({classes:l.className.trim().split(" "),id:l.id,isInDOM:r!==null,collapseId:r==null?void 0:r.id,buttonId:o==null?void 0:o.id,expanded:o==null?void 0:o.getAttribute("aria-expanded"),disabled:o==null?void 0:o.getAttribute("aria-disabled"),labeledBy:r==null?void 0:r.getAttribute("aria-labelledby"),buttonControls:o==null?void 0:o.getAttribute("aria-controls")})}return{rootClasses:t.className.trim().split(" "),items:c}})}}const S={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class q extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(S))}getComponentSelector(){return this.selectors.rootComponent}get locatorOuterBar(){return this.locatorRoot.locator(this.selectors.outerBar)}get locatorInnerBar(){return this.locatorRoot.locator(this.selectors.innerBar)}async state(){return this.locatorRoot.evaluate(t=>{var l,r,o,d,h,g;const e=t.querySelector(".progress-bar"),c=t.querySelector(".progress");return{ariaLabel:t.getAttribute("aria-label"),ariaValueNow:t.getAttribute("aria-valuenow"),ariaValueMin:t.getAttribute("aria-valuemin"),ariaValueMax:t.getAttribute("aria-valuemax"),ariaValueText:t.getAttribute("aria-valuetext"),label:(l=e==null?void 0:e.textContent)==null?void 0:l.trim(),innerClasses:((d=(o=(r=e==null?void 0:e.className)==null?void 0:r.trim())==null?void 0:o.split(" "))==null?void 0:d.sort())??[],outerHeight:(h=c==null?void 0:c.style)==null?void 0:h.height,innerWidth:(g=e==null?void 0:e.style)==null?void 0:g.width}})}}const v={rootComponent:".au-slider",clickableArea:".au-slider-clickable-area",handle:".au-slider-handle",minLabelHorizontal:".au-slider-label-min",maxLabelHorizontal:".au-slider-label-max",minLabelVertical:".au-slider-label-vertical-min",maxLabelVertical:".au-slider-label-vertical-max",valueLabel:".au-slider-label-now",progress:".au-slider-progress"};class w extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(v))}getComponentSelector(){return this.selectors.rootComponent}get locatorHandle(){return this.locatorRoot.locator(this.selectors.handle)}get locatorMinLabelHorizontal(){return this.locatorRoot.locator(this.selectors.minLabelHorizontal)}get locatorMaxLabelHorizontal(){return this.locatorRoot.locator(this.selectors.maxLabelHorizontal)}get locatorMinLabelVertical(){return this.locatorRoot.locator(this.selectors.minLabelVertical)}get locatorMaxLabelVertical(){return this.locatorRoot.locator(this.selectors.maxLabelVertical)}get locatorProgress(){return this.locatorRoot.locator(this.selectors.progress)}get locatorValueLabel(){return this.locatorRoot.locator(this.selectors.valueLabel)}async sliderHandleState(){return this.locatorRoot.locator(this.selectors.handle).evaluateAll(t=>t.map(e=>({style:e.getAttribute("style"),value:e.getAttribute("aria-valuenow"),min:e.getAttribute("aria-valuemin"),max:e.getAttribute("aria-valuemax"),text:e.getAttribute("aria-valuetext"),disabled:e.getAttribute("aria-disabled"),readonly:e.getAttribute("aria-readonly"),ariaLabel:e.getAttribute("aria-label")})))}async sliderProgressState(){return this.locatorRoot.locator(this.selectors.progress).evaluateAll(t=>t.map(e=>e.getAttribute("style")))}}exports.AccordionPO=I;exports.AlertPO=M;exports.ModalPO=O;exports.PaginationPO=f;exports.ProgressbarPO=q;exports.RatingPO=L;exports.SelectPO=H;exports.SliderPO=w;exports.alertSelectors=y;exports.modalSelectors=A;exports.paginationSelectors=x;exports.progressbarSelectors=S;exports.ratingSelectors=P;exports.selectSelectors=C;exports.sliderSelectors=v;
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
|
-
var x = (s,
|
|
3
|
-
var
|
|
2
|
+
var x = (s, a, t) => a in s ? A(s, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[a] = t;
|
|
3
|
+
var i = (s, a, t) => (x(s, typeof a != "symbol" ? a + "" : a, t), t);
|
|
4
4
|
import { BasePO as n } from "@agnos-ui/base-po";
|
|
5
|
-
const
|
|
5
|
+
const C = {
|
|
6
6
|
// TODO: should we use bootstrap-independent classes starting with au- ?
|
|
7
7
|
rootComponent: ".modal",
|
|
8
8
|
closeButton: ".btn-close",
|
|
@@ -12,10 +12,10 @@ const y = {
|
|
|
12
12
|
body: ".modal-body",
|
|
13
13
|
footer: ".modal-footer"
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class H extends n {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
|
|
18
|
+
i(this, "selectors", structuredClone(C));
|
|
19
19
|
}
|
|
20
20
|
getComponentSelector() {
|
|
21
21
|
return this.selectors.rootComponent;
|
|
@@ -39,7 +39,7 @@ class I extends n {
|
|
|
39
39
|
return this.locatorRoot.locator(this.selectors.backdrop);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const y = {
|
|
43
43
|
rootComponent: ".au-pagination",
|
|
44
44
|
activePage: ".active",
|
|
45
45
|
previousPage: ".au-previous",
|
|
@@ -49,10 +49,10 @@ const B = {
|
|
|
49
49
|
pages: ".au-page",
|
|
50
50
|
ellipses: ".au-ellipsis"
|
|
51
51
|
};
|
|
52
|
-
class
|
|
52
|
+
class I extends n {
|
|
53
53
|
constructor() {
|
|
54
54
|
super(...arguments);
|
|
55
|
-
|
|
55
|
+
i(this, "selectors", structuredClone(y));
|
|
56
56
|
}
|
|
57
57
|
// TODO should we add this in the list of selector ?
|
|
58
58
|
// Depend on the setSelectors usage...
|
|
@@ -113,14 +113,14 @@ class q extends n {
|
|
|
113
113
|
return this.locatorRoot.locator(this.selectors.ellipses);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
const
|
|
116
|
+
const v = {
|
|
117
117
|
rootComponent: ".au-rating",
|
|
118
118
|
star: ".au-rating-star"
|
|
119
119
|
};
|
|
120
|
-
class
|
|
120
|
+
class M extends n {
|
|
121
121
|
constructor() {
|
|
122
122
|
super(...arguments);
|
|
123
|
-
|
|
123
|
+
i(this, "selectors", structuredClone(v));
|
|
124
124
|
}
|
|
125
125
|
getComponentSelector() {
|
|
126
126
|
return this.selectors.rootComponent;
|
|
@@ -134,10 +134,10 @@ class k extends n {
|
|
|
134
134
|
// TODO to be pushed to the test itself
|
|
135
135
|
// We already discuss with Guillaume Saas not to put this in the basic PO which should only return locator basically
|
|
136
136
|
async state() {
|
|
137
|
-
return await this.locatorRoot.evaluate((t,
|
|
138
|
-
const
|
|
139
|
-
for (const o of
|
|
140
|
-
|
|
137
|
+
return await this.locatorRoot.evaluate((t, e) => {
|
|
138
|
+
const c = [...t.querySelectorAll(e.star)], l = [], r = [];
|
|
139
|
+
for (const o of c)
|
|
140
|
+
l.push((o.textContent || "").trim()), r.push(o.className.split(" "));
|
|
141
141
|
return {
|
|
142
142
|
rootClasses: t.className.trim().split(" "),
|
|
143
143
|
value: t.getAttribute("aria-valuenow"),
|
|
@@ -146,20 +146,20 @@ class k extends n {
|
|
|
146
146
|
text: t.getAttribute("aria-valuetext"),
|
|
147
147
|
disabled: t.getAttribute("aria-disabled"),
|
|
148
148
|
readonly: t.getAttribute("aria-readonly"),
|
|
149
|
-
stars:
|
|
149
|
+
stars: l,
|
|
150
150
|
classes: r
|
|
151
151
|
};
|
|
152
152
|
}, this.selectors);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const R = {
|
|
156
156
|
rootComponent: ".au-select"
|
|
157
157
|
// TODO add selector list
|
|
158
158
|
};
|
|
159
|
-
class
|
|
159
|
+
class w extends n {
|
|
160
160
|
constructor() {
|
|
161
161
|
super(...arguments);
|
|
162
|
-
|
|
162
|
+
i(this, "selectors", structuredClone(R));
|
|
163
163
|
}
|
|
164
164
|
getComponentSelector() {
|
|
165
165
|
return this.selectors.rootComponent;
|
|
@@ -168,7 +168,7 @@ class O extends n {
|
|
|
168
168
|
* Get the main title locator of the feature page
|
|
169
169
|
*/
|
|
170
170
|
get locatorInput() {
|
|
171
|
-
return this.locatorRoot.locator(
|
|
171
|
+
return this.locatorRoot.locator('input[type="text"]').nth(0);
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Menu container
|
|
@@ -176,6 +176,12 @@ class O extends n {
|
|
|
176
176
|
get locatorMenu() {
|
|
177
177
|
return this.locatorRoot.locator(".dropdown-menu");
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Return the first menu item locator including the text
|
|
181
|
+
*/
|
|
182
|
+
get locatorMenuItems() {
|
|
183
|
+
return this.locatorMenu.locator(".au-select-item");
|
|
184
|
+
}
|
|
179
185
|
/**
|
|
180
186
|
* Return the first menu item locator including the text
|
|
181
187
|
*/
|
|
@@ -186,63 +192,49 @@ class O extends n {
|
|
|
186
192
|
* Bages container
|
|
187
193
|
*/
|
|
188
194
|
get locatorBadges() {
|
|
189
|
-
return this.locatorRoot.locator("div.
|
|
195
|
+
return this.locatorRoot.locator("div.au-select-badge");
|
|
190
196
|
}
|
|
191
197
|
/**
|
|
192
198
|
* Return the first badge locator including the text
|
|
193
199
|
*/
|
|
194
200
|
locatorBadgeItem(t) {
|
|
195
|
-
return this.locatorBadges.
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Return the cross locator for the first badge including the text
|
|
199
|
-
*/
|
|
200
|
-
locatorBadgeItemCross(t) {
|
|
201
|
-
return this.locatorBadgeItem(t).getByRole("button");
|
|
201
|
+
return this.locatorBadges.filter({ hasText: t }).nth(0);
|
|
202
202
|
}
|
|
203
|
-
// TODO to be pushed to the test itself
|
|
204
|
-
// We already discuss with Guillaume Saas not to put this in the basic PO which should only return locator basically
|
|
205
203
|
async state() {
|
|
206
204
|
return await this.locatorRoot.evaluate((t) => {
|
|
207
|
-
var
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
const
|
|
211
|
-
for (const u of
|
|
212
|
-
|
|
213
|
-
r.push([...d.map((h) => (h.textContent ?? "").trim())]);
|
|
214
|
-
}
|
|
205
|
+
var g, p;
|
|
206
|
+
const e = t.querySelector('div[role="combobox"]'), c = t.querySelector('input[type="text"]'), l = [];
|
|
207
|
+
if (e) {
|
|
208
|
+
const m = e.querySelectorAll("div.au-select-badge");
|
|
209
|
+
for (const u of m)
|
|
210
|
+
l.push((g = u == null ? void 0 : u.textContent) == null ? void 0 : g.trim());
|
|
215
211
|
}
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
const
|
|
219
|
-
for (const u of
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
b && (d = !0, h = b.checked), p.push({
|
|
223
|
-
text: (m = u.textContent) == null ? void 0 : m.trim(),
|
|
224
|
-
hasCheckBox: d,
|
|
225
|
-
isChecked: h
|
|
226
|
-
});
|
|
212
|
+
const r = t.querySelector("ul.dropdown-menu"), o = r != null, d = [], h = [];
|
|
213
|
+
if (r != null) {
|
|
214
|
+
const m = r.querySelectorAll("li.dropdown-item");
|
|
215
|
+
for (const u of m) {
|
|
216
|
+
const b = (p = u.textContent) == null ? void 0 : p.trim();
|
|
217
|
+
d.push(b), u.classList.contains("selected") && h.push(b);
|
|
227
218
|
}
|
|
228
219
|
}
|
|
229
220
|
return {
|
|
230
221
|
text: c.value,
|
|
231
|
-
badges:
|
|
232
|
-
isOpen:
|
|
233
|
-
list:
|
|
222
|
+
badges: l,
|
|
223
|
+
isOpen: o,
|
|
224
|
+
list: d,
|
|
225
|
+
checked: h
|
|
234
226
|
};
|
|
235
227
|
});
|
|
236
228
|
}
|
|
237
229
|
}
|
|
238
|
-
const
|
|
230
|
+
const S = {
|
|
239
231
|
rootComponent: ".alert",
|
|
240
232
|
closeButton: ".btn-close"
|
|
241
233
|
};
|
|
242
|
-
class
|
|
234
|
+
class O extends n {
|
|
243
235
|
constructor() {
|
|
244
236
|
super(...arguments);
|
|
245
|
-
|
|
237
|
+
i(this, "selectors", structuredClone(S));
|
|
246
238
|
}
|
|
247
239
|
getComponentSelector() {
|
|
248
240
|
return this.selectors.rootComponent;
|
|
@@ -251,10 +243,10 @@ class w extends n {
|
|
|
251
243
|
return this.locatorRoot.locator(this.selectors.closeButton);
|
|
252
244
|
}
|
|
253
245
|
}
|
|
254
|
-
class
|
|
246
|
+
class q extends n {
|
|
255
247
|
constructor() {
|
|
256
248
|
super(...arguments);
|
|
257
|
-
|
|
249
|
+
i(this, "selectors", {
|
|
258
250
|
item: ".accordion-item",
|
|
259
251
|
collapse: ".accordion-collapse",
|
|
260
252
|
body: ".accordion-body",
|
|
@@ -312,12 +304,12 @@ class E extends n {
|
|
|
312
304
|
}
|
|
313
305
|
async state() {
|
|
314
306
|
return await this.locatorRoot.evaluate((t) => {
|
|
315
|
-
const
|
|
316
|
-
for (const
|
|
317
|
-
const r =
|
|
318
|
-
|
|
319
|
-
classes:
|
|
320
|
-
id:
|
|
307
|
+
const e = [...t.querySelectorAll(".accordion-item")], c = [];
|
|
308
|
+
for (const l of e) {
|
|
309
|
+
const r = l.querySelector(".accordion-collapse"), o = l.querySelector(".accordion-button");
|
|
310
|
+
c.push({
|
|
311
|
+
classes: l.className.trim().split(" "),
|
|
312
|
+
id: l.id,
|
|
321
313
|
isInDOM: r !== null,
|
|
322
314
|
collapseId: r == null ? void 0 : r.id,
|
|
323
315
|
buttonId: o == null ? void 0 : o.id,
|
|
@@ -327,20 +319,117 @@ class E extends n {
|
|
|
327
319
|
buttonControls: o == null ? void 0 : o.getAttribute("aria-controls")
|
|
328
320
|
});
|
|
329
321
|
}
|
|
330
|
-
return { rootClasses: t.className.trim().split(" "), items:
|
|
322
|
+
return { rootClasses: t.className.trim().split(" "), items: c };
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const P = {
|
|
327
|
+
rootComponent: '[role="progressbar"]',
|
|
328
|
+
outerBar: ".progress",
|
|
329
|
+
innerBar: ".progress-bar"
|
|
330
|
+
};
|
|
331
|
+
class V extends n {
|
|
332
|
+
constructor() {
|
|
333
|
+
super(...arguments);
|
|
334
|
+
i(this, "selectors", structuredClone(P));
|
|
335
|
+
}
|
|
336
|
+
getComponentSelector() {
|
|
337
|
+
return this.selectors.rootComponent;
|
|
338
|
+
}
|
|
339
|
+
get locatorOuterBar() {
|
|
340
|
+
return this.locatorRoot.locator(this.selectors.outerBar);
|
|
341
|
+
}
|
|
342
|
+
get locatorInnerBar() {
|
|
343
|
+
return this.locatorRoot.locator(this.selectors.innerBar);
|
|
344
|
+
}
|
|
345
|
+
async state() {
|
|
346
|
+
return this.locatorRoot.evaluate((t) => {
|
|
347
|
+
var l, r, o, d, h, g;
|
|
348
|
+
const e = t.querySelector(".progress-bar"), c = t.querySelector(".progress");
|
|
349
|
+
return {
|
|
350
|
+
ariaLabel: t.getAttribute("aria-label"),
|
|
351
|
+
ariaValueNow: t.getAttribute("aria-valuenow"),
|
|
352
|
+
ariaValueMin: t.getAttribute("aria-valuemin"),
|
|
353
|
+
ariaValueMax: t.getAttribute("aria-valuemax"),
|
|
354
|
+
ariaValueText: t.getAttribute("aria-valuetext"),
|
|
355
|
+
label: (l = e == null ? void 0 : e.textContent) == null ? void 0 : l.trim(),
|
|
356
|
+
innerClasses: ((d = (o = (r = e == null ? void 0 : e.className) == null ? void 0 : r.trim()) == null ? void 0 : o.split(" ")) == null ? void 0 : d.sort()) ?? [],
|
|
357
|
+
outerHeight: (h = c == null ? void 0 : c.style) == null ? void 0 : h.height,
|
|
358
|
+
innerWidth: (g = e == null ? void 0 : e.style) == null ? void 0 : g.width
|
|
359
|
+
};
|
|
331
360
|
});
|
|
332
361
|
}
|
|
333
362
|
}
|
|
363
|
+
const B = {
|
|
364
|
+
rootComponent: ".au-slider",
|
|
365
|
+
clickableArea: ".au-slider-clickable-area",
|
|
366
|
+
handle: ".au-slider-handle",
|
|
367
|
+
minLabelHorizontal: ".au-slider-label-min",
|
|
368
|
+
maxLabelHorizontal: ".au-slider-label-max",
|
|
369
|
+
minLabelVertical: ".au-slider-label-vertical-min",
|
|
370
|
+
maxLabelVertical: ".au-slider-label-vertical-max",
|
|
371
|
+
valueLabel: ".au-slider-label-now",
|
|
372
|
+
progress: ".au-slider-progress"
|
|
373
|
+
};
|
|
374
|
+
class k extends n {
|
|
375
|
+
constructor() {
|
|
376
|
+
super(...arguments);
|
|
377
|
+
i(this, "selectors", structuredClone(B));
|
|
378
|
+
}
|
|
379
|
+
getComponentSelector() {
|
|
380
|
+
return this.selectors.rootComponent;
|
|
381
|
+
}
|
|
382
|
+
get locatorHandle() {
|
|
383
|
+
return this.locatorRoot.locator(this.selectors.handle);
|
|
384
|
+
}
|
|
385
|
+
get locatorMinLabelHorizontal() {
|
|
386
|
+
return this.locatorRoot.locator(this.selectors.minLabelHorizontal);
|
|
387
|
+
}
|
|
388
|
+
get locatorMaxLabelHorizontal() {
|
|
389
|
+
return this.locatorRoot.locator(this.selectors.maxLabelHorizontal);
|
|
390
|
+
}
|
|
391
|
+
get locatorMinLabelVertical() {
|
|
392
|
+
return this.locatorRoot.locator(this.selectors.minLabelVertical);
|
|
393
|
+
}
|
|
394
|
+
get locatorMaxLabelVertical() {
|
|
395
|
+
return this.locatorRoot.locator(this.selectors.maxLabelVertical);
|
|
396
|
+
}
|
|
397
|
+
get locatorProgress() {
|
|
398
|
+
return this.locatorRoot.locator(this.selectors.progress);
|
|
399
|
+
}
|
|
400
|
+
get locatorValueLabel() {
|
|
401
|
+
return this.locatorRoot.locator(this.selectors.valueLabel);
|
|
402
|
+
}
|
|
403
|
+
async sliderHandleState() {
|
|
404
|
+
return this.locatorRoot.locator(this.selectors.handle).evaluateAll((t) => t.map((e) => ({
|
|
405
|
+
style: e.getAttribute("style"),
|
|
406
|
+
value: e.getAttribute("aria-valuenow"),
|
|
407
|
+
min: e.getAttribute("aria-valuemin"),
|
|
408
|
+
max: e.getAttribute("aria-valuemax"),
|
|
409
|
+
text: e.getAttribute("aria-valuetext"),
|
|
410
|
+
disabled: e.getAttribute("aria-disabled"),
|
|
411
|
+
readonly: e.getAttribute("aria-readonly"),
|
|
412
|
+
ariaLabel: e.getAttribute("aria-label")
|
|
413
|
+
})));
|
|
414
|
+
}
|
|
415
|
+
async sliderProgressState() {
|
|
416
|
+
return this.locatorRoot.locator(this.selectors.progress).evaluateAll((t) => t.map((e) => e.getAttribute("style")));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
334
419
|
export {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
420
|
+
q as AccordionPO,
|
|
421
|
+
O as AlertPO,
|
|
422
|
+
H as ModalPO,
|
|
423
|
+
I as PaginationPO,
|
|
424
|
+
V as ProgressbarPO,
|
|
425
|
+
M as RatingPO,
|
|
426
|
+
w as SelectPO,
|
|
427
|
+
k as SliderPO,
|
|
428
|
+
S as alertSelectors,
|
|
429
|
+
C as modalSelectors,
|
|
430
|
+
y as paginationSelectors,
|
|
431
|
+
P as progressbarSelectors,
|
|
432
|
+
v as ratingSelectors,
|
|
433
|
+
R as selectSelectors,
|
|
434
|
+
B as sliderSelectors
|
|
346
435
|
};
|
package/package.json
CHANGED
|
@@ -12,15 +12,58 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "dist/lib/index.js",
|
|
14
14
|
"module": "dist/lib/index.mjs",
|
|
15
|
-
"types": "dist/
|
|
15
|
+
"types": "dist/dts/index.d.ts",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"build:
|
|
17
|
+
"build": "wireit"
|
|
18
|
+
},
|
|
19
|
+
"wireit": {
|
|
20
|
+
"build:src": {
|
|
21
|
+
"command": "vite build",
|
|
22
|
+
"dependencies": [
|
|
23
|
+
"../base-po:build"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"lib/**",
|
|
27
|
+
"vite.config.ts"
|
|
28
|
+
],
|
|
29
|
+
"output": [
|
|
30
|
+
"dist/lib/index.js",
|
|
31
|
+
"dist/lib/index.mjs"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"build:dts": {
|
|
35
|
+
"command": "tsc -p tsconfig.d.json",
|
|
36
|
+
"dependencies": [
|
|
37
|
+
"../base-po:build"
|
|
38
|
+
],
|
|
39
|
+
"files": [
|
|
40
|
+
"lib/**",
|
|
41
|
+
"tsconfig.json",
|
|
42
|
+
"tsconfig.d.json"
|
|
43
|
+
],
|
|
44
|
+
"output": [
|
|
45
|
+
"dist/dts/**"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"build": {
|
|
49
|
+
"command": "api-extractor run",
|
|
50
|
+
"dependencies": [
|
|
51
|
+
"build:src",
|
|
52
|
+
"build:dts"
|
|
53
|
+
],
|
|
54
|
+
"files": [
|
|
55
|
+
"api-extractor.json",
|
|
56
|
+
"../api-extractor.json",
|
|
57
|
+
"tsconfig.json",
|
|
58
|
+
"tsconfig.d.json"
|
|
59
|
+
],
|
|
60
|
+
"output": [
|
|
61
|
+
"dist/lib/index.d.ts"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
21
64
|
},
|
|
22
65
|
"dependencies": {
|
|
23
|
-
"@agnos-ui/base-po": "0.0.1-alpha.
|
|
66
|
+
"@agnos-ui/base-po": "0.0.1-alpha.11"
|
|
24
67
|
},
|
|
25
68
|
"peerDependencies": {
|
|
26
69
|
"@playwright/test": "*"
|
|
@@ -35,5 +78,5 @@
|
|
|
35
78
|
"url": "https://github.com/AmadeusITGroup/AgnosUI.git",
|
|
36
79
|
"directory": "page-objects"
|
|
37
80
|
},
|
|
38
|
-
"version": "0.0.1-alpha.
|
|
81
|
+
"version": "0.0.1-alpha.11"
|
|
39
82
|
}
|