@agnos-ui/page-objects 0.0.1-alpha.0 → 0.0.1-alpha.10

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.
@@ -52,7 +52,7 @@ export declare class AlertPO extends BasePO {
52
52
  closeButton: string;
53
53
  };
54
54
  getComponentSelector(): string;
55
- locatorCloseButton(): Locator;
55
+ get locatorCloseButton(): Locator;
56
56
  }
57
57
 
58
58
  export declare const alertSelectors: {
@@ -71,12 +71,12 @@ export declare class ModalPO extends BasePO {
71
71
  footer: string;
72
72
  };
73
73
  getComponentSelector(): string;
74
- locatorHeader(): Locator;
75
- locatorTitle(): Locator;
76
- locatorBody(): Locator;
77
- locatorFooter(): Locator;
78
- locatorCloseButton(): Locator;
79
- locatorBackdrop(): Locator;
74
+ get locatorHeader(): Locator;
75
+ get locatorTitle(): Locator;
76
+ get locatorBody(): Locator;
77
+ get locatorFooter(): Locator;
78
+ get locatorCloseButton(): Locator;
79
+ get locatorBackdrop(): Locator;
80
80
  }
81
81
 
82
82
  export declare const modalSelectors: {
@@ -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
- text: string | undefined;
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 x=Object.defineProperty;var R=(s,e,t)=>e in s?x(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(R(s,typeof e!="symbol"?e+"":e,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 v extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(A))}getComponentSelector(){return this.selectors.rootComponent}locatorHeader(){return this.locatorRoot.locator(this.selectors.header)}locatorTitle(){return this.locatorHeader().locator(this.selectors.title)}locatorBody(){return this.locatorRoot.locator(this.selectors.body)}locatorFooter(){return this.locatorRoot.locator(this.selectors.footer)}locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}locatorBackdrop(){return this.locatorRoot.locator(this.selectors.backdrop)}}const C={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);l(this,"selectors",structuredClone(C))}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 O extends n.BasePO{constructor(){super(...arguments);l(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,i)=>{const c=[...t.querySelectorAll(i.star)],a=[],r=[];for(const o of c)a.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:a,classes:r}},this.selectors)}}const S={rootComponent:".au-select"};class I extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(S))}getComponentSelector(){return this.selectors.rootComponent}get locatorInput(){return this.locatorRoot.locator("div.input-group").locator("input")}get locatorMenu(){return this.locatorRoot.locator(".dropdown-menu")}locatorMenuItem(t){return this.locatorMenu.getByText(t).nth(0)}get locatorBadges(){return this.locatorRoot.locator("div.input-group").locator(".input-group-text")}locatorBadgeItem(t){return this.locatorBadges.locator("div.badge").filter({hasText:t}).nth(0)}locatorBadgeItemCross(t){return this.locatorBadgeItem(t).getByRole("button")}async state(){return await this.locatorRoot.evaluate(t=>{var m;const i=t.querySelector(".input-group"),c=t.querySelector("div.input-group-text"),a=i.querySelector("input"),r=[];if(c){const g=c.querySelectorAll("div.badge");for(const u of g){const d=[...u.children];r.push([...d.map(h=>(h.textContent??"").trim())])}}const o=t.querySelector("ul.dropdown-menu"),B=o!=null,p=[];if(o!=null){const g=o.querySelectorAll("li.dropdown-item");for(const u of g){let d=!1,h=!1;const b=u.querySelector("input.form-check-input");b&&(d=!0,h=b.checked),p.push({text:(m=u.textContent)==null?void 0:m.trim(),hasCheckBox:d,isChecked:h})}}return{text:a.value,badges:r,isOpen:B,list:p}})}}const y={rootComponent:".alert",closeButton:".btn-close"};class q extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(y))}getComponentSelector(){return this.selectors.rootComponent}locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}class k extends n.BasePO{constructor(){super(...arguments);l(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 i=[...t.querySelectorAll(".accordion-item")],c=[];for(const a of i){const r=a.querySelector(".accordion-collapse"),o=a.querySelector(".accordion-button");c.push({classes:a.className.trim().split(" "),id:a.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}})}}exports.AccordionPO=k;exports.AlertPO=q;exports.ModalPO=v;exports.PaginationPO=f;exports.RatingPO=O;exports.SelectPO=I;exports.alertSelectors=y;exports.modalSelectors=A;exports.paginationSelectors=C;exports.ratingSelectors=P;exports.selectSelectors=S;
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;
@@ -1,8 +1,8 @@
1
1
  var A = Object.defineProperty;
2
- var x = (s, e, t) => e in s ? A(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var l = (s, e, t) => (x(s, typeof e != "symbol" ? e + "" : e, t), t);
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 y = {
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,35 +12,34 @@ const y = {
12
12
  body: ".modal-body",
13
13
  footer: ".modal-footer"
14
14
  };
15
- class I extends n {
15
+ class H extends n {
16
16
  constructor() {
17
17
  super(...arguments);
18
- l(this, "selectors", structuredClone(y));
18
+ i(this, "selectors", structuredClone(C));
19
19
  }
20
20
  getComponentSelector() {
21
21
  return this.selectors.rootComponent;
22
22
  }
23
- // TODO: should we expose getters instead?
24
- locatorHeader() {
23
+ get locatorHeader() {
25
24
  return this.locatorRoot.locator(this.selectors.header);
26
25
  }
27
- locatorTitle() {
28
- return this.locatorHeader().locator(this.selectors.title);
26
+ get locatorTitle() {
27
+ return this.locatorHeader.locator(this.selectors.title);
29
28
  }
30
- locatorBody() {
29
+ get locatorBody() {
31
30
  return this.locatorRoot.locator(this.selectors.body);
32
31
  }
33
- locatorFooter() {
32
+ get locatorFooter() {
34
33
  return this.locatorRoot.locator(this.selectors.footer);
35
34
  }
36
- locatorCloseButton() {
35
+ get locatorCloseButton() {
37
36
  return this.locatorRoot.locator(this.selectors.closeButton);
38
37
  }
39
- locatorBackdrop() {
38
+ get locatorBackdrop() {
40
39
  return this.locatorRoot.locator(this.selectors.backdrop);
41
40
  }
42
41
  }
43
- const B = {
42
+ const y = {
44
43
  rootComponent: ".au-pagination",
45
44
  activePage: ".active",
46
45
  previousPage: ".au-previous",
@@ -50,10 +49,10 @@ const B = {
50
49
  pages: ".au-page",
51
50
  ellipses: ".au-ellipsis"
52
51
  };
53
- class q extends n {
52
+ class I extends n {
54
53
  constructor() {
55
54
  super(...arguments);
56
- l(this, "selectors", structuredClone(B));
55
+ i(this, "selectors", structuredClone(y));
57
56
  }
58
57
  // TODO should we add this in the list of selector ?
59
58
  // Depend on the setSelectors usage...
@@ -114,14 +113,14 @@ class q extends n {
114
113
  return this.locatorRoot.locator(this.selectors.ellipses);
115
114
  }
116
115
  }
117
- const R = {
116
+ const v = {
118
117
  rootComponent: ".au-rating",
119
118
  star: ".au-rating-star"
120
119
  };
121
- class k extends n {
120
+ class M extends n {
122
121
  constructor() {
123
122
  super(...arguments);
124
- l(this, "selectors", structuredClone(R));
123
+ i(this, "selectors", structuredClone(v));
125
124
  }
126
125
  getComponentSelector() {
127
126
  return this.selectors.rootComponent;
@@ -135,10 +134,10 @@ class k extends n {
135
134
  // TODO to be pushed to the test itself
136
135
  // We already discuss with Guillaume Saas not to put this in the basic PO which should only return locator basically
137
136
  async state() {
138
- return await this.locatorRoot.evaluate((t, i) => {
139
- const a = [...t.querySelectorAll(i.star)], c = [], r = [];
140
- for (const o of a)
141
- c.push((o.textContent || "").trim()), r.push(o.className.split(" "));
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(" "));
142
141
  return {
143
142
  rootClasses: t.className.trim().split(" "),
144
143
  value: t.getAttribute("aria-valuenow"),
@@ -147,20 +146,20 @@ class k extends n {
147
146
  text: t.getAttribute("aria-valuetext"),
148
147
  disabled: t.getAttribute("aria-disabled"),
149
148
  readonly: t.getAttribute("aria-readonly"),
150
- stars: c,
149
+ stars: l,
151
150
  classes: r
152
151
  };
153
152
  }, this.selectors);
154
153
  }
155
154
  }
156
- const S = {
155
+ const R = {
157
156
  rootComponent: ".au-select"
158
157
  // TODO add selector list
159
158
  };
160
- class O extends n {
159
+ class w extends n {
161
160
  constructor() {
162
161
  super(...arguments);
163
- l(this, "selectors", structuredClone(S));
162
+ i(this, "selectors", structuredClone(R));
164
163
  }
165
164
  getComponentSelector() {
166
165
  return this.selectors.rootComponent;
@@ -169,7 +168,7 @@ class O extends n {
169
168
  * Get the main title locator of the feature page
170
169
  */
171
170
  get locatorInput() {
172
- return this.locatorRoot.locator("div.input-group").locator("input");
171
+ return this.locatorRoot.locator('input[type="text"]').nth(0);
173
172
  }
174
173
  /**
175
174
  * Menu container
@@ -177,6 +176,12 @@ class O extends n {
177
176
  get locatorMenu() {
178
177
  return this.locatorRoot.locator(".dropdown-menu");
179
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
+ }
180
185
  /**
181
186
  * Return the first menu item locator including the text
182
187
  */
@@ -187,75 +192,61 @@ class O extends n {
187
192
  * Bages container
188
193
  */
189
194
  get locatorBadges() {
190
- return this.locatorRoot.locator("div.input-group").locator(".input-group-text");
195
+ return this.locatorRoot.locator("div.au-select-badge");
191
196
  }
192
197
  /**
193
198
  * Return the first badge locator including the text
194
199
  */
195
200
  locatorBadgeItem(t) {
196
- return this.locatorBadges.locator("div.badge").filter({ hasText: t }).nth(0);
197
- }
198
- /**
199
- * Return the cross locator for the first badge including the text
200
- */
201
- locatorBadgeItemCross(t) {
202
- return this.locatorBadgeItem(t).getByRole("button");
201
+ return this.locatorBadges.filter({ hasText: t }).nth(0);
203
202
  }
204
- // TODO to be pushed to the test itself
205
- // We already discuss with Guillaume Saas not to put this in the basic PO which should only return locator basically
206
203
  async state() {
207
204
  return await this.locatorRoot.evaluate((t) => {
208
- var m;
209
- const i = t.querySelector(".input-group"), a = t.querySelector("div.input-group-text"), c = i.querySelector("input"), r = [];
210
- if (a) {
211
- const p = a.querySelectorAll("div.badge");
212
- for (const u of p) {
213
- const d = [...u.children];
214
- r.push([...d.map((h) => (h.textContent ?? "").trim())]);
215
- }
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());
216
211
  }
217
- const o = t.querySelector("ul.dropdown-menu"), C = o != null, g = [];
218
- if (o != null) {
219
- const p = o.querySelectorAll("li.dropdown-item");
220
- for (const u of p) {
221
- let d = !1, h = !1;
222
- const b = u.querySelector("input.form-check-input");
223
- b && (d = !0, h = b.checked), g.push({
224
- text: (m = u.textContent) == null ? void 0 : m.trim(),
225
- hasCheckBox: d,
226
- isChecked: h
227
- });
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);
228
218
  }
229
219
  }
230
220
  return {
231
221
  text: c.value,
232
- badges: r,
233
- isOpen: C,
234
- list: g
222
+ badges: l,
223
+ isOpen: o,
224
+ list: d,
225
+ checked: h
235
226
  };
236
227
  });
237
228
  }
238
229
  }
239
- const f = {
230
+ const S = {
240
231
  rootComponent: ".alert",
241
232
  closeButton: ".btn-close"
242
233
  };
243
- class w extends n {
234
+ class O extends n {
244
235
  constructor() {
245
236
  super(...arguments);
246
- l(this, "selectors", structuredClone(f));
237
+ i(this, "selectors", structuredClone(S));
247
238
  }
248
239
  getComponentSelector() {
249
240
  return this.selectors.rootComponent;
250
241
  }
251
- locatorCloseButton() {
242
+ get locatorCloseButton() {
252
243
  return this.locatorRoot.locator(this.selectors.closeButton);
253
244
  }
254
245
  }
255
- class E extends n {
246
+ class q extends n {
256
247
  constructor() {
257
248
  super(...arguments);
258
- l(this, "selectors", {
249
+ i(this, "selectors", {
259
250
  item: ".accordion-item",
260
251
  collapse: ".accordion-collapse",
261
252
  body: ".accordion-body",
@@ -313,12 +304,12 @@ class E extends n {
313
304
  }
314
305
  async state() {
315
306
  return await this.locatorRoot.evaluate((t) => {
316
- const i = [...t.querySelectorAll(".accordion-item")], a = [];
317
- for (const c of i) {
318
- const r = c.querySelector(".accordion-collapse"), o = c.querySelector(".accordion-button");
319
- a.push({
320
- classes: c.className.trim().split(" "),
321
- id: c.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,
322
313
  isInDOM: r !== null,
323
314
  collapseId: r == null ? void 0 : r.id,
324
315
  buttonId: o == null ? void 0 : o.id,
@@ -328,20 +319,117 @@ class E extends n {
328
319
  buttonControls: o == null ? void 0 : o.getAttribute("aria-controls")
329
320
  });
330
321
  }
331
- return { rootClasses: t.className.trim().split(" "), items: a };
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
+ };
332
360
  });
333
361
  }
334
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
+ }
335
419
  export {
336
- E as AccordionPO,
337
- w as AlertPO,
338
- I as ModalPO,
339
- q as PaginationPO,
340
- k as RatingPO,
341
- O as SelectPO,
342
- f as alertSelectors,
343
- y as modalSelectors,
344
- B as paginationSelectors,
345
- R as ratingSelectors,
346
- S as selectSelectors
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
347
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/lib/index.d.ts",
15
+ "types": "dist/dts/index.d.ts",
16
16
  "scripts": {
17
- "build": "npm run build:rollup && npm run build:dts && npm run build:api-extractor",
18
- "build:rollup": "tsc && vite build -c vite.config.ts",
19
- "build:dts": "tsc -p tsconfig.d.json",
20
- "build:api-extractor": "api-extractor run"
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.0"
66
+ "@agnos-ui/base-po": "0.0.1-alpha.10"
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.0"
81
+ "version": "0.0.1-alpha.10"
39
82
  }
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.4"
9
- }
10
- ]
11
- }