@agnos-ui/page-objects 0.0.1-alpha.4 → 0.0.1-alpha.6

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.
@@ -208,6 +208,10 @@ export declare class SelectPO extends BasePO {
208
208
  * Menu container
209
209
  */
210
210
  get locatorMenu(): Locator_2;
211
+ /**
212
+ * Return the first menu item locator including the text
213
+ */
214
+ get locatorMenuItems(): Locator_2;
211
215
  /**
212
216
  * Return the first menu item locator including the text
213
217
  */
@@ -220,19 +224,12 @@ export declare class SelectPO extends BasePO {
220
224
  * Return the first badge locator including the text
221
225
  */
222
226
  locatorBadgeItem(text: string): Locator_2;
223
- /**
224
- * Return the cross locator for the first badge including the text
225
- */
226
- locatorBadgeItemCross(text: string): Locator_2;
227
227
  state(): Promise<{
228
228
  text: string;
229
- badges: string[][];
229
+ badges: (string | undefined)[];
230
230
  isOpen: boolean;
231
- list: {
232
- text: string | undefined;
233
- hasCheckBox: boolean;
234
- isChecked: boolean;
235
- }[];
231
+ list: (string | undefined)[];
232
+ checked: (string | undefined)[];
236
233
  }>;
237
234
  }
238
235
 
@@ -249,7 +246,8 @@ export declare class SliderPO extends BasePO {
249
246
  maxLabelHorizontal: string;
250
247
  minLabelVertical: string;
251
248
  maxLabelVertical: string;
252
- sliderProgress: string;
249
+ valueLabel: string;
250
+ progress: string;
253
251
  };
254
252
  getComponentSelector(): string;
255
253
  get locatorHandle(): Locator;
@@ -257,6 +255,8 @@ export declare class SliderPO extends BasePO {
257
255
  get locatorMaxLabelHorizontal(): Locator;
258
256
  get locatorMinLabelVertical(): Locator;
259
257
  get locatorMaxLabelVertical(): Locator;
258
+ get locatorProgress(): Locator;
259
+ get locatorValueLabel(): Locator;
260
260
  sliderHandleState(): Promise<{
261
261
  style: string | null;
262
262
  value: string | null;
@@ -265,6 +265,7 @@ export declare class SliderPO extends BasePO {
265
265
  text: string | null;
266
266
  disabled: string | null;
267
267
  readonly: string | null;
268
+ ariaLabel: string | null;
268
269
  }[]>;
269
270
  sliderProgressState(): Promise<(string | null)[]>;
270
271
  }
@@ -277,7 +278,8 @@ export declare const sliderSelectors: {
277
278
  maxLabelHorizontal: string;
278
279
  minLabelVertical: string;
279
280
  maxLabelVertical: string;
280
- sliderProgress: string;
281
+ valueLabel: string;
282
+ progress: string;
281
283
  };
282
284
 
283
285
  export declare interface State {
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var B=Object.defineProperty;var O=(s,a,t)=>a in s?B(s,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[a]=t;var i=(s,a,t)=>(O(s,typeof a!="symbol"?a+"":a,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@agnos-ui/base-po"),x={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 f extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(x))}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 P={rootComponent:".au-pagination",activePage:".active",previousPage:".au-previous",nextPage:".au-next",firstPage:".au-first",lastPage:".au-last",pages:".au-page",ellipses:".au-ellipsis"};class H extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(P))}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 C={rootComponent:".au-rating",star:".au-rating-star"};class I extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(C))}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 S={rootComponent:".au-select"};class q extends n.BasePO{constructor(){super(...arguments);i(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 d;const e=t.querySelector(".input-group"),c=t.querySelector("div.input-group-text"),l=e.querySelector("input"),r=[];if(c){const b=c.querySelectorAll("div.badge");for(const g of b){const m=[...g.children];r.push([...m.map(p=>(p.textContent??"").trim())])}}const o=t.querySelector("ul.dropdown-menu"),h=o!=null,u=[];if(o!=null){const b=o.querySelectorAll("li.dropdown-item");for(const g of b){let m=!1,p=!1;const A=g.querySelector("input.form-check-input");A&&(m=!0,p=A.checked),u.push({text:(d=g.textContent)==null?void 0:d.trim(),hasCheckBox:m,isChecked:p})}}return{text:l.value,badges:r,isOpen:h,list:u}})}}const y={rootComponent:".alert",closeButton:".btn-close"};class L 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 M 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 v={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class k extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(v))}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,h,u,d;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:((h=(o=(r=e==null?void 0:e.className)==null?void 0:r.trim())==null?void 0:o.split(" "))==null?void 0:h.sort())??[],outerHeight:(u=c==null?void 0:c.style)==null?void 0:u.height,innerWidth:(d=e==null?void 0:e.style)==null?void 0:d.width}})}}const R={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",sliderProgress:".au-slider-progress"};class w extends n.BasePO{constructor(){super(...arguments);i(this,"selectors",structuredClone(R))}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)}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")})))}async sliderProgressState(){return this.locatorRoot.locator(this.selectors.sliderProgress).evaluateAll(t=>t.map(e=>e.getAttribute("style")))}}exports.AccordionPO=M;exports.AlertPO=L;exports.ModalPO=f;exports.PaginationPO=H;exports.ProgressbarPO=k;exports.RatingPO=I;exports.SelectPO=q;exports.SliderPO=w;exports.alertSelectors=y;exports.modalSelectors=x;exports.paginationSelectors=P;exports.progressbarSelectors=v;exports.ratingSelectors=C;exports.selectSelectors=S;exports.sliderSelectors=R;
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
- var x = Object.defineProperty;
2
- var C = (s, a, t) => a in s ? x(s, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[a] = t;
3
- var i = (s, a, t) => (C(s, typeof a != "symbol" ? a + "" : a, t), t);
1
+ var A = Object.defineProperty;
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,10 +12,10 @@ const y = {
12
12
  body: ".modal-body",
13
13
  footer: ".modal-footer"
14
14
  };
15
- class L extends n {
15
+ class H extends n {
16
16
  constructor() {
17
17
  super(...arguments);
18
- i(this, "selectors", structuredClone(y));
18
+ i(this, "selectors", structuredClone(C));
19
19
  }
20
20
  getComponentSelector() {
21
21
  return this.selectors.rootComponent;
@@ -39,7 +39,7 @@ class L extends n {
39
39
  return this.locatorRoot.locator(this.selectors.backdrop);
40
40
  }
41
41
  }
42
- const v = {
42
+ const y = {
43
43
  rootComponent: ".au-pagination",
44
44
  activePage: ".active",
45
45
  previousPage: ".au-previous",
@@ -49,10 +49,10 @@ const v = {
49
49
  pages: ".au-page",
50
50
  ellipses: ".au-ellipsis"
51
51
  };
52
- class q extends n {
52
+ class I extends n {
53
53
  constructor() {
54
54
  super(...arguments);
55
- i(this, "selectors", structuredClone(v));
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 R = {
116
+ const v = {
117
117
  rootComponent: ".au-rating",
118
118
  star: ".au-rating-star"
119
119
  };
120
- class O extends n {
120
+ class M extends n {
121
121
  constructor() {
122
122
  super(...arguments);
123
- i(this, "selectors", structuredClone(R));
123
+ i(this, "selectors", structuredClone(v));
124
124
  }
125
125
  getComponentSelector() {
126
126
  return this.selectors.rootComponent;
@@ -152,14 +152,14 @@ class O extends n {
152
152
  }, this.selectors);
153
153
  }
154
154
  }
155
- const S = {
155
+ const R = {
156
156
  rootComponent: ".au-select"
157
157
  // TODO add selector list
158
158
  };
159
- class k extends n {
159
+ class w extends n {
160
160
  constructor() {
161
161
  super(...arguments);
162
- i(this, "selectors", structuredClone(S));
162
+ i(this, "selectors", structuredClone(R));
163
163
  }
164
164
  getComponentSelector() {
165
165
  return this.selectors.rootComponent;
@@ -168,7 +168,7 @@ class k extends n {
168
168
  * Get the main title locator of the feature page
169
169
  */
170
170
  get locatorInput() {
171
- return this.locatorRoot.locator("div.input-group").locator("input");
171
+ return this.locatorRoot.locator('input[type="text"]').nth(0);
172
172
  }
173
173
  /**
174
174
  * Menu container
@@ -176,6 +176,12 @@ class k 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 k extends n {
186
192
  * Bages container
187
193
  */
188
194
  get locatorBadges() {
189
- return this.locatorRoot.locator("div.input-group").locator(".input-group-text");
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.locator("div.badge").filter({ hasText: t }).nth(0);
201
+ return this.locatorBadges.filter({ hasText: t }).nth(0);
196
202
  }
197
- /**
198
- * Return the cross locator for the first badge including the text
199
- */
200
- locatorBadgeItemCross(t) {
201
- return this.locatorBadgeItem(t).getByRole("button");
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 d;
208
- const e = t.querySelector(".input-group"), c = t.querySelector("div.input-group-text"), l = e.querySelector("input"), r = [];
209
- if (c) {
210
- const b = c.querySelectorAll("div.badge");
211
- for (const g of b) {
212
- const m = [...g.children];
213
- r.push([...m.map((p) => (p.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 o = t.querySelector("ul.dropdown-menu"), h = o != null, u = [];
217
- if (o != null) {
218
- const b = o.querySelectorAll("li.dropdown-item");
219
- for (const g of b) {
220
- let m = !1, p = !1;
221
- const A = g.querySelector("input.form-check-input");
222
- A && (m = !0, p = A.checked), u.push({
223
- text: (d = g.textContent) == null ? void 0 : d.trim(),
224
- hasCheckBox: m,
225
- isChecked: p
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
- text: l.value,
231
- badges: r,
232
- isOpen: h,
233
- list: u
221
+ text: c.value,
222
+ badges: l,
223
+ isOpen: o,
224
+ list: d,
225
+ checked: h
234
226
  };
235
227
  });
236
228
  }
237
229
  }
238
- const P = {
230
+ const S = {
239
231
  rootComponent: ".alert",
240
232
  closeButton: ".btn-close"
241
233
  };
242
- class w extends n {
234
+ class O extends n {
243
235
  constructor() {
244
236
  super(...arguments);
245
- i(this, "selectors", structuredClone(P));
237
+ i(this, "selectors", structuredClone(S));
246
238
  }
247
239
  getComponentSelector() {
248
240
  return this.selectors.rootComponent;
@@ -251,7 +243,7 @@ class w extends n {
251
243
  return this.locatorRoot.locator(this.selectors.closeButton);
252
244
  }
253
245
  }
254
- class M extends n {
246
+ class q extends n {
255
247
  constructor() {
256
248
  super(...arguments);
257
249
  i(this, "selectors", {
@@ -331,7 +323,7 @@ class M extends n {
331
323
  });
332
324
  }
333
325
  }
334
- const B = {
326
+ const P = {
335
327
  rootComponent: '[role="progressbar"]',
336
328
  outerBar: ".progress",
337
329
  innerBar: ".progress-bar"
@@ -339,7 +331,7 @@ const B = {
339
331
  class V extends n {
340
332
  constructor() {
341
333
  super(...arguments);
342
- i(this, "selectors", structuredClone(B));
334
+ i(this, "selectors", structuredClone(P));
343
335
  }
344
336
  getComponentSelector() {
345
337
  return this.selectors.rootComponent;
@@ -352,7 +344,7 @@ class V extends n {
352
344
  }
353
345
  async state() {
354
346
  return this.locatorRoot.evaluate((t) => {
355
- var l, r, o, h, u, d;
347
+ var l, r, o, d, h, g;
356
348
  const e = t.querySelector(".progress-bar"), c = t.querySelector(".progress");
357
349
  return {
358
350
  ariaLabel: t.getAttribute("aria-label"),
@@ -361,14 +353,14 @@ class V extends n {
361
353
  ariaValueMax: t.getAttribute("aria-valuemax"),
362
354
  ariaValueText: t.getAttribute("aria-valuetext"),
363
355
  label: (l = e == null ? void 0 : e.textContent) == null ? void 0 : l.trim(),
364
- innerClasses: ((h = (o = (r = e == null ? void 0 : e.className) == null ? void 0 : r.trim()) == null ? void 0 : o.split(" ")) == null ? void 0 : h.sort()) ?? [],
365
- outerHeight: (u = c == null ? void 0 : c.style) == null ? void 0 : u.height,
366
- innerWidth: (d = e == null ? void 0 : e.style) == null ? void 0 : d.width
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
367
359
  };
368
360
  });
369
361
  }
370
362
  }
371
- const f = {
363
+ const B = {
372
364
  rootComponent: ".au-slider",
373
365
  clickableArea: ".au-slider-clickable-area",
374
366
  handle: ".au-slider-handle",
@@ -376,12 +368,13 @@ const f = {
376
368
  maxLabelHorizontal: ".au-slider-label-max",
377
369
  minLabelVertical: ".au-slider-label-vertical-min",
378
370
  maxLabelVertical: ".au-slider-label-vertical-max",
379
- sliderProgress: ".au-slider-progress"
371
+ valueLabel: ".au-slider-label-now",
372
+ progress: ".au-slider-progress"
380
373
  };
381
- class z extends n {
374
+ class k extends n {
382
375
  constructor() {
383
376
  super(...arguments);
384
- i(this, "selectors", structuredClone(f));
377
+ i(this, "selectors", structuredClone(B));
385
378
  }
386
379
  getComponentSelector() {
387
380
  return this.selectors.rootComponent;
@@ -401,6 +394,12 @@ class z extends n {
401
394
  get locatorMaxLabelVertical() {
402
395
  return this.locatorRoot.locator(this.selectors.maxLabelVertical);
403
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
+ }
404
403
  async sliderHandleState() {
405
404
  return this.locatorRoot.locator(this.selectors.handle).evaluateAll((t) => t.map((e) => ({
406
405
  style: e.getAttribute("style"),
@@ -409,27 +408,28 @@ class z extends n {
409
408
  max: e.getAttribute("aria-valuemax"),
410
409
  text: e.getAttribute("aria-valuetext"),
411
410
  disabled: e.getAttribute("aria-disabled"),
412
- readonly: e.getAttribute("aria-readonly")
411
+ readonly: e.getAttribute("aria-readonly"),
412
+ ariaLabel: e.getAttribute("aria-label")
413
413
  })));
414
414
  }
415
415
  async sliderProgressState() {
416
- return this.locatorRoot.locator(this.selectors.sliderProgress).evaluateAll((t) => t.map((e) => e.getAttribute("style")));
416
+ return this.locatorRoot.locator(this.selectors.progress).evaluateAll((t) => t.map((e) => e.getAttribute("style")));
417
417
  }
418
418
  }
419
419
  export {
420
- M as AccordionPO,
421
- w as AlertPO,
422
- L as ModalPO,
423
- q as PaginationPO,
420
+ q as AccordionPO,
421
+ O as AlertPO,
422
+ H as ModalPO,
423
+ I as PaginationPO,
424
424
  V as ProgressbarPO,
425
- O as RatingPO,
426
- k as SelectPO,
427
- z as SliderPO,
428
- P as alertSelectors,
429
- y as modalSelectors,
430
- v as paginationSelectors,
431
- B as progressbarSelectors,
432
- R as ratingSelectors,
433
- S as selectSelectors,
434
- f as sliderSelectors
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
435
435
  };
package/package.json CHANGED
@@ -15,12 +15,12 @@
15
15
  "types": "dist/lib/index.d.ts",
16
16
  "scripts": {
17
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",
18
+ "build:rollup": "tsc && vite build",
19
19
  "build:dts": "tsc -p tsconfig.d.json",
20
20
  "build:api-extractor": "api-extractor run"
21
21
  },
22
22
  "dependencies": {
23
- "@agnos-ui/base-po": "0.0.1-alpha.4"
23
+ "@agnos-ui/base-po": "0.0.1-alpha.6"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@playwright/test": "*"
@@ -35,5 +35,5 @@
35
35
  "url": "https://github.com/AmadeusITGroup/AgnosUI.git",
36
36
  "directory": "page-objects"
37
37
  },
38
- "version": "0.0.1-alpha.4"
38
+ "version": "0.0.1-alpha.6"
39
39
  }