@agnos-ui/page-objects 0.10.0 → 0.11.0
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/index.cjs +1 -1
- package/index.d.ts +0 -1
- package/index.js +45 -118
- package/package.json +2 -2
- package/select.po.d.ts +0 -41
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@agnos-ui/base-po"),m={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 w extends l.BasePO{selectors=structuredClone(m);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((t,e)=>{const o=t.querySelector(e.closeButton)?.getAttribute("aria-label"),r=t.querySelector(e.header)?.innerText?.trim(),s=t.querySelector(e.title)?.innerText?.trim(),a=t.querySelector(e.body)?.innerText?.trim(),n=t.querySelector(e.footer)?.innerText?.trim();return{rootClasses:t.className.trim().split(" ").sort(),header:r,title:s,body:a,footer:n,closeButton:o}},this.selectors)}}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 k extends l.BasePO{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)}async state(){return this.locatorRoot.evaluate(t=>{const e={rootClasses:[],disabled:null,pages:[],hrefs:[]},o=[...t.querySelectorAll(".au-page")],r=[],s=[],a={},n=g=>g?.getAttribute("href"),d=t.querySelector("a.au-first"),u=t.querySelector("a.au-previous"),i=t.querySelector("a.au-next"),h=t.querySelector("a.au-last");d&&(a.first=n(d)),u&&(a.previous=n(u)),i&&(a.next=n(i)),h&&(a.last=n(h));for(const g of o)s.push(g.getAttribute("href")||""),r.push((g.textContent||"").trim());const q=[...t.querySelectorAll("a.au-page[aria-disabled]")];return e.pages=r,e.hrefs=s,e.hrefsNavigation=a,e.rootClasses=t.className.trim().split(" "),e.disabled=q.length===o.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:i&&(e.isNextDisabled=!1),t.querySelector("a.au-first[aria-disabled]")?e.isFirstDisabled=!0:d&&(e.isFirstDisabled=!1),t.querySelector("a.au-last[aria-disabled]")?e.isLastDisabled=!0:h&&(e.isLastDisabled=!1),e})}}const y={rootComponent:".au-rating",star:".au-rating-star"};class T extends l.BasePO{selectors=structuredClone(y);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 o=[...t.querySelectorAll(e.star)],r=[],s=[];for(const a of o)r.push((a.textContent||"").trim()),s.push(a.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:r,classes:s}},this.selectors)}}const C={rootComponent:".au-select"};class L extends l.BasePO{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=>{const e=t.querySelector('div[role="combobox"]'),o=t.querySelector('input[type="text"]'),r=[];if(e){const u=e.querySelectorAll("div.au-select-badge");for(const i of u)r.push(i?.textContent?.trim())}const s=t.querySelector("ul.dropdown-menu"),a=s!=null,n=[],d=[];if(s!=null){const u=s.querySelectorAll("li.dropdown-item");for(const i of u){const h=i.textContent?.trim();n.push(h),i.classList.contains("selected")&&d.push(h)}}return{text:o.value,badges:r,isOpen:a,list:n,checked:d}})}}const S={rootComponent:".alert",body:".alert-body",closeButton:".btn-close"};class V extends l.BasePO{selectors=structuredClone(S);getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.body)?.innerText?.replace(/[^\x20-\x7E]/g,""),r=t.querySelector(e.closeButton)?.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:o,closeButton:r}},this.selectors)}}class I extends l.BasePO{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")],o=[];for(const r of e){const s=r.querySelector(".accordion-collapse"),a=r.querySelector(".accordion-button");o.push({classes:r.className.trim().split(" "),id:r.id,isInDOM:s!==null,bodyContainerId:s?.id,buttonId:a?.id,expanded:a?.getAttribute("aria-expanded"),disabled:a?.getAttribute("aria-disabled"),labeledBy:s?.getAttribute("aria-labelledby"),buttonControls:a?.getAttribute("aria-controls")})}return{rootClasses:t.className.trim().split(" "),items:o}})}}const x={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class H extends l.BasePO{selectors=structuredClone(x);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=>{const e=t.querySelector(".progress-bar"),o=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:e?.textContent?.trim(),innerClasses:e?.className?.trim()?.split(" ")?.sort()??[],outerHeight:o?.style?.height,innerWidth:e?.style?.width}})}}const B={rootComponent:".au-slider",clickableArea:".au-slider-clickable-area",clickableAreaVertical:".au-slider-clickable-area-vertical",handle:".au-slider-handle",tick:".au-slider-tick",tickLabel:".au-slider-tick-label",tickLabelVertical:".au-slider-tick-label-vertical",tickLabelNow:".au-slider-tick-label-now",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",content:".au-slider-content"};class M extends l.BasePO{selectors=structuredClone(B);getComponentSelector(){return this.selectors.rootComponent}get clickableArea(){return this.locatorRoot.locator(this.selectors.clickableArea)}get clickableAreaVertical(){return this.locatorRoot.locator(this.selectors.clickableAreaVertical)}get locatorHandle(){return this.locatorRoot.locator(this.selectors.handle)}get locatorTick(){return this.locatorRoot.locator(this.selectors.tick)}get locatorTickLabel(){return this.locatorRoot.locator(this.selectors.tickLabel)}get locatorTickLabelNow(){return this.locatorRoot.locator(this.selectors.tickLabelNow)}get locatorTickLabelVertical(){return this.locatorRoot.locator(this.selectors.tickLabelVertical)}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)}get locatorContent(){return this.locatorRoot.locator(this.selectors.content)}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")))}async sliderTickLabelState(t){return t.evaluateAll(e=>e.map(o=>({style:o.getAttribute("style"),innerText:o.innerText})))}}const b={rootComponent:".toast",closeButton:".btn-close",header:".toast-header",body:".toast-body"};class A extends l.BasePO{selectors=structuredClone(b);getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return await this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.body)?.innerText,r=t.querySelector(e.header)?.innerText,s=t.querySelector(e.closeButton)?.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:o,header:r,closeButton:s}},this.selectors)}}const R={rootComponent:".au-toaster",container:".au-toaster-container",closeButton:".au-toaster-closeAll"};class E extends l.BasePO{selectors=structuredClone(R);getComponentSelector(){return this.selectors.rootComponent}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}async toastPOs(){return Array.from({length:await this.locatorContainer.locator(b.rootComponent).count()},(t,e)=>new A(this.locatorContainer,e))}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}const P={rootComponent:'[role="tree"]',itemContainer:'[role="treeitem"]',itemToggle:".au-tree-expand-icon",itemContents:".au-tree-item"};class z extends l.BasePO{selectors=structuredClone(P);getComponentSelector(){return this.selectors.rootComponent}get locatorItemToggle(){return this.locatorRoot.locator(this.selectors.itemToggle)}get locatorItemContainer(){return this.locatorRoot.locator(this.selectors.itemContents)}async itemContainerState(){return this.locatorRoot.locator(this.selectors.itemContainer).evaluateAll(t=>t.map(e=>({ariaSelected:e.getAttribute("aria-selected"),ariaExpanded:e.getAttribute("aria-expanded")})))}async itemToggleState(){return this.locatorRoot.locator(this.selectors.itemToggle).evaluateAll(t=>t.map(e=>({ariaLabel:e.getAttribute("aria-label")})))}}const v={rootComponent:".au-collapse"};class D extends l.BasePO{selectors=structuredClone(v);getComponentSelector(){return this.selectors.rootComponent}async state(){return this.locatorRoot.evaluate((t,e)=>({rootClasses:t.className.trim().split(" ").sort()}),this.selectors)}}const f={rootComponent:".au-carousel",container:".au-carousel-container",slide:".au-carousel-slide",nextBtn:".carousel-control-next",prevBtn:".carousel-control-prev",indicators:".carousel-indicators",indicatorBtn:".carousel-indicators button"};class F extends l.BasePO{selectors=structuredClone(f);getComponentSelector(){return this.selectors.rootComponent}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}get locatorNextBtn(){return this.locatorRoot.locator(this.selectors.nextBtn)}get locatorPrevBtn(){return this.locatorRoot.locator(this.selectors.prevBtn)}get locatorIndicators(){return this.locatorRoot.locator(this.selectors.indicators)}get locatorIndicatorBtn(){return this.locatorRoot.locator(this.selectors.indicatorBtn)}get locatorSlide(){return this.locatorRoot.locator(this.selectors.slide)}async state(){return this.locatorRoot.evaluate(t=>{const e=t.querySelectorAll(".carousel-indicators button");return{rootClasses:t.className.trim().split(" ").sort(),prevBtn:t.querySelector(".carousel-control-prev")!==null,nextBtn:t.querySelector(".carousel-control-next")!==null,indicators:{selected:[...e].findIndex(o=>o.classList.contains("active")),count:e.length},slides:{visible:[...t.querySelectorAll(".au-carousel-slide")].findIndex(o=>{const r=o.getBoundingClientRect(),s=t.getBoundingClientRect();return r.left>=s.left&&r.right<=s.right})}}})}}const O={rootComponent:".au-drawer",backdrop:"xpath=./preceding-sibling::div[contains(@class,'au-drawer-backdrop')]",header:".au-drawer-header",body:".au-drawer-body",container:".au-drawer-container",splitter:".au-splitter",closeButton:"Close"};class _ extends l.BasePO{selectors=structuredClone(O);getComponentSelector(){return this.selectors.rootComponent}get locatorHeader(){return this.locatorRoot.locator(this.selectors.header)}get locatorBody(){return this.locatorRoot.locator(this.selectors.body)}get locatorBackdrop(){return this.locatorRoot.locator(this.selectors.backdrop)}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}get locatorSplitter(){return this.locatorRoot.locator(this.selectors.splitter)}get locatorCloseButton(){return this._page.getByRole("button",{name:"Close"})}async hoverOnSplitter(){const t=this.locatorSplitter,e=await t.boundingBox(),o=Math.round(e.width/2),r=Math.round(e.height/2);return await t.hover({position:{x:o,y:r}}),{x:e.x+o,y:e.y+r}}async state(){return this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.header)?.innerText?.trim(),r=t.querySelector(e.body)?.innerText?.trim();return{rootClasses:t.className.trim().split(" ").sort(),header:o,body:r}},this.selectors)}async statePosition(){return this.locatorRoot.evaluate(t=>{const e=t.style;return{"--bs-drawer-size":e.getPropertyValue("--bs-drawer-size"),"--bs-drawer-size-min":e.getPropertyValue("--bs-drawer-size-min"),"--bs-drawer-size-max":e.getPropertyValue("--bs-drawer-size-max")}})}}exports.AccordionPO=I;exports.AlertPO=V;exports.CarouselPO=F;exports.CollapsePO=D;exports.DrawerPO=_;exports.ModalPO=w;exports.PaginationPO=k;exports.ProgressbarPO=H;exports.RatingPO=T;exports.SelectPO=L;exports.SliderPO=M;exports.ToastPO=A;exports.ToasterPO=E;exports.TreePO=z;exports.alertSelectors=S;exports.carouselSelectors=f;exports.collapseSelectors=v;exports.drawerSelectors=O;exports.modalSelectors=m;exports.paginationSelectors=p;exports.progressbarSelectors=x;exports.ratingSelectors=y;exports.selectSelectors=C;exports.sliderSelectors=B;exports.toastSelectors=b;exports.toasterSelectors=R;exports.treeSelectors=P;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@agnos-ui/base-po"),m={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 k extends l.BasePO{selectors=structuredClone(m);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((t,e)=>{const o=t.querySelector(e.closeButton)?.getAttribute("aria-label"),r=t.querySelector(e.header)?.innerText?.trim(),a=t.querySelector(e.title)?.innerText?.trim(),s=t.querySelector(e.body)?.innerText?.trim(),i=t.querySelector(e.footer)?.innerText?.trim();return{rootClasses:t.className.trim().split(" ").sort(),header:r,title:a,body:s,footer:i,closeButton:o}},this.selectors)}}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 q extends l.BasePO{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)}async state(){return this.locatorRoot.evaluate(t=>{const e={rootClasses:[],disabled:null,pages:[],hrefs:[]},o=[...t.querySelectorAll(".au-page")],r=[],a=[],s={},i=n=>n?.getAttribute("href"),u=t.querySelector("a.au-first"),d=t.querySelector("a.au-previous"),h=t.querySelector("a.au-next"),g=t.querySelector("a.au-last");u&&(s.first=i(u)),d&&(s.previous=i(d)),h&&(s.next=i(h)),g&&(s.last=i(g));for(const n of o)a.push(n.getAttribute("href")||""),r.push((n.textContent||"").trim());const O=[...t.querySelectorAll("a.au-page[aria-disabled]")];return e.pages=r,e.hrefs=a,e.hrefsNavigation=s,e.rootClasses=t.className.trim().split(" "),e.disabled=O.length===o.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:h&&(e.isNextDisabled=!1),t.querySelector("a.au-first[aria-disabled]")?e.isFirstDisabled=!0:u&&(e.isFirstDisabled=!1),t.querySelector("a.au-last[aria-disabled]")?e.isLastDisabled=!0:g&&(e.isLastDisabled=!1),e})}}const y={rootComponent:".au-rating",star:".au-rating-star"};class w extends l.BasePO{selectors=structuredClone(y);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 o=[...t.querySelectorAll(e.star)],r=[],a=[];for(const s of o)r.push((s.textContent||"").trim()),a.push(s.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:r,classes:a}},this.selectors)}}const C={rootComponent:".alert",body:".alert-body",closeButton:".btn-close"};class L extends l.BasePO{selectors=structuredClone(C);getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.body)?.innerText?.replace(/[^\x20-\x7E]/g,""),r=t.querySelector(e.closeButton)?.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:o,closeButton:r}},this.selectors)}}class T extends l.BasePO{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")],o=[];for(const r of e){const a=r.querySelector(".accordion-collapse"),s=r.querySelector(".accordion-button");o.push({classes:r.className.trim().split(" "),id:r.id,isInDOM:a!==null,bodyContainerId:a?.id,buttonId:s?.id,expanded:s?.getAttribute("aria-expanded"),disabled:s?.getAttribute("aria-disabled"),labeledBy:a?.getAttribute("aria-labelledby"),buttonControls:s?.getAttribute("aria-controls")})}return{rootClasses:t.className.trim().split(" "),items:o}})}}const S={rootComponent:'[role="progressbar"]',outerBar:".progress",innerBar:".progress-bar"};class V extends l.BasePO{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=>{const e=t.querySelector(".progress-bar"),o=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:e?.textContent?.trim(),innerClasses:e?.className?.trim()?.split(" ")?.sort()??[],outerHeight:o?.style?.height,innerWidth:e?.style?.width}})}}const x={rootComponent:".au-slider",clickableArea:".au-slider-clickable-area",clickableAreaVertical:".au-slider-clickable-area-vertical",handle:".au-slider-handle",tick:".au-slider-tick",tickLabel:".au-slider-tick-label",tickLabelVertical:".au-slider-tick-label-vertical",tickLabelNow:".au-slider-tick-label-now",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",content:".au-slider-content"};class H extends l.BasePO{selectors=structuredClone(x);getComponentSelector(){return this.selectors.rootComponent}get clickableArea(){return this.locatorRoot.locator(this.selectors.clickableArea)}get clickableAreaVertical(){return this.locatorRoot.locator(this.selectors.clickableAreaVertical)}get locatorHandle(){return this.locatorRoot.locator(this.selectors.handle)}get locatorTick(){return this.locatorRoot.locator(this.selectors.tick)}get locatorTickLabel(){return this.locatorRoot.locator(this.selectors.tickLabel)}get locatorTickLabelNow(){return this.locatorRoot.locator(this.selectors.tickLabelNow)}get locatorTickLabelVertical(){return this.locatorRoot.locator(this.selectors.tickLabelVertical)}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)}get locatorContent(){return this.locatorRoot.locator(this.selectors.content)}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")))}async sliderTickLabelState(t){return t.evaluateAll(e=>e.map(o=>({style:o.getAttribute("style"),innerText:o.innerText})))}}const b={rootComponent:".toast",closeButton:".btn-close",header:".toast-header",body:".toast-body"};class A extends l.BasePO{selectors=structuredClone(b);getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}async state(){return await this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.body)?.innerText,r=t.querySelector(e.header)?.innerText,a=t.querySelector(e.closeButton)?.getAttribute("aria-label");return{rootClasses:t.className.trim().split(" ").sort(),body:o,header:r,closeButton:a}},this.selectors)}}const B={rootComponent:".au-toaster",container:".au-toaster-container",closeButton:".au-toaster-closeAll"};class I extends l.BasePO{selectors=structuredClone(B);getComponentSelector(){return this.selectors.rootComponent}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}async toastPOs(){return Array.from({length:await this.locatorContainer.locator(b.rootComponent).count()},(t,e)=>new A(this.locatorContainer,e))}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}const R={rootComponent:'[role="tree"]',itemContainer:'[role="treeitem"]',itemToggle:".au-tree-expand-icon",itemContents:".au-tree-item"};class z extends l.BasePO{selectors=structuredClone(R);getComponentSelector(){return this.selectors.rootComponent}get locatorItemToggle(){return this.locatorRoot.locator(this.selectors.itemToggle)}get locatorItemContainer(){return this.locatorRoot.locator(this.selectors.itemContents)}async itemContainerState(){return this.locatorRoot.locator(this.selectors.itemContainer).evaluateAll(t=>t.map(e=>({ariaSelected:e.getAttribute("aria-selected"),ariaExpanded:e.getAttribute("aria-expanded")})))}async itemToggleState(){return this.locatorRoot.locator(this.selectors.itemToggle).evaluateAll(t=>t.map(e=>({ariaLabel:e.getAttribute("aria-label")})))}}const P={rootComponent:".au-collapse"};class D extends l.BasePO{selectors=structuredClone(P);getComponentSelector(){return this.selectors.rootComponent}async state(){return this.locatorRoot.evaluate((t,e)=>({rootClasses:t.className.trim().split(" ").sort()}),this.selectors)}}const v={rootComponent:".au-carousel",container:".au-carousel-container",slide:".au-carousel-slide",nextBtn:".carousel-control-next",prevBtn:".carousel-control-prev",indicators:".carousel-indicators",indicatorBtn:".carousel-indicators button"};class M extends l.BasePO{selectors=structuredClone(v);getComponentSelector(){return this.selectors.rootComponent}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}get locatorNextBtn(){return this.locatorRoot.locator(this.selectors.nextBtn)}get locatorPrevBtn(){return this.locatorRoot.locator(this.selectors.prevBtn)}get locatorIndicators(){return this.locatorRoot.locator(this.selectors.indicators)}get locatorIndicatorBtn(){return this.locatorRoot.locator(this.selectors.indicatorBtn)}get locatorSlide(){return this.locatorRoot.locator(this.selectors.slide)}async state(){return this.locatorRoot.evaluate(t=>{const e=t.querySelectorAll(".carousel-indicators button");return{rootClasses:t.className.trim().split(" ").sort(),prevBtn:t.querySelector(".carousel-control-prev")!==null,nextBtn:t.querySelector(".carousel-control-next")!==null,indicators:{selected:[...e].findIndex(o=>o.classList.contains("active")),count:e.length},slides:{visible:[...t.querySelectorAll(".au-carousel-slide")].findIndex(o=>{const r=o.getBoundingClientRect(),a=t.getBoundingClientRect();return r.left>=a.left&&r.right<=a.right})}}})}}const f={rootComponent:".au-drawer",backdrop:"xpath=./preceding-sibling::div[contains(@class,'au-drawer-backdrop')]",header:".au-drawer-header",body:".au-drawer-body",container:".au-drawer-container",splitter:".au-splitter",closeButton:"Close"};class E extends l.BasePO{selectors=structuredClone(f);getComponentSelector(){return this.selectors.rootComponent}get locatorHeader(){return this.locatorRoot.locator(this.selectors.header)}get locatorBody(){return this.locatorRoot.locator(this.selectors.body)}get locatorBackdrop(){return this.locatorRoot.locator(this.selectors.backdrop)}get locatorContainer(){return this.locatorRoot.locator(this.selectors.container)}get locatorSplitter(){return this.locatorRoot.locator(this.selectors.splitter)}get locatorCloseButton(){return this._page.getByRole("button",{name:"Close"})}async hoverOnSplitter(){const t=this.locatorSplitter,e=await t.boundingBox(),o=Math.round(e.width/2),r=Math.round(e.height/2);return await t.hover({position:{x:o,y:r}}),{x:e.x+o,y:e.y+r}}async state(){return this.locatorRoot.evaluate((t,e)=>{const o=t.querySelector(e.header)?.innerText?.trim(),r=t.querySelector(e.body)?.innerText?.trim();return{rootClasses:t.className.trim().split(" ").sort(),header:o,body:r}},this.selectors)}async statePosition(){return this.locatorRoot.evaluate(t=>{const e=t.style;return{"--bs-drawer-size":e.getPropertyValue("--bs-drawer-size"),"--bs-drawer-size-min":e.getPropertyValue("--bs-drawer-size-min"),"--bs-drawer-size-max":e.getPropertyValue("--bs-drawer-size-max")}})}}exports.AccordionPO=T;exports.AlertPO=L;exports.CarouselPO=M;exports.CollapsePO=D;exports.DrawerPO=E;exports.ModalPO=k;exports.PaginationPO=q;exports.ProgressbarPO=V;exports.RatingPO=w;exports.SliderPO=H;exports.ToastPO=A;exports.ToasterPO=I;exports.TreePO=z;exports.alertSelectors=C;exports.carouselSelectors=v;exports.collapseSelectors=P;exports.drawerSelectors=f;exports.modalSelectors=m;exports.paginationSelectors=p;exports.progressbarSelectors=S;exports.ratingSelectors=y;exports.sliderSelectors=x;exports.toastSelectors=b;exports.toasterSelectors=B;exports.treeSelectors=R;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -34,13 +34,13 @@ class L extends l {
|
|
|
34
34
|
}
|
|
35
35
|
async state() {
|
|
36
36
|
return this.locatorRoot.evaluate((t, e) => {
|
|
37
|
-
const o = t.querySelector(e.closeButton)?.getAttribute("aria-label"), r = t.querySelector(e.header)?.innerText?.trim(), a = t.querySelector(e.title)?.innerText?.trim(), s = t.querySelector(e.body)?.innerText?.trim(),
|
|
37
|
+
const o = t.querySelector(e.closeButton)?.getAttribute("aria-label"), r = t.querySelector(e.header)?.innerText?.trim(), a = t.querySelector(e.title)?.innerText?.trim(), s = t.querySelector(e.body)?.innerText?.trim(), i = t.querySelector(e.footer)?.innerText?.trim();
|
|
38
38
|
return {
|
|
39
39
|
rootClasses: t.className.trim().split(" ").sort(),
|
|
40
40
|
header: r,
|
|
41
41
|
title: a,
|
|
42
42
|
body: s,
|
|
43
|
-
footer:
|
|
43
|
+
footer: i,
|
|
44
44
|
closeButton: o
|
|
45
45
|
};
|
|
46
46
|
}, this.selectors);
|
|
@@ -56,7 +56,7 @@ const y = {
|
|
|
56
56
|
pages: ".au-page",
|
|
57
57
|
ellipses: ".au-ellipsis"
|
|
58
58
|
};
|
|
59
|
-
class
|
|
59
|
+
class w extends l {
|
|
60
60
|
selectors = structuredClone(y);
|
|
61
61
|
// TODO should we add this in the list of selector ?
|
|
62
62
|
// Depend on the setSelectors usage...
|
|
@@ -118,12 +118,12 @@ class T extends l {
|
|
|
118
118
|
}
|
|
119
119
|
async state() {
|
|
120
120
|
return this.locatorRoot.evaluate((t) => {
|
|
121
|
-
const e = { rootClasses: [], disabled: null, pages: [], hrefs: [] }, o = [...t.querySelectorAll(".au-page")], r = [], a = [], s = {},
|
|
122
|
-
|
|
123
|
-
for (const
|
|
124
|
-
a.push(
|
|
121
|
+
const e = { rootClasses: [], disabled: null, pages: [], hrefs: [] }, o = [...t.querySelectorAll(".au-page")], r = [], a = [], s = {}, i = (n) => n?.getAttribute("href"), u = t.querySelector("a.au-first"), d = t.querySelector("a.au-previous"), h = t.querySelector("a.au-next"), g = t.querySelector("a.au-last");
|
|
122
|
+
u && (s.first = i(u)), d && (s.previous = i(d)), h && (s.next = i(h)), g && (s.last = i(g));
|
|
123
|
+
for (const n of o)
|
|
124
|
+
a.push(n.getAttribute("href") || ""), r.push((n.textContent || "").trim());
|
|
125
125
|
const m = [...t.querySelectorAll("a.au-page[aria-disabled]")];
|
|
126
|
-
return e.pages = r, e.hrefs = a, e.hrefsNavigation = s, e.rootClasses = t.className.trim().split(" "), e.disabled = m.length === o.length ? "true" : null, t.querySelector("a.au-previous[aria-disabled]") ? e.isPreviousDisabled = !0 :
|
|
126
|
+
return e.pages = r, e.hrefs = a, e.hrefsNavigation = s, e.rootClasses = t.className.trim().split(" "), e.disabled = m.length === o.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 : h && (e.isNextDisabled = !1), t.querySelector("a.au-first[aria-disabled]") ? e.isFirstDisabled = !0 : u && (e.isFirstDisabled = !1), t.querySelector("a.au-last[aria-disabled]") ? e.isLastDisabled = !0 : g && (e.isLastDisabled = !1), e;
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -131,7 +131,7 @@ const C = {
|
|
|
131
131
|
rootComponent: ".au-rating",
|
|
132
132
|
star: ".au-rating-star"
|
|
133
133
|
};
|
|
134
|
-
class
|
|
134
|
+
class T extends l {
|
|
135
135
|
selectors = structuredClone(C);
|
|
136
136
|
getComponentSelector() {
|
|
137
137
|
return this.selectors.rootComponent;
|
|
@@ -162,83 +162,12 @@ class V extends l {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
const x = {
|
|
165
|
-
rootComponent: ".au-select"
|
|
166
|
-
// TODO add selector list
|
|
167
|
-
};
|
|
168
|
-
class I extends l {
|
|
169
|
-
selectors = structuredClone(x);
|
|
170
|
-
getComponentSelector() {
|
|
171
|
-
return this.selectors.rootComponent;
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Get the main title locator of the feature page
|
|
175
|
-
*/
|
|
176
|
-
get locatorInput() {
|
|
177
|
-
return this.locatorRoot.locator('input[type="text"]').nth(0);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Menu container
|
|
181
|
-
*/
|
|
182
|
-
get locatorMenu() {
|
|
183
|
-
return this.locatorRoot.locator(".dropdown-menu");
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Return the first menu item locator including the text
|
|
187
|
-
*/
|
|
188
|
-
get locatorMenuItems() {
|
|
189
|
-
return this.locatorMenu.locator(".au-select-item");
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Return the first menu item locator including the text
|
|
193
|
-
*/
|
|
194
|
-
locatorMenuItem(t) {
|
|
195
|
-
return this.locatorMenu.getByText(t).nth(0);
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Bages container
|
|
199
|
-
*/
|
|
200
|
-
get locatorBadges() {
|
|
201
|
-
return this.locatorRoot.locator("div.au-select-badge");
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Return the first badge locator including the text
|
|
205
|
-
*/
|
|
206
|
-
locatorBadgeItem(t) {
|
|
207
|
-
return this.locatorBadges.filter({ hasText: t }).nth(0);
|
|
208
|
-
}
|
|
209
|
-
async state() {
|
|
210
|
-
return await this.locatorRoot.evaluate((t) => {
|
|
211
|
-
const e = t.querySelector('div[role="combobox"]'), o = t.querySelector('input[type="text"]'), r = [];
|
|
212
|
-
if (e) {
|
|
213
|
-
const u = e.querySelectorAll("div.au-select-badge");
|
|
214
|
-
for (const i of u)
|
|
215
|
-
r.push(i?.textContent?.trim());
|
|
216
|
-
}
|
|
217
|
-
const a = t.querySelector("ul.dropdown-menu"), s = a != null, n = [], d = [];
|
|
218
|
-
if (a != null) {
|
|
219
|
-
const u = a.querySelectorAll("li.dropdown-item");
|
|
220
|
-
for (const i of u) {
|
|
221
|
-
const h = i.textContent?.trim();
|
|
222
|
-
n.push(h), i.classList.contains("selected") && d.push(h);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return {
|
|
226
|
-
text: o.value,
|
|
227
|
-
badges: r,
|
|
228
|
-
isOpen: s,
|
|
229
|
-
list: n,
|
|
230
|
-
checked: d
|
|
231
|
-
};
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const S = {
|
|
236
165
|
rootComponent: ".alert",
|
|
237
166
|
body: ".alert-body",
|
|
238
167
|
closeButton: ".btn-close"
|
|
239
168
|
};
|
|
240
|
-
class
|
|
241
|
-
selectors = structuredClone(
|
|
169
|
+
class V extends l {
|
|
170
|
+
selectors = structuredClone(x);
|
|
242
171
|
getComponentSelector() {
|
|
243
172
|
return this.selectors.rootComponent;
|
|
244
173
|
}
|
|
@@ -256,7 +185,7 @@ class O extends l {
|
|
|
256
185
|
}, this.selectors);
|
|
257
186
|
}
|
|
258
187
|
}
|
|
259
|
-
class
|
|
188
|
+
class O extends l {
|
|
260
189
|
selectors = {
|
|
261
190
|
item: ".accordion-item",
|
|
262
191
|
bodyContainer: ".accordion-collapse",
|
|
@@ -338,7 +267,7 @@ const A = {
|
|
|
338
267
|
outerBar: ".progress",
|
|
339
268
|
innerBar: ".progress-bar"
|
|
340
269
|
};
|
|
341
|
-
class
|
|
270
|
+
class H extends l {
|
|
342
271
|
selectors = structuredClone(A);
|
|
343
272
|
getComponentSelector() {
|
|
344
273
|
return this.selectors.rootComponent;
|
|
@@ -383,7 +312,7 @@ const R = {
|
|
|
383
312
|
progress: ".au-slider-progress",
|
|
384
313
|
content: ".au-slider-content"
|
|
385
314
|
};
|
|
386
|
-
class
|
|
315
|
+
class I extends l {
|
|
387
316
|
selectors = structuredClone(R);
|
|
388
317
|
getComponentSelector() {
|
|
389
318
|
return this.selectors.rootComponent;
|
|
@@ -463,7 +392,7 @@ const b = {
|
|
|
463
392
|
header: ".toast-header",
|
|
464
393
|
body: ".toast-body"
|
|
465
394
|
};
|
|
466
|
-
class
|
|
395
|
+
class S extends l {
|
|
467
396
|
selectors = structuredClone(b);
|
|
468
397
|
getComponentSelector() {
|
|
469
398
|
return this.selectors.rootComponent;
|
|
@@ -483,13 +412,13 @@ class v extends l {
|
|
|
483
412
|
}, this.selectors);
|
|
484
413
|
}
|
|
485
414
|
}
|
|
486
|
-
const
|
|
415
|
+
const v = {
|
|
487
416
|
rootComponent: ".au-toaster",
|
|
488
417
|
container: ".au-toaster-container",
|
|
489
418
|
closeButton: ".au-toaster-closeAll"
|
|
490
419
|
};
|
|
491
420
|
class z extends l {
|
|
492
|
-
selectors = structuredClone(
|
|
421
|
+
selectors = structuredClone(v);
|
|
493
422
|
getComponentSelector() {
|
|
494
423
|
return this.selectors.rootComponent;
|
|
495
424
|
}
|
|
@@ -499,21 +428,21 @@ class z extends l {
|
|
|
499
428
|
async toastPOs() {
|
|
500
429
|
return Array.from(
|
|
501
430
|
{ length: await this.locatorContainer.locator(b.rootComponent).count() },
|
|
502
|
-
(t, e) => new
|
|
431
|
+
(t, e) => new S(this.locatorContainer, e)
|
|
503
432
|
);
|
|
504
433
|
}
|
|
505
434
|
get locatorCloseButton() {
|
|
506
435
|
return this.locatorRoot.locator(this.selectors.closeButton);
|
|
507
436
|
}
|
|
508
437
|
}
|
|
509
|
-
const
|
|
438
|
+
const B = {
|
|
510
439
|
rootComponent: '[role="tree"]',
|
|
511
440
|
itemContainer: '[role="treeitem"]',
|
|
512
441
|
itemToggle: ".au-tree-expand-icon",
|
|
513
442
|
itemContents: ".au-tree-item"
|
|
514
443
|
};
|
|
515
444
|
class D extends l {
|
|
516
|
-
selectors = structuredClone(
|
|
445
|
+
selectors = structuredClone(B);
|
|
517
446
|
getComponentSelector() {
|
|
518
447
|
return this.selectors.rootComponent;
|
|
519
448
|
}
|
|
@@ -535,11 +464,11 @@ class D extends l {
|
|
|
535
464
|
})));
|
|
536
465
|
}
|
|
537
466
|
}
|
|
538
|
-
const
|
|
467
|
+
const f = {
|
|
539
468
|
rootComponent: ".au-collapse"
|
|
540
469
|
};
|
|
541
|
-
class
|
|
542
|
-
selectors = structuredClone(
|
|
470
|
+
class E extends l {
|
|
471
|
+
selectors = structuredClone(f);
|
|
543
472
|
getComponentSelector() {
|
|
544
473
|
return this.selectors.rootComponent;
|
|
545
474
|
}
|
|
@@ -549,7 +478,7 @@ class F extends l {
|
|
|
549
478
|
}), this.selectors);
|
|
550
479
|
}
|
|
551
480
|
}
|
|
552
|
-
const
|
|
481
|
+
const P = {
|
|
553
482
|
rootComponent: ".au-carousel",
|
|
554
483
|
container: ".au-carousel-container",
|
|
555
484
|
slide: ".au-carousel-slide",
|
|
@@ -558,8 +487,8 @@ const q = {
|
|
|
558
487
|
indicators: ".carousel-indicators",
|
|
559
488
|
indicatorBtn: ".carousel-indicators button"
|
|
560
489
|
};
|
|
561
|
-
class
|
|
562
|
-
selectors = structuredClone(
|
|
490
|
+
class M extends l {
|
|
491
|
+
selectors = structuredClone(P);
|
|
563
492
|
getComponentSelector() {
|
|
564
493
|
return this.selectors.rootComponent;
|
|
565
494
|
}
|
|
@@ -602,7 +531,7 @@ class _ extends l {
|
|
|
602
531
|
});
|
|
603
532
|
}
|
|
604
533
|
}
|
|
605
|
-
const
|
|
534
|
+
const k = {
|
|
606
535
|
rootComponent: ".au-drawer",
|
|
607
536
|
backdrop: "xpath=./preceding-sibling::div[contains(@class,'au-drawer-backdrop')]",
|
|
608
537
|
header: ".au-drawer-header",
|
|
@@ -611,8 +540,8 @@ const w = {
|
|
|
611
540
|
splitter: ".au-splitter",
|
|
612
541
|
closeButton: "Close"
|
|
613
542
|
};
|
|
614
|
-
class
|
|
615
|
-
selectors = structuredClone(
|
|
543
|
+
class F extends l {
|
|
544
|
+
selectors = structuredClone(k);
|
|
616
545
|
getComponentSelector() {
|
|
617
546
|
return this.selectors.rootComponent;
|
|
618
547
|
}
|
|
@@ -674,31 +603,29 @@ class W extends l {
|
|
|
674
603
|
}
|
|
675
604
|
}
|
|
676
605
|
export {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
606
|
+
O as AccordionPO,
|
|
607
|
+
V as AlertPO,
|
|
608
|
+
M as CarouselPO,
|
|
609
|
+
E as CollapsePO,
|
|
610
|
+
F as DrawerPO,
|
|
682
611
|
L as ModalPO,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
I as
|
|
687
|
-
|
|
688
|
-
v as ToastPO,
|
|
612
|
+
w as PaginationPO,
|
|
613
|
+
H as ProgressbarPO,
|
|
614
|
+
T as RatingPO,
|
|
615
|
+
I as SliderPO,
|
|
616
|
+
S as ToastPO,
|
|
689
617
|
z as ToasterPO,
|
|
690
618
|
D as TreePO,
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
619
|
+
x as alertSelectors,
|
|
620
|
+
P as carouselSelectors,
|
|
621
|
+
f as collapseSelectors,
|
|
622
|
+
k as drawerSelectors,
|
|
695
623
|
p as modalSelectors,
|
|
696
624
|
y as paginationSelectors,
|
|
697
625
|
A as progressbarSelectors,
|
|
698
626
|
C as ratingSelectors,
|
|
699
|
-
x as selectSelectors,
|
|
700
627
|
R as sliderSelectors,
|
|
701
628
|
b as toastSelectors,
|
|
702
|
-
|
|
703
|
-
|
|
629
|
+
v as toasterSelectors,
|
|
630
|
+
B as treeSelectors
|
|
704
631
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"e2e",
|
|
7
7
|
"page-object",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"module": "./index.js",
|
|
28
28
|
"types": "./index.d.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@agnos-ui/base-po": "0.
|
|
30
|
+
"@agnos-ui/base-po": "0.11.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@playwright/test": "^1.49.0"
|
package/select.po.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { BasePO } from '@agnos-ui/base-po';
|
|
2
|
-
export declare const selectSelectors: {
|
|
3
|
-
rootComponent: string;
|
|
4
|
-
};
|
|
5
|
-
export declare class SelectPO extends BasePO {
|
|
6
|
-
selectors: {
|
|
7
|
-
rootComponent: string;
|
|
8
|
-
};
|
|
9
|
-
getComponentSelector(): string;
|
|
10
|
-
/**
|
|
11
|
-
* Get the main title locator of the feature page
|
|
12
|
-
*/
|
|
13
|
-
get locatorInput(): import("playwright-core").Locator;
|
|
14
|
-
/**
|
|
15
|
-
* Menu container
|
|
16
|
-
*/
|
|
17
|
-
get locatorMenu(): import("playwright-core").Locator;
|
|
18
|
-
/**
|
|
19
|
-
* Return the first menu item locator including the text
|
|
20
|
-
*/
|
|
21
|
-
get locatorMenuItems(): import("playwright-core").Locator;
|
|
22
|
-
/**
|
|
23
|
-
* Return the first menu item locator including the text
|
|
24
|
-
*/
|
|
25
|
-
locatorMenuItem(text: string): import("playwright-core").Locator;
|
|
26
|
-
/**
|
|
27
|
-
* Bages container
|
|
28
|
-
*/
|
|
29
|
-
get locatorBadges(): import("playwright-core").Locator;
|
|
30
|
-
/**
|
|
31
|
-
* Return the first badge locator including the text
|
|
32
|
-
*/
|
|
33
|
-
locatorBadgeItem(text: string): import("playwright-core").Locator;
|
|
34
|
-
state(): Promise<{
|
|
35
|
-
text: string;
|
|
36
|
-
badges: string[];
|
|
37
|
-
isOpen: boolean;
|
|
38
|
-
list: (string | undefined)[];
|
|
39
|
-
checked: (string | undefined)[];
|
|
40
|
-
}>;
|
|
41
|
-
}
|