@thinkwise/testwise 0.2.62 → 0.2.67
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/components/filter/ExcelStyleFilterPopup.ts +50 -10
- package/components/filter/ExcelStyleFilterPopupObjects.ts +29 -3
- package/components/grid/Grid.ts +33 -14
- package/components/grid/GridObjects.ts +0 -15
- package/controls/DateControl.ts +8 -9
- package/controls/DateControlObjects.ts +15 -0
- package/controls/FormComboBox.ts +12 -25
- package/controls/FormComboBoxObjects.ts +27 -0
- package/controls/GridColumnControl.ts +1 -1
- package/controls/GridColumnControlObjects.ts +1 -1
- package/controls/InputFieldControl.ts +11 -14
- package/controls/InputFieldControlObjects.ts +19 -0
- package/controls/LookupDropdown.ts +29 -30
- package/controls/LookupDropdownObjects.ts +19 -0
- package/dist/components/filter/ExcelStyleFilterPopup.d.ts +11 -1
- package/dist/components/filter/ExcelStyleFilterPopup.js +47 -5
- package/dist/components/filter/ExcelStyleFilterPopup.js.map +1 -1
- package/dist/components/filter/ExcelStyleFilterPopupObjects.d.ts +7 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js +14 -1
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js.map +1 -1
- package/dist/components/grid/Grid.d.ts +3 -1
- package/dist/components/grid/Grid.js +18 -25
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/grid/GridObjects.d.ts +0 -4
- package/dist/components/grid/GridObjects.js +0 -6
- package/dist/components/grid/GridObjects.js.map +1 -1
- package/dist/controls/DateControl.d.ts +1 -2
- package/dist/controls/DateControl.js +7 -7
- package/dist/controls/DateControl.js.map +1 -1
- package/dist/controls/DateControlObjects.d.ts +8 -1
- package/dist/controls/DateControlObjects.js +8 -1
- package/dist/controls/DateControlObjects.js.map +1 -1
- package/dist/controls/FormComboBox.js +11 -16
- package/dist/controls/FormComboBox.js.map +1 -1
- package/dist/controls/FormComboBoxObjects.d.ts +12 -1
- package/dist/controls/FormComboBoxObjects.js +15 -1
- package/dist/controls/FormComboBoxObjects.js.map +1 -1
- package/dist/controls/GridColumnControl.js +1 -1
- package/dist/controls/GridColumnControl.js.map +1 -1
- package/dist/controls/GridColumnControlObjects.js +1 -1
- package/dist/controls/GridColumnControlObjects.js.map +1 -1
- package/dist/controls/InputFieldControl.d.ts +1 -3
- package/dist/controls/InputFieldControl.js +10 -11
- package/dist/controls/InputFieldControl.js.map +1 -1
- package/dist/controls/InputFieldControlObjects.d.ts +10 -1
- package/dist/controls/InputFieldControlObjects.js +10 -1
- package/dist/controls/InputFieldControlObjects.js.map +1 -1
- package/dist/controls/LookupDropdown.js +28 -25
- package/dist/controls/LookupDropdown.js.map +1 -1
- package/dist/controls/LookupDropdownObjects.d.ts +10 -0
- package/dist/controls/LookupDropdownObjects.js +11 -0
- package/dist/controls/LookupDropdownObjects.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
export declare class InputFieldControlObjects {
|
|
3
|
+
private _context;
|
|
4
|
+
private _id;
|
|
5
|
+
constructor(context: Locator, id: string);
|
|
6
|
+
formField: () => Locator;
|
|
7
|
+
fieldInput: () => Locator;
|
|
8
|
+
fieldLabel: () => Locator;
|
|
9
|
+
validationMessage: () => Locator;
|
|
10
|
+
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export class InputFieldControlObjects {
|
|
2
|
+
constructor(context, id) {
|
|
3
|
+
this.formField = () => this._context.getByTestId(`form-field__${this._id}`);
|
|
4
|
+
this.fieldInput = () => this.formField().locator('input');
|
|
5
|
+
this.fieldLabel = () => this.formField().getByTestId(`form-field__${this._id}__label`);
|
|
6
|
+
this.validationMessage = () => this.formField().locator('.TooltipContainer p');
|
|
7
|
+
this._context = context;
|
|
8
|
+
this._id = id;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
2
11
|
//# sourceMappingURL=InputFieldControlObjects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputFieldControlObjects.js","sourceRoot":"","sources":["../../controls/InputFieldControlObjects.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"InputFieldControlObjects.js","sourceRoot":"","sources":["../../controls/InputFieldControlObjects.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,wBAAwB;IAInC,YAAY,OAAgB,EAAE,EAAU;QAKjC,cAAS,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,eAAe,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhF,eAAU,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9D,eAAU,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,eAAe,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAE3F,sBAAiB,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAVxF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;CASF"}
|
|
@@ -1,67 +1,70 @@
|
|
|
1
1
|
import { escapeRegex } from '../helpers/RegexHelper.js';
|
|
2
|
+
import { LookupDropdownObjects } from './LookupDropdownObjects.js';
|
|
2
3
|
class LookupDropdown {
|
|
3
4
|
constructor(context, id) {
|
|
4
|
-
this.
|
|
5
|
-
this._formFieldLocator = context.getByTestId(`form-field__${this._id}`);
|
|
6
|
-
this._inputLocator = this._formFieldLocator.locator('input');
|
|
5
|
+
this._objects = new LookupDropdownObjects(context, id);
|
|
7
6
|
}
|
|
8
7
|
async getLabelText() {
|
|
9
|
-
let returnText = (await this.
|
|
8
|
+
let returnText = (await this._objects.label().textContent()) || '';
|
|
10
9
|
returnText = returnText.replace(/\s+/g, ' ').trim();
|
|
11
10
|
return returnText;
|
|
12
11
|
}
|
|
13
12
|
async lookupSelect(optionToSelect) {
|
|
14
|
-
await this.
|
|
13
|
+
await this._objects.input().fill(optionToSelect);
|
|
15
14
|
await this.select(optionToSelect);
|
|
16
15
|
}
|
|
17
16
|
async inputValue() {
|
|
18
|
-
return await this.
|
|
17
|
+
return await this._objects.input().inputValue();
|
|
19
18
|
}
|
|
20
19
|
async clear() {
|
|
21
|
-
await this.
|
|
20
|
+
await this._objects.input().fill('');
|
|
22
21
|
}
|
|
23
22
|
async selectOption(optionText) {
|
|
24
|
-
await this.
|
|
23
|
+
await this._objects.input().click();
|
|
25
24
|
await this.select(optionText);
|
|
26
25
|
}
|
|
27
26
|
async getValidationMessage() {
|
|
28
|
-
await this.
|
|
29
|
-
return await this.
|
|
27
|
+
await this._objects.validationMessage().waitFor({ state: 'visible' });
|
|
28
|
+
return await this._objects.validationMessage().innerText();
|
|
30
29
|
}
|
|
31
30
|
async fill(value) {
|
|
32
31
|
await Promise.all([
|
|
33
|
-
this.
|
|
32
|
+
this._objects
|
|
33
|
+
.input()
|
|
34
34
|
.page()
|
|
35
35
|
.waitForResponse((response) => response.url().includes('/list_') && response.request().method() === 'GET'),
|
|
36
|
-
this.
|
|
36
|
+
this._objects.input().click()
|
|
37
37
|
]);
|
|
38
38
|
await Promise.all([
|
|
39
|
-
this.
|
|
39
|
+
this._objects
|
|
40
|
+
.input()
|
|
40
41
|
.page()
|
|
41
42
|
.waitForResponse((response) => response.url().includes('/list_') && response.request().method() === 'GET'),
|
|
42
|
-
this.
|
|
43
|
+
this._objects.input().fill(value)
|
|
43
44
|
]);
|
|
44
45
|
}
|
|
45
46
|
async select(optionToSelect) {
|
|
46
47
|
const optionsToSelectRegex = new RegExp(`^${escapeRegex(optionToSelect)}$`, 'i');
|
|
47
|
-
await this.
|
|
48
|
-
await this.
|
|
48
|
+
await this._objects.input().page().getByTestId('autocomplete__menu').getByText(optionsToSelectRegex).click();
|
|
49
|
+
await this._objects
|
|
50
|
+
.input()
|
|
49
51
|
.page()
|
|
50
|
-
.waitForFunction((el) => document.activeElement === el, await this.
|
|
52
|
+
.waitForFunction((el) => document.activeElement === el, await this._objects.input().elementHandle());
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
export function createLookupDropdown(context, id) {
|
|
54
56
|
const dropdown = new LookupDropdown(context, id);
|
|
55
|
-
|
|
57
|
+
const customProps = new Set(Object.getOwnPropertyNames(LookupDropdown.prototype).filter((p) => p !== 'constructor'));
|
|
58
|
+
return new Proxy(context, {
|
|
56
59
|
get(target, prop, receiver) {
|
|
57
|
-
if (prop
|
|
58
|
-
|
|
60
|
+
if (customProps.has(prop)) {
|
|
61
|
+
const value = dropdown[prop];
|
|
62
|
+
if (typeof value === 'function') {
|
|
63
|
+
return value.bind(dropdown);
|
|
64
|
+
}
|
|
65
|
+
return value;
|
|
59
66
|
}
|
|
60
|
-
|
|
61
|
-
if (typeof value === 'function') {
|
|
62
|
-
return value.bind(dropdown);
|
|
63
|
-
}
|
|
64
|
-
return value;
|
|
67
|
+
return Reflect.get(target, prop, receiver);
|
|
65
68
|
}
|
|
66
69
|
});
|
|
67
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookupDropdown.js","sourceRoot":"","sources":["../../controls/LookupDropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"LookupDropdown.js","sourceRoot":"","sources":["../../controls/LookupDropdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAcnE,MAAM,cAAc;IAGlB,YAAY,OAAgB,EAAE,EAAU;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,qBAAqB,CAAC,OAAO,EAAE,EAAE,CA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AAC,OAAgB,EAAE,EAAU;IAC/D,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,CAAC;IAErH,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;QACxB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;YACxB,IAAI,WAAW,CAAC,GAAG,CAAC,IAAc,CAAC,EAAE,CAAC;gBACpC,MAAM,KAAK,GAAI,QAAgB,CAAC,IAAI,CAAC,CAAC;gBACtC,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;oBAChC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC9B,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;KACF,CAA+B,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
export declare class LookupDropdownObjects {
|
|
3
|
+
private _id;
|
|
4
|
+
private _context;
|
|
5
|
+
constructor(context: Locator, id: string);
|
|
6
|
+
formField: () => Locator;
|
|
7
|
+
label: () => Locator;
|
|
8
|
+
input: () => Locator;
|
|
9
|
+
validationMessage: () => Locator;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class LookupDropdownObjects {
|
|
2
|
+
constructor(context, id) {
|
|
3
|
+
this.formField = () => this._context.getByTestId(`form-field__${this._id}`);
|
|
4
|
+
this.label = () => this.formField().getByTestId(`form-field__${this._id}__label`);
|
|
5
|
+
this.input = () => this.formField().locator('input');
|
|
6
|
+
this.validationMessage = () => this.formField().locator('.TooltipContainer p');
|
|
7
|
+
this._context = context;
|
|
8
|
+
this._id = id;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=LookupDropdownObjects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LookupDropdownObjects.js","sourceRoot":"","sources":["../../controls/LookupDropdownObjects.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,qBAAqB;IAIhC,YAAY,OAAgB,EAAE,EAAU;QAKjC,cAAS,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,eAAe,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAEhF,UAAK,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,WAAW,CAAC,eAAe,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QAEtF,UAAK,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAEzD,sBAAiB,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAVxF,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAChB,CAAC;CASF"}
|