@agnos-ui/page-objects 0.0.1-alpha.0 → 0.0.1-alpha.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 +7 -7
- package/dist/lib/index.js +1 -1
- package/dist/lib/index.mjs +15 -16
- package/package.json +2 -2
- package/dist/lib/tsdoc-metadata.json +0 -11
package/dist/lib/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare class AlertPO extends BasePO {
|
|
|
52
52
|
closeButton: string;
|
|
53
53
|
};
|
|
54
54
|
getComponentSelector(): string;
|
|
55
|
-
locatorCloseButton(): Locator;
|
|
55
|
+
get locatorCloseButton(): Locator;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export declare const alertSelectors: {
|
|
@@ -71,12 +71,12 @@ export declare class ModalPO extends BasePO {
|
|
|
71
71
|
footer: string;
|
|
72
72
|
};
|
|
73
73
|
getComponentSelector(): string;
|
|
74
|
-
locatorHeader(): Locator;
|
|
75
|
-
locatorTitle(): Locator;
|
|
76
|
-
locatorBody(): Locator;
|
|
77
|
-
locatorFooter(): Locator;
|
|
78
|
-
locatorCloseButton(): Locator;
|
|
79
|
-
locatorBackdrop(): Locator;
|
|
74
|
+
get locatorHeader(): Locator;
|
|
75
|
+
get locatorTitle(): Locator;
|
|
76
|
+
get locatorBody(): Locator;
|
|
77
|
+
get locatorFooter(): Locator;
|
|
78
|
+
get locatorCloseButton(): Locator;
|
|
79
|
+
get locatorBackdrop(): Locator;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export declare const modalSelectors: {
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var x=Object.defineProperty;var R=(s,e,t)=>e in s?x(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(R(s,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@agnos-ui/base-po"),A={rootComponent:".modal",closeButton:".btn-close",backdrop:"xpath=./preceding-sibling::div[contains(@class,'modal-backdrop')]",header:".modal-header",title:".modal-title",body:".modal-body",footer:".modal-footer"};class v extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(A))}getComponentSelector(){return this.selectors.rootComponent}locatorHeader(){return this.locatorRoot.locator(this.selectors.header)}locatorTitle(){return this.locatorHeader
|
|
1
|
+
"use strict";var x=Object.defineProperty;var R=(s,e,t)=>e in s?x(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>(R(s,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@agnos-ui/base-po"),A={rootComponent:".modal",closeButton:".btn-close",backdrop:"xpath=./preceding-sibling::div[contains(@class,'modal-backdrop')]",header:".modal-header",title:".modal-title",body:".modal-body",footer:".modal-footer"};class v extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(A))}getComponentSelector(){return this.selectors.rootComponent}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 C={rootComponent:".au-pagination",activePage:".active",previousPage:".au-previous",nextPage:".au-next",firstPage:".au-first",lastPage:".au-last",pages:".au-page",ellipses:".au-ellipsis"};class f extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(C))}getComponentSelector(){return this.selectors.rootComponent}get locatorActivePage(){return this.locatorRoot.locator(this.selectors.activePage)}get locatorPreviousButton(){return this.locatorRoot.locator(this.selectors.previousPage)}get locatorNextButton(){return this.locatorRoot.locator(this.selectors.nextPage)}get locatorFirstButton(){return this.locatorRoot.locator(this.selectors.firstPage)}get locatorLastButton(){return this.locatorRoot.locator(this.selectors.lastPage)}get locatorPages(){return this.locatorRoot.locator(this.selectors.pages)}locatorNthPage(t){return this.locatorRoot.locator(this.selectors.pages).nth(t-1)}locatorPage(t){return this.locatorRoot.locator(this.selectors.pages,{hasText:t})}get locatorEllipses(){return this.locatorRoot.locator(this.selectors.ellipses)}}const P={rootComponent:".au-rating",star:".au-rating-star"};class O extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(P))}getComponentSelector(){return this.selectors.rootComponent}locatorStar(t){return this.locatorRoot.locator(this.selectors.star).nth(t)}async state(){return await this.locatorRoot.evaluate((t,i)=>{const c=[...t.querySelectorAll(i.star)],a=[],r=[];for(const o of c)a.push((o.textContent||"").trim()),r.push(o.className.split(" "));return{rootClasses:t.className.trim().split(" "),value:t.getAttribute("aria-valuenow"),min:t.getAttribute("aria-valuemin"),max:t.getAttribute("aria-valuemax"),text:t.getAttribute("aria-valuetext"),disabled:t.getAttribute("aria-disabled"),readonly:t.getAttribute("aria-readonly"),stars:a,classes:r}},this.selectors)}}const S={rootComponent:".au-select"};class I extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(S))}getComponentSelector(){return this.selectors.rootComponent}get locatorInput(){return this.locatorRoot.locator("div.input-group").locator("input")}get locatorMenu(){return this.locatorRoot.locator(".dropdown-menu")}locatorMenuItem(t){return this.locatorMenu.getByText(t).nth(0)}get locatorBadges(){return this.locatorRoot.locator("div.input-group").locator(".input-group-text")}locatorBadgeItem(t){return this.locatorBadges.locator("div.badge").filter({hasText:t}).nth(0)}locatorBadgeItemCross(t){return this.locatorBadgeItem(t).getByRole("button")}async state(){return await this.locatorRoot.evaluate(t=>{var m;const i=t.querySelector(".input-group"),c=t.querySelector("div.input-group-text"),a=i.querySelector("input"),r=[];if(c){const g=c.querySelectorAll("div.badge");for(const u of g){const d=[...u.children];r.push([...d.map(h=>(h.textContent??"").trim())])}}const o=t.querySelector("ul.dropdown-menu"),B=o!=null,p=[];if(o!=null){const g=o.querySelectorAll("li.dropdown-item");for(const u of g){let d=!1,h=!1;const b=u.querySelector("input.form-check-input");b&&(d=!0,h=b.checked),p.push({text:(m=u.textContent)==null?void 0:m.trim(),hasCheckBox:d,isChecked:h})}}return{text:a.value,badges:r,isOpen:B,list:p}})}}const y={rootComponent:".alert",closeButton:".btn-close"};class q extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",structuredClone(y))}getComponentSelector(){return this.selectors.rootComponent}get locatorCloseButton(){return this.locatorRoot.locator(this.selectors.closeButton)}}class k extends n.BasePO{constructor(){super(...arguments);l(this,"selectors",{item:".accordion-item",collapse:".accordion-collapse",body:".accordion-body",header:".accordion-header",buttons:".accordion-button"})}getComponentSelector(){return".accordion"}get locatorAccordionItems(){return this.locatorRoot.locator(this.selectors.item)}locatorAccordionItem(t){return this.locatorRoot.locator(this.selectors.item).nth(t)}get locatorAccordionCollapses(){return this.locatorAccordionItems.locator(this.selectors.collapse)}locatorAccordionCollapse(t){return this.locatorAccordionItem(t).locator(this.selectors.collapse)}get locatorAccordionBodies(){return this.locatorAccordionCollapses.locator(this.selectors.body)}locatorAccordionBody(t){return this.locatorAccordionCollapse(t).locator(this.selectors.body)}get locatorAccordionHeaders(){return this.locatorAccordionItems.locator(this.selectors.header)}locatorAccordionHeader(t){return this.locatorAccordionItem(t).locator(this.selectors.header)}get locatorAccordionButtons(){return this.locatorAccordionHeaders.locator(this.selectors.buttons)}locatorAccordionButton(t){return this.locatorAccordionHeader(t).locator(this.selectors.buttons)}async state(){return await this.locatorRoot.evaluate(t=>{const i=[...t.querySelectorAll(".accordion-item")],c=[];for(const a of i){const r=a.querySelector(".accordion-collapse"),o=a.querySelector(".accordion-button");c.push({classes:a.className.trim().split(" "),id:a.id,isInDOM:r!==null,collapseId:r==null?void 0:r.id,buttonId:o==null?void 0:o.id,expanded:o==null?void 0:o.getAttribute("aria-expanded"),disabled:o==null?void 0:o.getAttribute("aria-disabled"),labeledBy:r==null?void 0:r.getAttribute("aria-labelledby"),buttonControls:o==null?void 0:o.getAttribute("aria-controls")})}return{rootClasses:t.className.trim().split(" "),items:c}})}}exports.AccordionPO=k;exports.AlertPO=q;exports.ModalPO=v;exports.PaginationPO=f;exports.RatingPO=O;exports.SelectPO=I;exports.alertSelectors=y;exports.modalSelectors=A;exports.paginationSelectors=C;exports.ratingSelectors=P;exports.selectSelectors=S;
|
package/dist/lib/index.mjs
CHANGED
|
@@ -20,23 +20,22 @@ class I extends n {
|
|
|
20
20
|
getComponentSelector() {
|
|
21
21
|
return this.selectors.rootComponent;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
locatorHeader() {
|
|
23
|
+
get locatorHeader() {
|
|
25
24
|
return this.locatorRoot.locator(this.selectors.header);
|
|
26
25
|
}
|
|
27
|
-
locatorTitle() {
|
|
28
|
-
return this.locatorHeader
|
|
26
|
+
get locatorTitle() {
|
|
27
|
+
return this.locatorHeader.locator(this.selectors.title);
|
|
29
28
|
}
|
|
30
|
-
locatorBody() {
|
|
29
|
+
get locatorBody() {
|
|
31
30
|
return this.locatorRoot.locator(this.selectors.body);
|
|
32
31
|
}
|
|
33
|
-
locatorFooter() {
|
|
32
|
+
get locatorFooter() {
|
|
34
33
|
return this.locatorRoot.locator(this.selectors.footer);
|
|
35
34
|
}
|
|
36
|
-
locatorCloseButton() {
|
|
35
|
+
get locatorCloseButton() {
|
|
37
36
|
return this.locatorRoot.locator(this.selectors.closeButton);
|
|
38
37
|
}
|
|
39
|
-
locatorBackdrop() {
|
|
38
|
+
get locatorBackdrop() {
|
|
40
39
|
return this.locatorRoot.locator(this.selectors.backdrop);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
@@ -208,19 +207,19 @@ class O extends n {
|
|
|
208
207
|
var m;
|
|
209
208
|
const i = t.querySelector(".input-group"), a = t.querySelector("div.input-group-text"), c = i.querySelector("input"), r = [];
|
|
210
209
|
if (a) {
|
|
211
|
-
const
|
|
212
|
-
for (const u of
|
|
210
|
+
const g = a.querySelectorAll("div.badge");
|
|
211
|
+
for (const u of g) {
|
|
213
212
|
const d = [...u.children];
|
|
214
213
|
r.push([...d.map((h) => (h.textContent ?? "").trim())]);
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
const o = t.querySelector("ul.dropdown-menu"), C = o != null,
|
|
216
|
+
const o = t.querySelector("ul.dropdown-menu"), C = o != null, p = [];
|
|
218
217
|
if (o != null) {
|
|
219
|
-
const
|
|
220
|
-
for (const u of
|
|
218
|
+
const g = o.querySelectorAll("li.dropdown-item");
|
|
219
|
+
for (const u of g) {
|
|
221
220
|
let d = !1, h = !1;
|
|
222
221
|
const b = u.querySelector("input.form-check-input");
|
|
223
|
-
b && (d = !0, h = b.checked),
|
|
222
|
+
b && (d = !0, h = b.checked), p.push({
|
|
224
223
|
text: (m = u.textContent) == null ? void 0 : m.trim(),
|
|
225
224
|
hasCheckBox: d,
|
|
226
225
|
isChecked: h
|
|
@@ -231,7 +230,7 @@ class O extends n {
|
|
|
231
230
|
text: c.value,
|
|
232
231
|
badges: r,
|
|
233
232
|
isOpen: C,
|
|
234
|
-
list:
|
|
233
|
+
list: p
|
|
235
234
|
};
|
|
236
235
|
});
|
|
237
236
|
}
|
|
@@ -248,7 +247,7 @@ class w extends n {
|
|
|
248
247
|
getComponentSelector() {
|
|
249
248
|
return this.selectors.rootComponent;
|
|
250
249
|
}
|
|
251
|
-
locatorCloseButton() {
|
|
250
|
+
get locatorCloseButton() {
|
|
252
251
|
return this.locatorRoot.locator(this.selectors.closeButton);
|
|
253
252
|
}
|
|
254
253
|
}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build:api-extractor": "api-extractor run"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agnos-ui/base-po": "0.0.1-alpha.
|
|
23
|
+
"@agnos-ui/base-po": "0.0.1-alpha.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@playwright/test": "*"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"url": "https://github.com/AmadeusITGroup/AgnosUI.git",
|
|
36
36
|
"directory": "page-objects"
|
|
37
37
|
},
|
|
38
|
-
"version": "0.0.1-alpha.
|
|
38
|
+
"version": "0.0.1-alpha.1"
|
|
39
39
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.36.4"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|