@axinom/mosaic-e2e-ui-selectors 0.15.0-rc.6 → 0.15.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/dist/component-model.d.ts +2 -0
- package/dist/component-model.d.ts.map +1 -1
- package/dist/component-model.js +4 -0
- package/dist/component-model.js.map +1 -1
- package/dist/component-models/dynamic-data-list.d.ts +5 -0
- package/dist/component-models/dynamic-data-list.d.ts.map +1 -1
- package/dist/component-models/dynamic-data-list.js +13 -0
- package/dist/component-models/dynamic-data-list.js.map +1 -1
- package/dist/component-models/form/select-field.d.ts +2 -0
- package/dist/component-models/form/select-field.d.ts.map +1 -1
- package/dist/component-models/form/select-field.js +4 -0
- package/dist/component-models/form/select-field.js.map +1 -1
- package/dist/component-models/form/tags-field.d.ts +4 -0
- package/dist/component-models/form/tags-field.d.ts.map +1 -1
- package/dist/component-models/form/tags-field.js +10 -2
- package/dist/component-models/form/tags-field.js.map +1 -1
- package/package.json +2 -2
- package/src/component-model.ts +5 -0
- package/src/component-models/dynamic-data-list.ts +20 -0
- package/src/component-models/form/select-field.ts +7 -0
- package/src/component-models/form/tags-field.ts +15 -2
|
@@ -53,6 +53,8 @@ export declare class ComponentModel {
|
|
|
53
53
|
* @param nth Optional position among matches. Position is 1 indexed. Negative numbers count from the end.
|
|
54
54
|
*/
|
|
55
55
|
getChildOfType<TModel extends ComponentModel>(model: ComponentModelType<TModel>, xpath?: string, nth?: number): TModel;
|
|
56
|
+
/** A helper method to create global locators - This helps with locating globally across the entire DOM, rather than being scoped to the form */
|
|
57
|
+
protected getGlobalLocator(selector: string): Locator;
|
|
56
58
|
}
|
|
57
59
|
export {};
|
|
58
60
|
//# sourceMappingURL=component-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-model.d.ts","sourceRoot":"","sources":["../src/component-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI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B;;;;;OAKG;gBAED,MAAM,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,EAC5C,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,MAAM;IAgBd,qFAAqF;IACrF,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,CAAC;IAEpC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,yFAAyF;IACzF,UAAU,IAAI,OAAO;IACrB;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;IAWhD;;;;;;OAMG;IACH,cAAc,CAAC,MAAM,SAAS,cAAc,EAC1C,KAAK,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACjC,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,GACX,MAAM;IAIT,gJAAgJ;IAChJ,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGtD"}
|
package/dist/component-model.js
CHANGED
|
@@ -64,6 +64,10 @@ class ComponentModel {
|
|
|
64
64
|
getChildOfType(model, xpath, nth) {
|
|
65
65
|
return new model(this, xpath, nth);
|
|
66
66
|
}
|
|
67
|
+
/** A helper method to create global locators - This helps with locating globally across the entire DOM, rather than being scoped to the form */
|
|
68
|
+
getGlobalLocator(selector) {
|
|
69
|
+
return this.root.locator(selector);
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
exports.ComponentModel = ComponentModel;
|
|
69
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-model.js","sourceRoot":"","sources":["../src/component-model.ts"],"names":[],"mappings":";;;AAWA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,cAAc;IACzB;;;;;OAKG;IACH,YACE,MAA4C,EAC5C,KAAa,EACb,GAAY;QAEZ,2EAA2E;QAC3E,IAAI,MAAM,YAAY,cAAc,EAAE;YACpC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AAC,IAAI,CAAC;KAC3D;IACD,OAAO,IAAI,KAAK,KAAK,QAAQ,GAAG,CAAC;AACnC,CAAC"}
|
|
@@ -9,6 +9,8 @@ export declare class DynamicDataEntryCell extends ComponentModel {
|
|
|
9
9
|
readonly input: Locator;
|
|
10
10
|
/** A locator to a select element (dropdown). */
|
|
11
11
|
readonly select: Locator;
|
|
12
|
+
/** A locator to a combobox element (autocorrect dropdown from MUI). */
|
|
13
|
+
readonly combobox: Locator;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* A model for a list row cell.
|
|
@@ -36,6 +38,9 @@ export declare class DynamicListDataEntry extends ComponentModel {
|
|
|
36
38
|
* property on the form component mod*e*l for a mod*a*l opened in this way.
|
|
37
39
|
*/
|
|
38
40
|
readonly addButton: Locator;
|
|
41
|
+
readonly combobox: Locator;
|
|
42
|
+
protected readonly option: (value: string) => Locator;
|
|
43
|
+
setDdlOption(ddlProp: string, value: string): Promise<void>;
|
|
39
44
|
getCell(position: number): DynamicDataEntryCell;
|
|
40
45
|
getCellByPropertyName(name: string): DynamicDataEntryCell;
|
|
41
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-data-list.d.ts","sourceRoot":"","sources":["../../src/component-models/dynamic-data-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,cAAc;IACtD,kDAAkD;IAClD,QAAQ,CAAC,KAAK,UAA8B;IAE5C,gDAAgD;IAChD,QAAQ,CAAC,MAAM,UAA+B;
|
|
1
|
+
{"version":3,"file":"dynamic-data-list.d.ts","sourceRoot":"","sources":["../../src/component-models/dynamic-data-list.ts"],"names":[],"mappings":"AAAA,O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AC,QAAQ,EAAE,MAAM,GAAG,eAAe;IAS1C,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe;CAMrD;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD;;;;OAIG;gBAED,MAAM,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,EAC5C,KAAK,SAA2C;IAKlD,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,oBAGb;IAEF,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,uBAGnB;IAEF,iEAAiE;IACjE,QAAQ,CAAC,cAAc,UAErB;IAEF,8GAA8G;IAC9G,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;IAQxC;;;;OAIG;IACH,qBAAqB,CACnB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,GAAG,CAAC,EAAE,MAAM,GACX,cAAc;IASjB;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAKnC"}
|
|
@@ -13,6 +13,8 @@ class DynamicDataEntryCell extends component_model_1.ComponentModel {
|
|
|
13
13
|
this.input = this.getLocator('//input');
|
|
14
14
|
/** A locator to a select element (dropdown). */
|
|
15
15
|
this.select = this.getLocator('//select');
|
|
16
|
+
/** A locator to a combobox element (autocorrect dropdown from MUI). */
|
|
17
|
+
this.combobox = this.getLocator('//input[@role="combobox"]');
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
exports.DynamicDataEntryCell = DynamicDataEntryCell;
|
|
@@ -59,6 +61,17 @@ class DynamicListDataEntry extends component_model_1.ComponentModel {
|
|
|
59
61
|
* property on the form component mod*e*l for a mod*a*l opened in this way.
|
|
60
62
|
*/
|
|
61
63
|
this.addButton = this.getLocator('//*[@data-test-id="dynamic-list-add-button"]');
|
|
64
|
+
this.combobox = this.getLocator('//input[@role="combobox"]');
|
|
65
|
+
this.option = (value) => this.getGlobalLocator(`//li[@role="option" and normalize-space(text())="${value}"]`);
|
|
66
|
+
}
|
|
67
|
+
async setDdlOption(ddlProp, value) {
|
|
68
|
+
// sanity check
|
|
69
|
+
await this.getCellByPropertyName(ddlProp).combobox.click();
|
|
70
|
+
await this.combobox.type(value);
|
|
71
|
+
await this.combobox.waitFor({ state: 'visible' });
|
|
72
|
+
const optionElement = this.option(value);
|
|
73
|
+
await optionElement.waitFor({ state: 'visible' });
|
|
74
|
+
await optionElement.click();
|
|
62
75
|
}
|
|
63
76
|
/* This method finds a data entry cell in a row by position. Position is 1 indexed. Negative numbers count from the end. */
|
|
64
77
|
getCell(position) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-data-list.js","sourceRoot":"","sources":["../../src/component-models/dynamic-data-list.ts"],"names":[],"mappings":";;;AACA,wDAAoD;AACpD,+CAA2C;AAE3C;;GAEG;AACH,MAAa,oBAAqB,SAAQ,gCAAc;IAAxD;;QACE,kDAAkD;QACzC,UAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAE5C,gDAAgD;QACvC,WAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamic-data-list.js","sourceRoot":"","sources":["../../src/component-models/dynamic-data-list.ts"],"names":[],"mappings":";;;AACA,wDAAoD;AACpD,+CAA2C;AAE3C;;GAEG;AACH,MAAa,oBAAqB,SAAQ,gCAAc;IAAxD;;QACE,kDAAkD;QACzC,UAAK,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAE5C,gDAAgD;QACvC,WAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAE9C,uEAAuE;QAC9D,aAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IACnE,CAAC;CAAA;AATD,oDASC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,gCAAc;IAAnD;;QACE,qDAAqD;QAC5C,YAAO,GAAG,IAAI,CAAC,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IAAI,oBAAoB,CAC9C,IAAI,EACJ,8CAA8C,CAC/C,CAAC;QAEF,iEAAiE;QACxD,mBAAc,GAAG,IAAI,CAAC,UAAU,CACvC,uCAAuC,CACxC,CAAC;IAjBF,CAAC;IAmBD,8GAA8G;IAC9G,MAAM,CAAC,QAAgB;QACrB,OAAO,IAAI,cAAc,CACvB,IAAI,EACJ,uCAAuC,EACvC,QAAQ,CACT,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CACnB,YAAoB,EACpB,aAAqB,EACrB,GAAY;QAEZ,MAAM,WAAW,GAAG,4CAA4C,YAAY,kBAAkB,aAAa,uBAAuB,aAAa,MAAM,CAAC;QACtJ,OAAO,IAAI,cAAc,CACvB,IAAI,EACJ,6CAA6C,WAAW,GAAG,EAC3D,GAAG,CACJ,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,UAAU,CACnB,yGAAyG,CAC1G,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjC,CAAC;CACF;AAlED,0CAkEC"}
|
|
@@ -21,5 +21,7 @@ export declare class SelectField extends TypedFormField {
|
|
|
21
21
|
setValueByLabel(label: string): Promise<void>;
|
|
22
22
|
/** This method verifies the field type and returns the selected value. */
|
|
23
23
|
getValue(): Promise<string | null>;
|
|
24
|
+
/** This method waits for those inputs that take time to appear. */
|
|
25
|
+
waitForData(value: string): Promise<void>;
|
|
24
26
|
}
|
|
25
27
|
//# sourceMappingURL=select-field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-field.d.ts","sourceRoot":"","sources":["../../../src/component-models/form/select-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,qBAAa,WAAY,SAAQ,cAAc;I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,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAMxC,mEAAmE;IAC7D,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKhD"}
|
|
@@ -50,6 +50,10 @@ class SelectField extends form_field_1.TypedFormField {
|
|
|
50
50
|
await this.verifyFieldType();
|
|
51
51
|
return await this.input.inputValue();
|
|
52
52
|
}
|
|
53
|
+
/** This method waits for those inputs that take time to appear. */
|
|
54
|
+
async waitForData(value) {
|
|
55
|
+
await this.getLocator(`//input[@id="${value}" and normalize-space(@value)!=""]`).waitFor({ state: 'attached' });
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
58
|
exports.SelectField = SelectField;
|
|
55
59
|
//# sourceMappingURL=select-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-field.js","sourceRoot":"","sources":["../../../src/component-models/form/select-field.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAE9C;;GAEG;AACH,MAAa,WAAY,SAAQ,2BAAc;IAA/C;;QAMqB,UAAK,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACrD,YAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAE5E,oDAAoD;QACjC,WAAM,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAExD,2DAA2D;QACxC,WAAM,GAAG,CAAC,KAAa,EAAW,EAAE,CACrD,IAAI,CAAC,gBAAgB,CACnB,oDAAoD,KAAK,IAAI,CAC9D,CAAC;
|
|
1
|
+
{"version":3,"file":"select-field.js","sourceRoot":"","sources":["../../../src/component-models/form/select-field.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAE9C;;GAEG;AACH,MAAa,WAAY,SAAQ,2BAAc;IAA/C;;QAMqB,UAAK,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACrD,YAAO,GAAG,IAAI,CAAC,g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aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAClD,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,QAAQ;QACZ,eAAe;QACf,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC;IAED,mEAAmE;IACnE,KAAK,CAAC,WAAW,CAAC,KAAa;QAC7B,MAAM,IAAI,CAAC,UAAU,CACnB,gBAAgB,KAAK,oCAAoC,CAC1D,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IACnC,CAAC;CACF;AA1DD,kCA0DC"}
|
|
@@ -8,6 +8,10 @@ export declare class TagsField extends TypedFormField {
|
|
|
8
8
|
protected get fieldTypeValidator(): string;
|
|
9
9
|
/** A locator to all the applied tags. Useful for getting a count. */
|
|
10
10
|
readonly allTags: Locator;
|
|
11
|
+
protected readonly input: Locator;
|
|
12
|
+
protected readonly listbox: Locator;
|
|
13
|
+
/** A locator to the select an option from the combobox. */
|
|
14
|
+
protected readonly option: (value: string) => Locator;
|
|
11
15
|
/** This method verifies the field type and adds a tag. */
|
|
12
16
|
addTagByLabel(label: string): Promise<void>;
|
|
13
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags-field.d.ts","sourceRoot":"","sources":["../../../src/component-models/form/tags-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,qBAAa,SAAU,SAAQ,cAAc;IAC3C,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED,qEAAqE;IACrE,QAAQ,CAAC,OAAO,UAA+C;IAE/D,0DAA0D;IACpD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tags-field.d.ts","sourceRoot":"","sources":["../../../src/component-models/form/tags-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;;GAEG;AACH,qBAAa,SAAU,SAAQ,cAAc;IAC3C,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED,qEAAqE;IACrE,QAAQ,CAAC,OAAO,UAA+C;IAE/D,SAAS,CAAC,QAAQ,CAAC,KAAK,UAAgD;IACxE,SAAS,CAAC,QAAQ,CAAC,OAAO,UAAkD;IAE5E,2DAA2D;IAC3D,SAAS,CAAC,QAAQ,CAAC,MAAM,UAAW,MAAM,KAAG,OAAO,CAGhD;IAEJ,0DAA0D;IACpD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcjD;;;OAGG;IACG,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAStD,sGAAsG;IACtG,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIjC,wEAAwE;IACxE,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAKtC"}
|
|
@@ -10,6 +10,10 @@ class TagsField extends form_field_1.TypedFormField {
|
|
|
10
10
|
super(...arguments);
|
|
11
11
|
/** A locator to all the applied tags. Useful for getting a count. */
|
|
12
12
|
this.allTags = this.getLocator(`//*[@data-test-id="tag"]`);
|
|
13
|
+
this.input = this.getLocator('//input[@role="combobox"]');
|
|
14
|
+
this.listbox = this.getGlobalLocator('//ul[@role="listbox"]');
|
|
15
|
+
/** A locator to the select an option from the combobox. */
|
|
16
|
+
this.option = (value) => this.getGlobalLocator(`//li[@role="option" and normalize-space(text())="${value}"]`);
|
|
13
17
|
}
|
|
14
18
|
/** @inheritdoc */
|
|
15
19
|
get fieldTypeValidator() {
|
|
@@ -19,8 +23,12 @@ class TagsField extends form_field_1.TypedFormField {
|
|
|
19
23
|
async addTagByLabel(label) {
|
|
20
24
|
// sanity check
|
|
21
25
|
await this.verifyFieldType();
|
|
22
|
-
|
|
23
|
-
await
|
|
26
|
+
await this.input.click();
|
|
27
|
+
await this.input.type(label);
|
|
28
|
+
await this.listbox.waitFor({ state: 'visible' });
|
|
29
|
+
const optionElement = this.option(label);
|
|
30
|
+
await optionElement.waitFor({ state: 'visible' });
|
|
31
|
+
await optionElement.click();
|
|
24
32
|
// wait for tag to be added
|
|
25
33
|
await this.getTagByLabel(label).waitFor({ state: 'visible' });
|
|
26
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags-field.js","sourceRoot":"","sources":["../../../src/component-models/form/tags-field.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAE9C;;GAEG;AACH,MAAa,SAAU,SAAQ,2BAAc;IAA7C;;QAME,qEAAqE;QAC5D,YAAO,GAAG,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"tags-field.js","sourceRoot":"","sources":["../../../src/component-models/form/tags-field.ts"],"names":[],"mappings":";;;AACA,6CAA8C;AAE9C;;GAEG;AACH,MAAa,SAAU,SAAQ,2BAAc;IAA7C;;QAME,qEAAqE;QAC5D,YAAO,GAAG,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;QAE5C,UAAK,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACrD,YAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;QAE5E,2DAA2D;QACxC,WAAM,GAAG,CAAC,KAAa,EAAW,EAAE,CACrD,IAAI,CAAC,gBAAgB,CACnB,oDAAoD,KAAK,IAAI,CAC9D,CAAC;IAyCN,CAAC;IA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ANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-e2e-ui-selectors",
|
|
3
|
-
"version": "0.15.0
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Component models for testing Axinom Mosaic applications with Playwright.",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "c3802f0be74822f25268d4fdf7497a1c1577309d"
|
|
36
36
|
}
|
package/src/component-model.ts
CHANGED
|
@@ -95,6 +95,11 @@ export class ComponentModel {
|
|
|
95
95
|
): TModel {
|
|
96
96
|
return new model(this, xpath, nth);
|
|
97
97
|
}
|
|
98
|
+
|
|
99
|
+
/** A helper method to create global locators - This helps with locating globally across the entire DOM, rather than being scoped to the form */
|
|
100
|
+
protected getGlobalLocator(selector: string): Locator {
|
|
101
|
+
return this.root.locator(selector);
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
104
|
|
|
100
105
|
/**
|
|
@@ -11,6 +11,9 @@ export class DynamicDataEntryCell extends ComponentModel {
|
|
|
11
11
|
|
|
12
12
|
/** A locator to a select element (dropdown). */
|
|
13
13
|
readonly select = this.getLocator('//select');
|
|
14
|
+
|
|
15
|
+
/** A locator to a combobox element (autocorrect dropdown from MUI). */
|
|
16
|
+
readonly combobox = this.getLocator('//input[@role="combobox"]');
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
/**
|
|
@@ -60,6 +63,23 @@ export class DynamicListDataEntry extends ComponentModel {
|
|
|
60
63
|
'//*[@data-test-id="dynamic-list-add-button"]',
|
|
61
64
|
);
|
|
62
65
|
|
|
66
|
+
readonly combobox = this.getLocator('//input[@role="combobox"]');
|
|
67
|
+
|
|
68
|
+
protected readonly option = (value: string): Locator =>
|
|
69
|
+
this.getGlobalLocator(
|
|
70
|
+
`//li[@role="option" and normalize-space(text())="${value}"]`,
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
async setDdlOption(ddlProp: string, value: string): Promise<void> {
|
|
74
|
+
// sanity check
|
|
75
|
+
await this.getCellByPropertyName(ddlProp).combobox.click();
|
|
76
|
+
await this.combobox.type(value);
|
|
77
|
+
await this.combobox.waitFor({ state: 'visible' });
|
|
78
|
+
const optionElement = this.option(value);
|
|
79
|
+
await optionElement.waitFor({ state: 'visible' });
|
|
80
|
+
await optionElement.click();
|
|
81
|
+
}
|
|
82
|
+
|
|
63
83
|
/* This method finds a data entry cell in a row by position. Position is 1 indexed. Negative numbers count from the end. */
|
|
64
84
|
getCell(position: number): DynamicDataEntryCell {
|
|
65
85
|
return new DynamicDataEntryCell(
|
|
@@ -55,4 +55,11 @@ export class SelectField extends TypedFormField {
|
|
|
55
55
|
await this.verifyFieldType();
|
|
56
56
|
return await this.input.inputValue();
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
/** This method waits for those inputs that take time to appear. */
|
|
60
|
+
async waitForData(value: string): Promise<void> {
|
|
61
|
+
await this.getLocator(
|
|
62
|
+
`//input[@id="${value}" and normalize-space(@value)!=""]`,
|
|
63
|
+
).waitFor({ state: 'attached' });
|
|
64
|
+
}
|
|
58
65
|
}
|
|
@@ -13,12 +13,25 @@ export class TagsField extends TypedFormField {
|
|
|
13
13
|
/** A locator to all the applied tags. Useful for getting a count. */
|
|
14
14
|
readonly allTags = this.getLocator(`//*[@data-test-id="tag"]`);
|
|
15
15
|
|
|
16
|
+
protected readonly input = this.getLocator('//input[@role="combobox"]');
|
|
17
|
+
protected readonly listbox = this.getGlobalLocator('//ul[@role="listbox"]');
|
|
18
|
+
|
|
19
|
+
/** A locator to the select an option from the combobox. */
|
|
20
|
+
protected readonly option = (value: string): Locator =>
|
|
21
|
+
this.getGlobalLocator(
|
|
22
|
+
`//li[@role="option" and normalize-space(text())="${value}"]`,
|
|
23
|
+
);
|
|
24
|
+
|
|
16
25
|
/** This method verifies the field type and adds a tag. */
|
|
17
26
|
async addTagByLabel(label: string): Promise<void> {
|
|
18
27
|
// sanity check
|
|
19
28
|
await this.verifyFieldType();
|
|
20
|
-
|
|
21
|
-
await
|
|
29
|
+
await this.input.click();
|
|
30
|
+
await this.input.type(label);
|
|
31
|
+
await this.listbox.waitFor({ state: 'visible' });
|
|
32
|
+
const optionElement = this.option(label);
|
|
33
|
+
await optionElement.waitFor({ state: 'visible' });
|
|
34
|
+
await optionElement.click();
|
|
22
35
|
|
|
23
36
|
// wait for tag to be added
|
|
24
37
|
await this.getTagByLabel(label).waitFor({ state: 'visible' });
|