@agnos-ui/page-objects 0.0.1-alpha.3 → 0.0.1-alpha.5

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
 
@@ -240,6 +237,51 @@ export declare const selectSelectors: {
240
237
  rootComponent: string;
241
238
  };
242
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
+
243
285
  export declare interface State {
244
286
  ariaLabel: string | null;
245
287
  ariaValueNow: string | null;
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var v=(a,s,t)=>s in a?R(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var n=(a,s,t)=>(v(a,typeof s!="symbol"?s+"":s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=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 i.BasePO{constructor(){super(...arguments);n(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 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 f extends i.BasePO{constructor(){super(...arguments);n(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 S={rootComponent:".au-rating",star:".au-rating-star"};class I extends i.BasePO{constructor(){super(...arguments);n(this,"selectors",structuredClone(S))}getComponentSelector(){return this.selectors.rootComponent}locatorStar(t){return this.locatorRoot.locator(this.selectors.star).nth(t)}async state(){return await this.locatorRoot.evaluate((t,r)=>{const c=[...t.querySelectorAll(r.star)],l=[],e=[];for(const o of c)l.push((o.textContent||"").trim()),e.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:e}},this.selectors)}}const y={rootComponent:".au-select"};class q extends i.BasePO{constructor(){super(...arguments);n(this,"selectors",structuredClone(y))}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 r=t.querySelector(".input-group"),c=t.querySelector("div.input-group-text"),l=r.querySelector("input"),e=[];if(c){const b=c.querySelectorAll("div.badge");for(const h of b){const p=[...h.children];e.push([...p.map(m=>(m.textContent??"").trim())])}}const o=t.querySelector("ul.dropdown-menu"),g=o!=null,u=[];if(o!=null){const b=o.querySelectorAll("li.dropdown-item");for(const h of b){let p=!1,m=!1;const C=h.querySelector("input.form-check-input");C&&(p=!0,m=C.checked),u.push({text:(d=h.textContent)==null?void 0:d.trim(),hasCheckBox:p,isChecked:m})}}return{text:l.value,badges:e,isOpen:g,list:u}})}}const x={rootComponent:".alert",closeButton:".btn-close"};class w extends i.BasePO{constructor(){super(...arguments);n(this,"selectors",structuredClone(x))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}class k extends i.BasePO{constructor(){super(...arguments);n(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 r=[...t.querySelectorAll(".accordion-item")],c=[];for(const l of r){const e=l.querySelector(".accordion-collapse"),o=l.querySelector(".accordion-button");c.push({classes:l.className.trim().split(" "),id:l.id,isInDOM:e!==null,collapseId:e==null?void 0:e.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:e==null?void 0:e.getAttribute("aria-labelledby"),buttonControls:o==null?void 0:o.getAttribute("aria-controls")})}return{rootClasses:t.className.trim().split(" "),items:c}})}}const B={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class M extends i.BasePO{constructor(){super(...arguments);n(this,"selectors",structuredClone(B))}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,e,o,g,u,d;const r=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=r==null?void 0:r.textContent)==null?void 0:l.trim(),innerClasses:((g=(o=(e=r==null?void 0:r.className)==null?void 0:e.trim())==null?void 0:o.split(" "))==null?void 0:g.sort())??[],outerHeight:(u=c==null?void 0:c.style)==null?void 0:u.height,innerWidth:(d=r==null?void 0:r.style)==null?void 0:d.width}})}}exports.AccordionPO=k;exports.AlertPO=w;exports.ModalPO=O;exports.PaginationPO=f;exports.ProgressbarPO=M;exports.RatingPO=I;exports.SelectPO=q;exports.alertSelectors=x;exports.modalSelectors=A;exports.paginationSelectors=P;exports.progressbarSelectors=B;exports.ratingSelectors=S;exports.selectSelectors=y;
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 = (a, s, t) => s in a ? A(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
- var n = (a, s, t) => (x(a, typeof s != "symbol" ? s + "" : s, t), t);
4
- import { BasePO as i } from "@agnos-ui/base-po";
5
- const y = {
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
+ import { BasePO as n } from "@agnos-ui/base-po";
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 q extends i {
15
+ class H extends n {
16
16
  constructor() {
17
17
  super(...arguments);
18
- n(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 q extends i {
39
39
  return this.locatorRoot.locator(this.selectors.backdrop);
40
40
  }
41
41
  }
42
- const R = {
42
+ const y = {
43
43
  rootComponent: ".au-pagination",
44
44
  activePage: ".active",
45
45
  previousPage: ".au-previous",
@@ -49,10 +49,10 @@ const R = {
49
49
  pages: ".au-page",
50
50
  ellipses: ".au-ellipsis"
51
51
  };
52
- class O extends i {
52
+ class I extends n {
53
53
  constructor() {
54
54
  super(...arguments);
55
- n(this, "selectors", structuredClone(R));
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...
@@ -117,10 +117,10 @@ const v = {
117
117
  rootComponent: ".au-rating",
118
118
  star: ".au-rating-star"
119
119
  };
120
- class w extends i {
120
+ class M extends n {
121
121
  constructor() {
122
122
  super(...arguments);
123
- n(this, "selectors", structuredClone(v));
123
+ i(this, "selectors", structuredClone(v));
124
124
  }
125
125
  getComponentSelector() {
126
126
  return this.selectors.rootComponent;
@@ -134,10 +134,10 @@ class w extends i {
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, r) => {
138
- const c = [...t.querySelectorAll(r.star)], l = [], e = [];
137
+ return await this.locatorRoot.evaluate((t, e) => {
138
+ const c = [...t.querySelectorAll(e.star)], l = [], r = [];
139
139
  for (const o of c)
140
- l.push((o.textContent || "").trim()), e.push(o.className.split(" "));
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"),
@@ -147,19 +147,19 @@ class w extends i {
147
147
  disabled: t.getAttribute("aria-disabled"),
148
148
  readonly: t.getAttribute("aria-readonly"),
149
149
  stars: l,
150
- classes: e
150
+ classes: r
151
151
  };
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 i {
159
+ class w extends n {
160
160
  constructor() {
161
161
  super(...arguments);
162
- n(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 i {
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 i {
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 i {
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 r = t.querySelector(".input-group"), c = t.querySelector("div.input-group-text"), l = r.querySelector("input"), e = [];
209
- if (c) {
210
- const b = c.querySelectorAll("div.badge");
211
- for (const g of b) {
212
- const p = [...g.children];
213
- e.push([...p.map((m) => (m.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 p = !1, m = !1;
221
- const C = g.querySelector("input.form-check-input");
222
- C && (p = !0, m = C.checked), u.push({
223
- text: (d = g.textContent) == null ? void 0 : d.trim(),
224
- hasCheckBox: p,
225
- isChecked: m
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: e,
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 B = {
230
+ const S = {
239
231
  rootComponent: ".alert",
240
232
  closeButton: ".btn-close"
241
233
  };
242
- class H extends i {
234
+ class O extends n {
243
235
  constructor() {
244
236
  super(...arguments);
245
- n(this, "selectors", structuredClone(B));
237
+ i(this, "selectors", structuredClone(S));
246
238
  }
247
239
  getComponentSelector() {
248
240
  return this.selectors.rootComponent;
@@ -251,10 +243,10 @@ class H extends i {
251
243
  return this.locatorRoot.locator(this.selectors.closeButton);
252
244
  }
253
245
  }
254
- class M extends i {
246
+ class q extends n {
255
247
  constructor() {
256
248
  super(...arguments);
257
- n(this, "selectors", {
249
+ i(this, "selectors", {
258
250
  item: ".accordion-item",
259
251
  collapse: ".accordion-collapse",
260
252
  body: ".accordion-body",
@@ -312,18 +304,18 @@ class M extends i {
312
304
  }
313
305
  async state() {
314
306
  return await this.locatorRoot.evaluate((t) => {
315
- const r = [...t.querySelectorAll(".accordion-item")], c = [];
316
- for (const l of r) {
317
- const e = l.querySelector(".accordion-collapse"), o = l.querySelector(".accordion-button");
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");
318
310
  c.push({
319
311
  classes: l.className.trim().split(" "),
320
312
  id: l.id,
321
- isInDOM: e !== null,
322
- collapseId: e == null ? void 0 : e.id,
313
+ isInDOM: r !== null,
314
+ collapseId: r == null ? void 0 : r.id,
323
315
  buttonId: o == null ? void 0 : o.id,
324
316
  expanded: o == null ? void 0 : o.getAttribute("aria-expanded"),
325
317
  disabled: o == null ? void 0 : o.getAttribute("aria-disabled"),
326
- labeledBy: e == null ? void 0 : e.getAttribute("aria-labelledby"),
318
+ labeledBy: r == null ? void 0 : r.getAttribute("aria-labelledby"),
327
319
  buttonControls: o == null ? void 0 : o.getAttribute("aria-controls")
328
320
  });
329
321
  }
@@ -336,10 +328,10 @@ const P = {
336
328
  outerBar: ".progress",
337
329
  innerBar: ".progress-bar"
338
330
  };
339
- class E extends i {
331
+ class V extends n {
340
332
  constructor() {
341
333
  super(...arguments);
342
- n(this, "selectors", structuredClone(P));
334
+ i(this, "selectors", structuredClone(P));
343
335
  }
344
336
  getComponentSelector() {
345
337
  return this.selectors.rootComponent;
@@ -352,34 +344,92 @@ class E extends i {
352
344
  }
353
345
  async state() {
354
346
  return this.locatorRoot.evaluate((t) => {
355
- var l, e, o, h, u, d;
356
- const r = t.querySelector(".progress-bar"), c = t.querySelector(".progress");
347
+ var l, r, o, d, h, g;
348
+ const e = t.querySelector(".progress-bar"), c = t.querySelector(".progress");
357
349
  return {
358
350
  ariaLabel: t.getAttribute("aria-label"),
359
351
  ariaValueNow: t.getAttribute("aria-valuenow"),
360
352
  ariaValueMin: t.getAttribute("aria-valuemin"),
361
353
  ariaValueMax: t.getAttribute("aria-valuemax"),
362
354
  ariaValueText: t.getAttribute("aria-valuetext"),
363
- label: (l = r == null ? void 0 : r.textContent) == null ? void 0 : l.trim(),
364
- innerClasses: ((h = (o = (e = r == null ? void 0 : r.className) == null ? void 0 : e.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 = r == null ? void 0 : r.style) == null ? void 0 : d.width
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
367
359
  };
368
360
  });
369
361
  }
370
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
+ }
371
419
  export {
372
- M as AccordionPO,
373
- H as AlertPO,
374
- q as ModalPO,
375
- O as PaginationPO,
376
- E as ProgressbarPO,
377
- w as RatingPO,
378
- k as SelectPO,
379
- B as alertSelectors,
380
- y as modalSelectors,
381
- R as paginationSelectors,
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,
382
431
  P as progressbarSelectors,
383
432
  v as ratingSelectors,
384
- S as selectSelectors
433
+ R as selectSelectors,
434
+ B as sliderSelectors
385
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.3"
23
+ "@agnos-ui/base-po": "0.0.1-alpha.5"
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.3"
38
+ "version": "0.0.1-alpha.5"
39
39
  }