@agnos-ui/page-objects 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +20 -5
- package/dist/lib/index.js +1 -1
- package/dist/lib/index.mjs +117 -93
- package/package.json +13 -11
package/dist/lib/index.d.ts
CHANGED
|
@@ -6,17 +6,17 @@ export declare class AccordionPO extends BasePO {
|
|
|
6
6
|
private readonly selectors;
|
|
7
7
|
getComponentSelector(): string;
|
|
8
8
|
/**
|
|
9
|
-
* Gets the locators of the items containing the header and the
|
|
9
|
+
* Gets the locators of the items containing the header and the body-container inside
|
|
10
10
|
* the accordion
|
|
11
11
|
*/
|
|
12
12
|
get locatorAccordionItems(): Locator;
|
|
13
13
|
/**
|
|
14
|
-
* Gets the locators of the item specified by the itemIndex containing the header and the
|
|
14
|
+
* Gets the locators of the item specified by the itemIndex containing the header and the body-container inside
|
|
15
15
|
* the accordion
|
|
16
16
|
*/
|
|
17
17
|
locatorAccordionItem(itemIndex: number): Locator;
|
|
18
|
-
get
|
|
19
|
-
|
|
18
|
+
get locatorAccordionCBodyContainers(): Locator;
|
|
19
|
+
locatorAccordionBodyContainer(bodyContainerIndex: number): Locator;
|
|
20
20
|
/**
|
|
21
21
|
* Gets the locator of the bodies of the accordion.
|
|
22
22
|
*/
|
|
@@ -36,7 +36,7 @@ export declare class AccordionPO extends BasePO {
|
|
|
36
36
|
classes: string[];
|
|
37
37
|
id: string;
|
|
38
38
|
isInDOM: boolean;
|
|
39
|
-
|
|
39
|
+
bodyContainerId: string | undefined;
|
|
40
40
|
buttonId: string | undefined;
|
|
41
41
|
expanded: string | null | undefined;
|
|
42
42
|
disabled: string | null | undefined;
|
|
@@ -49,14 +49,21 @@ export declare class AccordionPO extends BasePO {
|
|
|
49
49
|
export declare class AlertPO extends BasePO {
|
|
50
50
|
selectors: {
|
|
51
51
|
rootComponent: string;
|
|
52
|
+
body: string;
|
|
52
53
|
closeButton: string;
|
|
53
54
|
};
|
|
54
55
|
getComponentSelector(): string;
|
|
55
56
|
get locatorCloseButton(): Locator;
|
|
57
|
+
state(): Promise<{
|
|
58
|
+
rootClasses: string[];
|
|
59
|
+
body: string | undefined;
|
|
60
|
+
closeButton: string | null | undefined;
|
|
61
|
+
}>;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
export declare const alertSelectors: {
|
|
59
65
|
rootComponent: string;
|
|
66
|
+
body: string;
|
|
60
67
|
closeButton: string;
|
|
61
68
|
};
|
|
62
69
|
|
|
@@ -85,6 +92,14 @@ export declare class ModalPO extends BasePO {
|
|
|
85
92
|
get locatorFooter(): Locator;
|
|
86
93
|
get locatorCloseButton(): Locator;
|
|
87
94
|
get locatorBackdrop(): Locator;
|
|
95
|
+
state(): Promise<{
|
|
96
|
+
rootClasses: string[];
|
|
97
|
+
header: string | undefined;
|
|
98
|
+
title: string | undefined;
|
|
99
|
+
body: string | undefined;
|
|
100
|
+
footer: string | undefined;
|
|
101
|
+
closeButton: string | null | undefined;
|
|
102
|
+
}>;
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
export declare const modalSelectors: {
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var R=Object.defineProperty;var B=(c,a,t)=>a in c?R(c,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[a]=t;var u=(c,a,t)=>(B(c,typeof a!="symbol"?a+"":a,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@agnos-ui/base-po"),y={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 g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(y))}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 A={rootComponent:".au-pagination",activePage:".active",previousPage:".au-previous",nextPage:".au-next",firstPage:".au-first",lastPage:".au-last",pages:".au-page",ellipses:".au-ellipsis"};class q extends g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(A))}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)}async state(){return this.locatorRoot.evaluate(t=>{const e={rootClasses:[],disabled:null,pages:[],hrefs:[]},l=[...t.querySelectorAll(".au-page")],s=[],r=[],o={},i=h=>h==null?void 0:h.getAttribute("href"),n=t.querySelector("a.au-first"),d=t.querySelector("a.au-previous"),p=t.querySelector("a.au-next"),m=t.querySelector("a.au-last");n&&(o.first=i(n)),d&&(o.previous=i(d)),p&&(o.next=i(p)),m&&(o.last=i(m));for(const h of l)r.push(h.getAttribute("href")||""),s.push((h.textContent||"").trim());const b=[...t.querySelectorAll("a.au-page[aria-disabled]")];return e.pages=s,e.hrefs=r,e.hrefsNavigation=o,e.rootClasses=t.className.trim().split(" "),e.disabled=b.length===l.length?"true":null,t.querySelector("a.au-previous[aria-disabled]")?e.isPreviousDisabled=!0:d&&(e.isPreviousDisabled=!1),t.querySelector("a.au-next[aria-disabled]")?e.isNextDisabled=!0:p&&(e.isNextDisabled=!1),t.querySelector("a.au-first[aria-disabled]")?e.isFirstDisabled=!0:n&&(e.isFirstDisabled=!1),t.querySelector("a.au-last[aria-disabled]")?e.isLastDisabled=!0:m&&(e.isLastDisabled=!1),e})}}const S={rootComponent:".au-rating",star:".au-rating-star"};class L extends g.BasePO{constructor(){super(...arguments);u(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,e)=>{const l=[...t.querySelectorAll(e.star)],s=[],r=[];for(const o of l)s.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:s,classes:r}},this.selectors)}}const x={rootComponent:".au-select"};class H extends g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(x))}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 d,p;const e=t.querySelector('div[role="combobox"]'),l=t.querySelector('input[type="text"]'),s=[];if(e){const m=e.querySelectorAll("div.au-select-badge");for(const b of m)s.push((d=b==null?void 0:b.textContent)==null?void 0:d.trim())}const r=t.querySelector("ul.dropdown-menu"),o=r!=null,i=[],n=[];if(r!=null){const m=r.querySelectorAll("li.dropdown-item");for(const b of m){const h=(p=b.textContent)==null?void 0:p.trim();i.push(h),b.classList.contains("selected")&&n.push(h)}}return{text:l.value,badges:s,isOpen:o,list:i,checked:n}})}}const C={rootComponent:".alert",closeButton:".btn-close"};class M extends g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(C))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}class I extends g.BasePO{constructor(){super(...arguments);u(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")],l=[];for(const s of e){const r=s.querySelector(".accordion-collapse"),o=s.querySelector(".accordion-button");l.push({classes:s.className.trim().split(" "),id:s.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:l}})}}const P={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class w extends g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(P))}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 s,r,o,i,n,d;const e=t.querySelector(".progress-bar"),l=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:(s=e==null?void 0:e.textContent)==null?void 0:s.trim(),innerClasses:((i=(o=(r=e==null?void 0:e.className)==null?void 0:r.trim())==null?void 0:o.split(" "))==null?void 0:i.sort())??[],outerHeight:(n=l==null?void 0:l.style)==null?void 0:n.height,innerWidth:(d=e==null?void 0:e.style)==null?void 0:d.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 V extends g.BasePO{constructor(){super(...arguments);u(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"),disabled:e.getAttribute("aria-disabled"),readonly:e.getAttribute("aria-readonly"),ariaLabel:e.getAttribute("aria-label"),ariaValueText:e.getAttribute("aria-valuetext")})))}async sliderProgressState(){return this.locatorRoot.locator(this.selectors.progress).evaluateAll(t=>t.map(e=>e.getAttribute("style")))}}const f={rootComponent:".toast",closeButton:".btn-close",header:".toast-header",body:".toast-body"};class T extends g.BasePO{constructor(){super(...arguments);u(this,"selectors",structuredClone(f))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return await this.locatorRoot.evaluate((t,e)=>{var o,i,n;const l=(o=t.querySelector(e.body))==null?void 0:o.innerText,s=(i=t.querySelector(e.header))==null?void 0:i.innerText,r=(n=t.querySelector(e.closeButton))==null?void 0:n.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:l,header:s,closeButton:r}},this.selectors)}}exports.AccordionPO=I;exports.AlertPO=M;exports.ModalPO=O;exports.PaginationPO=q;exports.ProgressbarPO=w;exports.RatingPO=L;exports.SelectPO=H;exports.SliderPO=V;exports.ToastPO=T;exports.alertSelectors=C;exports.modalSelectors=y;exports.paginationSelectors=A;exports.progressbarSelectors=P;exports.ratingSelectors=S;exports.selectSelectors=x;exports.sliderSelectors=v;exports.toastSelectors=f;
|
|
1
|
+
"use strict";var O=Object.defineProperty;var L=(n,c,t)=>c in n?O(n,c,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[c]=t;var b=(n,c,t)=>(L(n,typeof c!="symbol"?c+"":c,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=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 H extends p.BasePO{constructor(){super(...arguments);b(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)}async state(){return this.locatorRoot.evaluate(async(t,e)=>{var i,u,m,g,h,d,y,S,x;const a=(i=t.querySelector(e.closeButton))==null?void 0:i.getAttribute("aria-label"),s=(m=(u=t.querySelector(e.header))==null?void 0:u.innerText)==null?void 0:m.trim(),r=(h=(g=t.querySelector(e.title))==null?void 0:g.innerText)==null?void 0:h.trim(),o=(y=(d=t.querySelector(e.body))==null?void 0:d.innerText)==null?void 0:y.trim(),l=(x=(S=t.querySelector(e.footer))==null?void 0:S.innerText)==null?void 0:x.trim();return{rootClasses:t.className.trim().split(" ").sort(),header:s,title:r,body:o,footer:l,closeButton:a}},this.selectors)}}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 T extends p.BasePO{constructor(){super(...arguments);b(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)}async state(){return this.locatorRoot.evaluate(t=>{const e={rootClasses:[],disabled:null,pages:[],hrefs:[]},a=[...t.querySelectorAll(".au-page")],s=[],r=[],o={},l=d=>d==null?void 0:d.getAttribute("href"),i=t.querySelector("a.au-first"),u=t.querySelector("a.au-previous"),m=t.querySelector("a.au-next"),g=t.querySelector("a.au-last");i&&(o.first=l(i)),u&&(o.previous=l(u)),m&&(o.next=l(m)),g&&(o.last=l(g));for(const d of a)r.push(d.getAttribute("href")||""),s.push((d.textContent||"").trim());const h=[...t.querySelectorAll("a.au-page[aria-disabled]")];return e.pages=s,e.hrefs=r,e.hrefsNavigation=o,e.rootClasses=t.className.trim().split(" "),e.disabled=h.length===a.length?"true":null,t.querySelector("a.au-previous[aria-disabled]")?e.isPreviousDisabled=!0:u&&(e.isPreviousDisabled=!1),t.querySelector("a.au-next[aria-disabled]")?e.isNextDisabled=!0:m&&(e.isNextDisabled=!1),t.querySelector("a.au-first[aria-disabled]")?e.isFirstDisabled=!0:i&&(e.isFirstDisabled=!1),t.querySelector("a.au-last[aria-disabled]")?e.isLastDisabled=!0:g&&(e.isLastDisabled=!1),e})}}const P={rootComponent:".au-rating",star:".au-rating-star"};class M extends p.BasePO{constructor(){super(...arguments);b(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 a=[...t.querySelectorAll(e.star)],s=[],r=[];for(const o of a)s.push((o.textContent||"").trim()),r.push(o.className.split(" "));return{rootClasses:t.className.trim().split(" ").sort(),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:s,classes:r}},this.selectors)}}const v={rootComponent:".au-select"};class I extends p.BasePO{constructor(){super(...arguments);b(this,"selectors",structuredClone(v))}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 u,m;const e=t.querySelector('div[role="combobox"]'),a=t.querySelector('input[type="text"]'),s=[];if(e){const g=e.querySelectorAll("div.au-select-badge");for(const h of g)s.push((u=h==null?void 0:h.textContent)==null?void 0:u.trim())}const r=t.querySelector("ul.dropdown-menu"),o=r!=null,l=[],i=[];if(r!=null){const g=r.querySelectorAll("li.dropdown-item");for(const h of g){const d=(m=h.textContent)==null?void 0:m.trim();l.push(d),h.classList.contains("selected")&&i.push(d)}}return{text:a.value,badges:s,isOpen:o,list:l,checked:i}})}}const f={rootComponent:".alert",body:".alert-body",closeButton:".btn-close"};class w extends p.BasePO{constructor(){super(...arguments);b(this,"selectors",structuredClone(f))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return this.locatorRoot.evaluate((t,e)=>{var r,o,l;const a=(o=(r=t.querySelector(e.body))==null?void 0:r.innerText)==null?void 0:o.replace(/[^\x20-\x7E]/g,""),s=(l=t.querySelector(e.closeButton))==null?void 0:l.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:a,closeButton:s}},this.selectors)}}class V extends p.BasePO{constructor(){super(...arguments);b(this,"selectors",{item:".accordion-item",bodyContainer:".accordion-collapse",body:".accordion-body",header:".accordion-header",buttons:".accordion-button"})}getComponentSelector(){return".au-accordion"}get locatorAccordionItems(){return this.locatorRoot.locator(this.selectors.item)}locatorAccordionItem(t){return this.locatorRoot.locator(this.selectors.item).nth(t)}get locatorAccordionCBodyContainers(){return this.locatorAccordionItems.locator(this.selectors.bodyContainer)}locatorAccordionBodyContainer(t){return this.locatorAccordionItem(t).locator(this.selectors.bodyContainer)}get locatorAccordionBodies(){return this.locatorAccordionCBodyContainers.locator(this.selectors.body)}locatorAccordionBody(t){return this.locatorAccordionBodyContainer(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")],a=[];for(const s of e){const r=s.querySelector(".accordion-collapse"),o=s.querySelector(".accordion-button");a.push({classes:s.className.trim().split(" "),id:s.id,isInDOM:r!==null,bodyContainerId: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:a}})}}const B={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class E extends p.BasePO{constructor(){super(...arguments);b(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 s,r,o,l,i,u;const e=t.querySelector(".progress-bar"),a=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:(s=e==null?void 0:e.textContent)==null?void 0:s.trim(),innerClasses:((l=(o=(r=e==null?void 0:e.className)==null?void 0:r.trim())==null?void 0:o.split(" "))==null?void 0:l.sort())??[],outerHeight:(i=a==null?void 0:a.style)==null?void 0:i.height,innerWidth:(u=e==null?void 0:e.style)==null?void 0:u.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",valueLabel:".au-slider-label-now",progress:".au-slider-progress"};class D extends p.BasePO{constructor(){super(...arguments);b(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)}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"),disabled:e.getAttribute("aria-disabled"),readonly:e.getAttribute("aria-readonly"),ariaLabel:e.getAttribute("aria-label"),ariaValueText:e.getAttribute("aria-valuetext")})))}async sliderProgressState(){return this.locatorRoot.locator(this.selectors.progress).evaluateAll(t=>t.map(e=>e.getAttribute("style")))}}const q={rootComponent:".toast",closeButton:".btn-close",header:".toast-header",body:".toast-body"};class k extends p.BasePO{constructor(){super(...arguments);b(this,"selectors",structuredClone(q))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return await this.locatorRoot.evaluate((t,e)=>{var o,l,i;const a=(o=t.querySelector(e.body))==null?void 0:o.innerText,s=(l=t.querySelector(e.header))==null?void 0:l.innerText,r=(i=t.querySelector(e.closeButton))==null?void 0:i.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:a,header:s,closeButton:r}},this.selectors)}}exports.AccordionPO=V;exports.AlertPO=w;exports.ModalPO=H;exports.PaginationPO=T;exports.ProgressbarPO=E;exports.RatingPO=M;exports.SelectPO=I;exports.SliderPO=D;exports.ToastPO=k;exports.alertSelectors=f;exports.modalSelectors=A;exports.paginationSelectors=C;exports.progressbarSelectors=B;exports.ratingSelectors=P;exports.selectSelectors=v;exports.sliderSelectors=R;exports.toastSelectors=q;
|
package/dist/lib/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { BasePO as
|
|
5
|
-
const
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var S = (n, c, t) => c in n ? C(n, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[c] = t;
|
|
3
|
+
var b = (n, c, t) => (S(n, typeof c != "symbol" ? c + "" : c, t), t);
|
|
4
|
+
import { BasePO as p } from "@agnos-ui/base-po";
|
|
5
|
+
const v = {
|
|
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 A = {
|
|
|
12
12
|
body: ".modal-body",
|
|
13
13
|
footer: ".modal-footer"
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class w extends p {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
|
|
18
|
+
b(this, "selectors", structuredClone(v));
|
|
19
19
|
}
|
|
20
20
|
getComponentSelector() {
|
|
21
21
|
return this.selectors.rootComponent;
|
|
@@ -38,8 +38,22 @@ class H extends g {
|
|
|
38
38
|
get locatorBackdrop() {
|
|
39
39
|
return this.locatorRoot.locator(this.selectors.backdrop);
|
|
40
40
|
}
|
|
41
|
+
async state() {
|
|
42
|
+
return this.locatorRoot.evaluate(async (t, e) => {
|
|
43
|
+
var i, u, m, g, h, d, y, x, A;
|
|
44
|
+
const a = (i = t.querySelector(e.closeButton)) == null ? void 0 : i.getAttribute("aria-label"), s = (m = (u = t.querySelector(e.header)) == null ? void 0 : u.innerText) == null ? void 0 : m.trim(), r = (h = (g = t.querySelector(e.title)) == null ? void 0 : g.innerText) == null ? void 0 : h.trim(), o = (y = (d = t.querySelector(e.body)) == null ? void 0 : d.innerText) == null ? void 0 : y.trim(), l = (A = (x = t.querySelector(e.footer)) == null ? void 0 : x.innerText) == null ? void 0 : A.trim();
|
|
45
|
+
return {
|
|
46
|
+
rootClasses: t.className.trim().split(" ").sort(),
|
|
47
|
+
header: s,
|
|
48
|
+
title: r,
|
|
49
|
+
body: o,
|
|
50
|
+
footer: l,
|
|
51
|
+
closeButton: a
|
|
52
|
+
};
|
|
53
|
+
}, this.selectors);
|
|
54
|
+
}
|
|
41
55
|
}
|
|
42
|
-
const
|
|
56
|
+
const f = {
|
|
43
57
|
rootComponent: ".au-pagination",
|
|
44
58
|
activePage: ".active",
|
|
45
59
|
previousPage: ".au-previous",
|
|
@@ -49,10 +63,10 @@ const C = {
|
|
|
49
63
|
pages: ".au-page",
|
|
50
64
|
ellipses: ".au-ellipsis"
|
|
51
65
|
};
|
|
52
|
-
class
|
|
66
|
+
class M extends p {
|
|
53
67
|
constructor() {
|
|
54
68
|
super(...arguments);
|
|
55
|
-
|
|
69
|
+
b(this, "selectors", structuredClone(f));
|
|
56
70
|
}
|
|
57
71
|
// TODO should we add this in the list of selector ?
|
|
58
72
|
// Depend on the setSelectors usage...
|
|
@@ -114,23 +128,23 @@ class I extends g {
|
|
|
114
128
|
}
|
|
115
129
|
async state() {
|
|
116
130
|
return this.locatorRoot.evaluate((t) => {
|
|
117
|
-
const e = { rootClasses: [], disabled: null, pages: [], hrefs: [] },
|
|
118
|
-
|
|
119
|
-
for (const
|
|
120
|
-
r.push(
|
|
121
|
-
const
|
|
122
|
-
return e.pages = s, e.hrefs = r, e.hrefsNavigation = o, e.rootClasses = t.className.trim().split(" "), e.disabled =
|
|
131
|
+
const e = { rootClasses: [], disabled: null, pages: [], hrefs: [] }, a = [...t.querySelectorAll(".au-page")], s = [], r = [], o = {}, l = (d) => d == null ? void 0 : d.getAttribute("href"), i = t.querySelector("a.au-first"), u = t.querySelector("a.au-previous"), m = t.querySelector("a.au-next"), g = t.querySelector("a.au-last");
|
|
132
|
+
i && (o.first = l(i)), u && (o.previous = l(u)), m && (o.next = l(m)), g && (o.last = l(g));
|
|
133
|
+
for (const d of a)
|
|
134
|
+
r.push(d.getAttribute("href") || ""), s.push((d.textContent || "").trim());
|
|
135
|
+
const h = [...t.querySelectorAll("a.au-page[aria-disabled]")];
|
|
136
|
+
return e.pages = s, e.hrefs = r, e.hrefsNavigation = o, e.rootClasses = t.className.trim().split(" "), e.disabled = h.length === a.length ? "true" : null, t.querySelector("a.au-previous[aria-disabled]") ? e.isPreviousDisabled = !0 : u && (e.isPreviousDisabled = !1), t.querySelector("a.au-next[aria-disabled]") ? e.isNextDisabled = !0 : m && (e.isNextDisabled = !1), t.querySelector("a.au-first[aria-disabled]") ? e.isFirstDisabled = !0 : i && (e.isFirstDisabled = !1), t.querySelector("a.au-last[aria-disabled]") ? e.isLastDisabled = !0 : g && (e.isLastDisabled = !1), e;
|
|
123
137
|
});
|
|
124
138
|
}
|
|
125
139
|
}
|
|
126
|
-
const
|
|
140
|
+
const R = {
|
|
127
141
|
rootComponent: ".au-rating",
|
|
128
142
|
star: ".au-rating-star"
|
|
129
143
|
};
|
|
130
|
-
class
|
|
144
|
+
class O extends p {
|
|
131
145
|
constructor() {
|
|
132
146
|
super(...arguments);
|
|
133
|
-
|
|
147
|
+
b(this, "selectors", structuredClone(R));
|
|
134
148
|
}
|
|
135
149
|
getComponentSelector() {
|
|
136
150
|
return this.selectors.rootComponent;
|
|
@@ -141,15 +155,13 @@ class w extends g {
|
|
|
141
155
|
locatorStar(t) {
|
|
142
156
|
return this.locatorRoot.locator(this.selectors.star).nth(t);
|
|
143
157
|
}
|
|
144
|
-
// TODO to be pushed to the test itself
|
|
145
|
-
// We already discuss with Guillaume Saas not to put this in the basic PO which should only return locator basically
|
|
146
158
|
async state() {
|
|
147
159
|
return await this.locatorRoot.evaluate((t, e) => {
|
|
148
|
-
const
|
|
149
|
-
for (const o of
|
|
160
|
+
const a = [...t.querySelectorAll(e.star)], s = [], r = [];
|
|
161
|
+
for (const o of a)
|
|
150
162
|
s.push((o.textContent || "").trim()), r.push(o.className.split(" "));
|
|
151
163
|
return {
|
|
152
|
-
rootClasses: t.className.trim().split(" "),
|
|
164
|
+
rootClasses: t.className.trim().split(" ").sort(),
|
|
153
165
|
value: t.getAttribute("aria-valuenow"),
|
|
154
166
|
min: t.getAttribute("aria-valuemin"),
|
|
155
167
|
max: t.getAttribute("aria-valuemax"),
|
|
@@ -162,14 +174,14 @@ class w extends g {
|
|
|
162
174
|
}, this.selectors);
|
|
163
175
|
}
|
|
164
176
|
}
|
|
165
|
-
const
|
|
177
|
+
const B = {
|
|
166
178
|
rootComponent: ".au-select"
|
|
167
179
|
// TODO add selector list
|
|
168
180
|
};
|
|
169
|
-
class
|
|
181
|
+
class V extends p {
|
|
170
182
|
constructor() {
|
|
171
183
|
super(...arguments);
|
|
172
|
-
|
|
184
|
+
b(this, "selectors", structuredClone(B));
|
|
173
185
|
}
|
|
174
186
|
getComponentSelector() {
|
|
175
187
|
return this.selectors.rootComponent;
|
|
@@ -212,39 +224,40 @@ class M extends g {
|
|
|
212
224
|
}
|
|
213
225
|
async state() {
|
|
214
226
|
return await this.locatorRoot.evaluate((t) => {
|
|
215
|
-
var
|
|
216
|
-
const e = t.querySelector('div[role="combobox"]'),
|
|
227
|
+
var u, m;
|
|
228
|
+
const e = t.querySelector('div[role="combobox"]'), a = t.querySelector('input[type="text"]'), s = [];
|
|
217
229
|
if (e) {
|
|
218
|
-
const
|
|
219
|
-
for (const
|
|
220
|
-
s.push((
|
|
230
|
+
const g = e.querySelectorAll("div.au-select-badge");
|
|
231
|
+
for (const h of g)
|
|
232
|
+
s.push((u = h == null ? void 0 : h.textContent) == null ? void 0 : u.trim());
|
|
221
233
|
}
|
|
222
|
-
const r = t.querySelector("ul.dropdown-menu"), o = r != null,
|
|
234
|
+
const r = t.querySelector("ul.dropdown-menu"), o = r != null, l = [], i = [];
|
|
223
235
|
if (r != null) {
|
|
224
|
-
const
|
|
225
|
-
for (const
|
|
226
|
-
const
|
|
227
|
-
|
|
236
|
+
const g = r.querySelectorAll("li.dropdown-item");
|
|
237
|
+
for (const h of g) {
|
|
238
|
+
const d = (m = h.textContent) == null ? void 0 : m.trim();
|
|
239
|
+
l.push(d), h.classList.contains("selected") && i.push(d);
|
|
228
240
|
}
|
|
229
241
|
}
|
|
230
242
|
return {
|
|
231
|
-
text:
|
|
243
|
+
text: a.value,
|
|
232
244
|
badges: s,
|
|
233
245
|
isOpen: o,
|
|
234
|
-
list:
|
|
235
|
-
checked:
|
|
246
|
+
list: l,
|
|
247
|
+
checked: i
|
|
236
248
|
};
|
|
237
249
|
});
|
|
238
250
|
}
|
|
239
251
|
}
|
|
240
|
-
const
|
|
252
|
+
const q = {
|
|
241
253
|
rootComponent: ".alert",
|
|
254
|
+
body: ".alert-body",
|
|
242
255
|
closeButton: ".btn-close"
|
|
243
256
|
};
|
|
244
|
-
class
|
|
257
|
+
class E extends p {
|
|
245
258
|
constructor() {
|
|
246
259
|
super(...arguments);
|
|
247
|
-
|
|
260
|
+
b(this, "selectors", structuredClone(q));
|
|
248
261
|
}
|
|
249
262
|
getComponentSelector() {
|
|
250
263
|
return this.selectors.rootComponent;
|
|
@@ -252,49 +265,60 @@ class O extends g {
|
|
|
252
265
|
get locatorCloseButton() {
|
|
253
266
|
return this.locatorRoot.locator(this.selectors.closeButton);
|
|
254
267
|
}
|
|
268
|
+
async state() {
|
|
269
|
+
return this.locatorRoot.evaluate((t, e) => {
|
|
270
|
+
var r, o, l;
|
|
271
|
+
const a = (o = (r = t.querySelector(e.body)) == null ? void 0 : r.innerText) == null ? void 0 : o.replace(/[^\x20-\x7E]/g, ""), s = (l = t.querySelector(e.closeButton)) == null ? void 0 : l.getAttribute("aria-label");
|
|
272
|
+
return {
|
|
273
|
+
rootClasses: t.className.trim().split(" ").sort(),
|
|
274
|
+
body: a,
|
|
275
|
+
closeButton: s
|
|
276
|
+
};
|
|
277
|
+
}, this.selectors);
|
|
278
|
+
}
|
|
255
279
|
}
|
|
256
|
-
class
|
|
280
|
+
class D extends p {
|
|
257
281
|
constructor() {
|
|
258
282
|
super(...arguments);
|
|
259
|
-
|
|
283
|
+
b(this, "selectors", {
|
|
260
284
|
item: ".accordion-item",
|
|
261
|
-
|
|
285
|
+
bodyContainer: ".accordion-collapse",
|
|
262
286
|
body: ".accordion-body",
|
|
263
287
|
header: ".accordion-header",
|
|
264
288
|
buttons: ".accordion-button"
|
|
265
289
|
});
|
|
266
290
|
}
|
|
267
291
|
getComponentSelector() {
|
|
268
|
-
return ".accordion";
|
|
292
|
+
return ".au-accordion";
|
|
269
293
|
}
|
|
270
294
|
/**
|
|
271
|
-
* Gets the locators of the items containing the header and the
|
|
295
|
+
* Gets the locators of the items containing the header and the body-container inside
|
|
272
296
|
* the accordion
|
|
273
297
|
*/
|
|
274
298
|
get locatorAccordionItems() {
|
|
275
299
|
return this.locatorRoot.locator(this.selectors.item);
|
|
276
300
|
}
|
|
277
301
|
/**
|
|
278
|
-
* Gets the locators of the item specified by the itemIndex containing the header and the
|
|
302
|
+
* Gets the locators of the item specified by the itemIndex containing the header and the body-container inside
|
|
279
303
|
* the accordion
|
|
280
304
|
*/
|
|
281
305
|
locatorAccordionItem(t) {
|
|
282
306
|
return this.locatorRoot.locator(this.selectors.item).nth(t);
|
|
283
307
|
}
|
|
284
|
-
get
|
|
285
|
-
return this.locatorAccordionItems.locator(this.selectors.
|
|
308
|
+
get locatorAccordionCBodyContainers() {
|
|
309
|
+
return this.locatorAccordionItems.locator(this.selectors.bodyContainer);
|
|
286
310
|
}
|
|
287
|
-
|
|
288
|
-
return this.locatorAccordionItem(t).locator(this.selectors.
|
|
311
|
+
locatorAccordionBodyContainer(t) {
|
|
312
|
+
return this.locatorAccordionItem(t).locator(this.selectors.bodyContainer);
|
|
289
313
|
}
|
|
290
314
|
/**
|
|
291
315
|
* Gets the locator of the bodies of the accordion.
|
|
292
316
|
*/
|
|
293
317
|
get locatorAccordionBodies() {
|
|
294
|
-
return this.
|
|
318
|
+
return this.locatorAccordionCBodyContainers.locator(this.selectors.body);
|
|
295
319
|
}
|
|
296
320
|
locatorAccordionBody(t) {
|
|
297
|
-
return this.
|
|
321
|
+
return this.locatorAccordionBodyContainer(t).locator(this.selectors.body);
|
|
298
322
|
}
|
|
299
323
|
get locatorAccordionHeaders() {
|
|
300
324
|
return this.locatorAccordionItems.locator(this.selectors.header);
|
|
@@ -314,14 +338,14 @@ class V extends g {
|
|
|
314
338
|
}
|
|
315
339
|
async state() {
|
|
316
340
|
return await this.locatorRoot.evaluate((t) => {
|
|
317
|
-
const e = [...t.querySelectorAll(".accordion-item")],
|
|
341
|
+
const e = [...t.querySelectorAll(".accordion-item")], a = [];
|
|
318
342
|
for (const s of e) {
|
|
319
343
|
const r = s.querySelector(".accordion-collapse"), o = s.querySelector(".accordion-button");
|
|
320
|
-
|
|
344
|
+
a.push({
|
|
321
345
|
classes: s.className.trim().split(" "),
|
|
322
346
|
id: s.id,
|
|
323
347
|
isInDOM: r !== null,
|
|
324
|
-
|
|
348
|
+
bodyContainerId: r == null ? void 0 : r.id,
|
|
325
349
|
buttonId: o == null ? void 0 : o.id,
|
|
326
350
|
expanded: o == null ? void 0 : o.getAttribute("aria-expanded"),
|
|
327
351
|
disabled: o == null ? void 0 : o.getAttribute("aria-disabled"),
|
|
@@ -329,19 +353,19 @@ class V extends g {
|
|
|
329
353
|
buttonControls: o == null ? void 0 : o.getAttribute("aria-controls")
|
|
330
354
|
});
|
|
331
355
|
}
|
|
332
|
-
return { rootClasses: t.className.trim().split(" "), items:
|
|
356
|
+
return { rootClasses: t.className.trim().split(" "), items: a };
|
|
333
357
|
});
|
|
334
358
|
}
|
|
335
359
|
}
|
|
336
|
-
const
|
|
360
|
+
const P = {
|
|
337
361
|
rootComponent: '[role="progressbar"]',
|
|
338
362
|
outerBar: ".progress",
|
|
339
363
|
innerBar: ".progress-bar"
|
|
340
364
|
};
|
|
341
|
-
class
|
|
365
|
+
class k extends p {
|
|
342
366
|
constructor() {
|
|
343
367
|
super(...arguments);
|
|
344
|
-
|
|
368
|
+
b(this, "selectors", structuredClone(P));
|
|
345
369
|
}
|
|
346
370
|
getComponentSelector() {
|
|
347
371
|
return this.selectors.rootComponent;
|
|
@@ -354,8 +378,8 @@ class D extends g {
|
|
|
354
378
|
}
|
|
355
379
|
async state() {
|
|
356
380
|
return this.locatorRoot.evaluate((t) => {
|
|
357
|
-
var s, r, o,
|
|
358
|
-
const e = t.querySelector(".progress-bar"),
|
|
381
|
+
var s, r, o, l, i, u;
|
|
382
|
+
const e = t.querySelector(".progress-bar"), a = t.querySelector(".progress");
|
|
359
383
|
return {
|
|
360
384
|
ariaLabel: t.getAttribute("aria-label"),
|
|
361
385
|
ariaValueNow: t.getAttribute("aria-valuenow"),
|
|
@@ -363,14 +387,14 @@ class D extends g {
|
|
|
363
387
|
ariaValueMax: t.getAttribute("aria-valuemax"),
|
|
364
388
|
ariaValueText: t.getAttribute("aria-valuetext"),
|
|
365
389
|
label: (s = e == null ? void 0 : e.textContent) == null ? void 0 : s.trim(),
|
|
366
|
-
innerClasses: ((
|
|
367
|
-
outerHeight: (
|
|
368
|
-
innerWidth: (
|
|
390
|
+
innerClasses: ((l = (o = (r = e == null ? void 0 : e.className) == null ? void 0 : r.trim()) == null ? void 0 : o.split(" ")) == null ? void 0 : l.sort()) ?? [],
|
|
391
|
+
outerHeight: (i = a == null ? void 0 : a.style) == null ? void 0 : i.height,
|
|
392
|
+
innerWidth: (u = e == null ? void 0 : e.style) == null ? void 0 : u.width
|
|
369
393
|
};
|
|
370
394
|
});
|
|
371
395
|
}
|
|
372
396
|
}
|
|
373
|
-
const
|
|
397
|
+
const L = {
|
|
374
398
|
rootComponent: ".au-slider",
|
|
375
399
|
clickableArea: ".au-slider-clickable-area",
|
|
376
400
|
handle: ".au-slider-handle",
|
|
@@ -381,10 +405,10 @@ const P = {
|
|
|
381
405
|
valueLabel: ".au-slider-label-now",
|
|
382
406
|
progress: ".au-slider-progress"
|
|
383
407
|
};
|
|
384
|
-
class
|
|
408
|
+
class z extends p {
|
|
385
409
|
constructor() {
|
|
386
410
|
super(...arguments);
|
|
387
|
-
|
|
411
|
+
b(this, "selectors", structuredClone(L));
|
|
388
412
|
}
|
|
389
413
|
getComponentSelector() {
|
|
390
414
|
return this.selectors.rootComponent;
|
|
@@ -426,16 +450,16 @@ class E extends g {
|
|
|
426
450
|
return this.locatorRoot.locator(this.selectors.progress).evaluateAll((t) => t.map((e) => e.getAttribute("style")));
|
|
427
451
|
}
|
|
428
452
|
}
|
|
429
|
-
const
|
|
453
|
+
const H = {
|
|
430
454
|
rootComponent: ".toast",
|
|
431
455
|
closeButton: ".btn-close",
|
|
432
456
|
header: ".toast-header",
|
|
433
457
|
body: ".toast-body"
|
|
434
458
|
};
|
|
435
|
-
class
|
|
459
|
+
class F extends p {
|
|
436
460
|
constructor() {
|
|
437
461
|
super(...arguments);
|
|
438
|
-
|
|
462
|
+
b(this, "selectors", structuredClone(H));
|
|
439
463
|
}
|
|
440
464
|
getComponentSelector() {
|
|
441
465
|
return this.selectors.rootComponent;
|
|
@@ -445,11 +469,11 @@ class T extends g {
|
|
|
445
469
|
}
|
|
446
470
|
async state() {
|
|
447
471
|
return await this.locatorRoot.evaluate((t, e) => {
|
|
448
|
-
var o,
|
|
449
|
-
const
|
|
472
|
+
var o, l, i;
|
|
473
|
+
const a = (o = t.querySelector(e.body)) == null ? void 0 : o.innerText, s = (l = t.querySelector(e.header)) == null ? void 0 : l.innerText, r = (i = t.querySelector(e.closeButton)) == null ? void 0 : i.getAttribute("aria-label");
|
|
450
474
|
return {
|
|
451
475
|
rootClasses: t.className.trim().split(" ").sort(),
|
|
452
|
-
body:
|
|
476
|
+
body: a,
|
|
453
477
|
header: s,
|
|
454
478
|
closeButton: r
|
|
455
479
|
};
|
|
@@ -457,21 +481,21 @@ class T extends g {
|
|
|
457
481
|
}
|
|
458
482
|
}
|
|
459
483
|
export {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
484
|
+
D as AccordionPO,
|
|
485
|
+
E as AlertPO,
|
|
486
|
+
w as ModalPO,
|
|
487
|
+
M as PaginationPO,
|
|
488
|
+
k as ProgressbarPO,
|
|
489
|
+
O as RatingPO,
|
|
490
|
+
V as SelectPO,
|
|
491
|
+
z as SliderPO,
|
|
492
|
+
F as ToastPO,
|
|
493
|
+
q as alertSelectors,
|
|
494
|
+
v as modalSelectors,
|
|
495
|
+
f as paginationSelectors,
|
|
496
|
+
P as progressbarSelectors,
|
|
497
|
+
R as ratingSelectors,
|
|
498
|
+
B as selectSelectors,
|
|
499
|
+
L as sliderSelectors,
|
|
500
|
+
H as toastSelectors
|
|
477
501
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/page-objects",
|
|
3
3
|
"description": "Page objects to be used when testing AgnosUI-based applications with Playwright.",
|
|
4
|
+
"version": "0.3.1",
|
|
4
5
|
"keywords": [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
6
|
+
"AgnosUI",
|
|
7
|
+
"components",
|
|
7
8
|
"e2e",
|
|
9
|
+
"page-object",
|
|
10
|
+
"playwright",
|
|
8
11
|
"testing",
|
|
9
|
-
"
|
|
10
|
-
"widgets",
|
|
11
|
-
"components"
|
|
12
|
+
"widgets"
|
|
12
13
|
],
|
|
13
14
|
"main": "dist/lib/index.js",
|
|
14
15
|
"module": "dist/lib/index.mjs",
|
|
@@ -39,7 +40,8 @@
|
|
|
39
40
|
"files": [
|
|
40
41
|
"lib/**",
|
|
41
42
|
"tsconfig.json",
|
|
42
|
-
"tsconfig.d.json"
|
|
43
|
+
"tsconfig.d.json",
|
|
44
|
+
"../tsconfig.json"
|
|
43
45
|
],
|
|
44
46
|
"output": [
|
|
45
47
|
"dist/dts/**"
|
|
@@ -55,7 +57,8 @@
|
|
|
55
57
|
"api-extractor.json",
|
|
56
58
|
"../api-extractor.json",
|
|
57
59
|
"tsconfig.json",
|
|
58
|
-
"tsconfig.d.json"
|
|
60
|
+
"tsconfig.d.json",
|
|
61
|
+
"../tsconfig.json"
|
|
59
62
|
],
|
|
60
63
|
"output": [
|
|
61
64
|
"dist/lib/index.d.ts"
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
}
|
|
64
67
|
},
|
|
65
68
|
"dependencies": {
|
|
66
|
-
"@agnos-ui/base-po": "0.
|
|
69
|
+
"@agnos-ui/base-po": "0.3.1"
|
|
67
70
|
},
|
|
68
71
|
"peerDependencies": {
|
|
69
72
|
"@playwright/test": "*"
|
|
@@ -75,8 +78,7 @@
|
|
|
75
78
|
"bugs": "https://github.com/AmadeusITGroup/AgnosUI/issues",
|
|
76
79
|
"repository": {
|
|
77
80
|
"type": "git",
|
|
78
|
-
"url": "https://github.com/AmadeusITGroup/AgnosUI.git",
|
|
81
|
+
"url": "git+https://github.com/AmadeusITGroup/AgnosUI.git",
|
|
79
82
|
"directory": "page-objects"
|
|
80
|
-
}
|
|
81
|
-
"version": "0.2.0"
|
|
83
|
+
}
|
|
82
84
|
}
|