vasu-playwright-utils 0.3.0 → 0.4.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.
@@ -0,0 +1,170 @@
1
+ /**
2
+ * AssertUtils.ts: This module contains utility functions for assertions in tests.
3
+ * All expect assertions will dynamically wait until either the expect timeout specified in the
4
+ * playwright.config is reached or the condition becomes true.
5
+ * @module AssertUtils
6
+ */
7
+ import { Locator, TestInfo } from '@playwright/test';
8
+ import { ExpectOptions, ExpectTextOptions } from '../types/optional-parameter-types';
9
+ /**
10
+ * Use this function to assert all the soft assertions.
11
+ * @param {TestInfo} testInfo - The TestInfo object containing the test's information.
12
+ */
13
+ export declare function assertAllSoftAssertions(testInfo: TestInfo): void;
14
+ /**
15
+ * 1. Locator Assertions: This section contains functions that perform assertions on specific locators.
16
+ * These functions check for various conditions such as visibility, presence in the DOM, text content, etc.
17
+ */
18
+ /**
19
+ * Asserts that the given element is not present in the DOM or is Hidden.
20
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
21
+ * @param {ExpectOptions} options - The options to pass to the expect function.
22
+ */
23
+ export declare function expectElementToBeHidden(input: string | Locator, options?: ExpectOptions): Promise<void>;
24
+ /**
25
+ * Asserts that the given element is present in the DOM and visible.
26
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
27
+ * @param {ExpectOptions} options - The options to pass to the expect function.
28
+ */
29
+ export declare function expectElementToBeVisible(input: string | Locator, options?: ExpectOptions): Promise<void>;
30
+ /**
31
+ * Asserts that the given element is present in the DOM.
32
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
33
+ * @param {ExpectOptions} options - The options to pass to the expect function.
34
+ */
35
+ export declare function expectElementToBeAttached(input: string | Locator, options?: ExpectOptions): Promise<void>;
36
+ /**
37
+ * Asserts that the given element is present in the DOM and visible in the viewport of the page.
38
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
39
+ * @param {ExpectOptions} options - The options to pass to the expect function.
40
+ */
41
+ export declare function expectElementToBeInViewport(input: string | Locator, options?: ExpectOptions): Promise<void>;
42
+ /**
43
+ * Asserts that the given element is checked.
44
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
45
+ * @param {ExpectOptions} options - The options to pass to the expect function.
46
+ */
47
+ export declare function expectElementToBeChecked(input: string | Locator, options?: ExpectOptions): Promise<void>;
48
+ /**
49
+ * Asserts that the given element is not checked.
50
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
51
+ * @param {ExpectOptions} options - The options to pass to the expect function.
52
+ */
53
+ export declare function expectElementNotToBeChecked(input: string | Locator, options?: ExpectOptions): Promise<void>;
54
+ /**
55
+ * Asserts that the given element is disabled.
56
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
57
+ * @param {ExpectOptions} options - The options to pass to the expect function.
58
+ */
59
+ export declare function expectElementToBeDisabled(input: string | Locator, options?: ExpectOptions): Promise<void>;
60
+ /**
61
+ * Asserts that the given element is enabled.
62
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
63
+ * @param {ExpectOptions} options - The options to pass to the expect function.
64
+ */
65
+ export declare function expectElementToBeEnabled(input: string | Locator, options?: ExpectOptions): Promise<void>;
66
+ /**
67
+ * Asserts that the given element is editable.
68
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
69
+ * @param {ExpectOptions} options - The options to pass to the expect function.
70
+ */
71
+ export declare function expectElementToBeEditable(input: string | Locator, options?: ExpectOptions): Promise<void>;
72
+ /**
73
+ * Asserts that the element equals the provided string or string array or regular expression.
74
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
75
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
76
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
77
+ */
78
+ export declare function expectElementToHaveText(input: string | Locator, text: string | RegExp | Array<string | RegExp>, options?: ExpectOptions & ExpectTextOptions): Promise<void>;
79
+ /**
80
+ * Asserts that the element does not equal the provided string or string array or regular expression.
81
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
82
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
83
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
84
+ */
85
+ export declare function expectElementNotToHaveText(input: string | Locator, text: string | RegExp | Array<string | RegExp>, options?: ExpectOptions & ExpectTextOptions): Promise<void>;
86
+ /**
87
+ * Asserts that the element contains the provided string or string array or regular expression.
88
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
89
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
90
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
91
+ */
92
+ export declare function expectElementToContainText(input: string | Locator, text: string | RegExp | Array<string | RegExp>, options?: ExpectOptions & ExpectTextOptions): Promise<void>;
93
+ /**
94
+ * Asserts that the element does not contain the provided string or string array or regular expression.
95
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
96
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
97
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
98
+ */
99
+ export declare function expectElementNotToContainText(input: string | Locator, text: string | RegExp | Array<string | RegExp>, options?: ExpectOptions & ExpectTextOptions): Promise<void>;
100
+ /**
101
+ * Asserts that the given element points to an input text box with the given text or Regex.
102
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
103
+ * @param {string | RegExp} text - The string or regular expression to match against the element's value.
104
+ * @param {ExpectOptions} options - The options to pass to the expect function.
105
+ */
106
+ export declare function expectElementToHaveValue(input: string | Locator, text: string | RegExp, options?: ExpectOptions): Promise<void>;
107
+ /**
108
+ * Asserts that the given element points to a multi-select/combobox (i.e. a select with the multiple attribute) and the specified values are selected.
109
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
110
+ * @param {Array<string | RegExp>} text - The array of strings or regular expressions to match against the element's values.
111
+ * @param {ExpectOptions} options - The options to pass to the expect function.
112
+ */
113
+ export declare function expectElementToHaveValues(input: string | Locator, text: Array<string | RegExp>, options?: ExpectOptions): Promise<void>;
114
+ /**
115
+ * Asserts that the given element points to an empty editable element or to a DOM node that has no text.
116
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
117
+ * @param {ExpectOptions} options - The options to pass to the expect function.
118
+ */
119
+ export declare function expectElementValueToBeEmpty(input: string | Locator, options?: ExpectOptions): Promise<void>;
120
+ /**
121
+ * Asserts that the given element points to a non-empty editable element or to a DOM node that has text.
122
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
123
+ * @param {ExpectOptions} options - The options to pass to the expect function.
124
+ */
125
+ export declare function expectElementValueNotToBeEmpty(input: string | Locator, options?: ExpectOptions): Promise<void>;
126
+ /**
127
+ * Asserts that an element has an attribute with the given value.
128
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
129
+ * @param {string} attribute - The attribute to check for.
130
+ * @param {string | RegExp} value - The value to match against the attribute.
131
+ * @param {ExpectOptions} options - The options to pass to the expect function.
132
+ */
133
+ export declare function expectElementToHaveAttribute(input: string | Locator, attribute: string, value: string | RegExp, options?: ExpectOptions): Promise<void>;
134
+ /**
135
+ * Asserts that an element has an attribute which contains the given value.
136
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
137
+ * @param {string} attribute - The attribute to check for.
138
+ * @param {string | RegExp} value - The value to match against the attribute.
139
+ * @param {ExpectOptions} options - The options to pass to the expect function.
140
+ */
141
+ export declare function expectElementToContainAttribute(input: string | Locator, attribute: string, value: string | RegExp, options?: ExpectOptions): Promise<void>;
142
+ /**
143
+ * Asserts that the given element has the specified count.
144
+ * @param {string | Locator} input - Either a string (selector) or a Locator object to get the element count.
145
+ * @param {number} count - The count to match against the element's count.
146
+ * @param {ExpectOptions} options - The options to pass to the expect function.
147
+ */
148
+ export declare function expectElementToHaveCount(input: string | Locator, count: number, options?: ExpectOptions): Promise<void>;
149
+ /**
150
+ * 2. Page Assertions: This section contains functions that perform assertions on the entire page.
151
+ * These functions check for conditions such as URL, title, etc.
152
+ */
153
+ /**
154
+ * Asserts that the current page URL matches exactly the provided URL or regular expression.
155
+ * @param {string | RegExp} urlOrRegExp - The URL or regular expression to match against the current page URL.
156
+ */
157
+ export declare function expectPageToHaveURL(urlOrRegExp: string | RegExp, options?: ExpectOptions): Promise<void>;
158
+ /**
159
+ * Asserts that the current page URL contains the provided URL.
160
+ * @param {string } url - The URL to match against the current page URL.
161
+ */
162
+ export declare function expectPageToContainURL(url: string, options?: ExpectOptions): Promise<void>;
163
+ /**
164
+ * This method will be used for future stories validations Asserts that the current page Title
165
+ * matches exactly the provided title or regular expression.
166
+ * @param {string | RegExp} titleOrRegExp - The title or regular expression to match against the current page title.
167
+ * @param {ExpectOptions} options - The options to pass to the expect function.
168
+ */
169
+ export declare function expectPageToHaveTitle(titleOrRegExp: string | RegExp, options?: ExpectOptions): Promise<void>;
170
+ //# sourceMappingURL=assert-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-utils.d.ts","sourceRoot":"","sources":["../../../src/vasu-playwright-lib/utils/assert-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,OAAO,EAAE,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAc,MAAM,mCAAmC,CAAC;AAyBjG;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,QAEzD;AAED;;;GAGG;AAEH;;;;GAIG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7G;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,OAAO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+ * All expect assertions will dynamically wait until either the expect timeout specified in the
5
+ * playwright.config is reached or the condition becomes true.
6
+ * @module AssertUtils
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.expectPageToHaveTitle = exports.expectPageToContainURL = exports.expectPageToHaveURL = exports.expectElementToHaveCount = exports.expectElementToContainAttribute = exports.expectElementToHaveAttribute = exports.expectElementValueNotToBeEmpty = exports.expectElementValueToBeEmpty = exports.expectElementToHaveValues = exports.expectElementToHaveValue = exports.expectElementNotToContainText = exports.expectElementToContainText = exports.expectElementNotToHaveText = exports.expectElementToHaveText = exports.expectElementToBeEditable = exports.expectElementToBeEnabled = exports.expectElementToBeDisabled = exports.expectElementNotToBeChecked = exports.expectElementToBeChecked = exports.expectElementToBeInViewport = exports.expectElementToBeAttached = exports.expectElementToBeVisible = exports.expectElementToBeHidden = exports.assertAllSoftAssertions = void 0;
10
+ const tslib_1 = require("tslib");
11
+ const test_1 = require("@playwright/test");
12
+ const locator_utils_1 = require("./locator-utils");
13
+ const page_utils_1 = require("./page-utils");
14
+ /**
15
+ * Returns an Expect object configured with the given soft option.
16
+ * @param {SoftOption} options - The soft option to configure the Expect object with.
17
+ * @returns {Expect} - The configured Expect object.
18
+ */
19
+ function getExpectWithSoftOption(options) {
20
+ return test_1.expect.configure({ soft: options === null || options === void 0 ? void 0 : options.soft });
21
+ }
22
+ /**
23
+ * Returns a Locator object and an Expect object configured with the given soft option.
24
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
25
+ * @param {SoftOption} options - The soft option to configure the Expect object with.
26
+ * @returns {Object} - An object containing the Locator and Expect objects.
27
+ */
28
+ function getLocatorAndAssert(input, options) {
29
+ const locator = (0, locator_utils_1.getLocator)(input);
30
+ const assert = getExpectWithSoftOption(options);
31
+ return { locator, assert };
32
+ }
33
+ /**
34
+ * Use this function to assert all the soft assertions.
35
+ * @param {TestInfo} testInfo - The TestInfo object containing the test's information.
36
+ */
37
+ function assertAllSoftAssertions(testInfo) {
38
+ (0, test_1.expect)(testInfo.errors).toHaveLength(0);
39
+ }
40
+ exports.assertAllSoftAssertions = assertAllSoftAssertions;
41
+ /**
42
+ * 1. Locator Assertions: This section contains functions that perform assertions on specific locators.
43
+ * These functions check for various conditions such as visibility, presence in the DOM, text content, etc.
44
+ */
45
+ /**
46
+ * Asserts that the given element is not present in the DOM or is Hidden.
47
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
48
+ * @param {ExpectOptions} options - The options to pass to the expect function.
49
+ */
50
+ function expectElementToBeHidden(input, options) {
51
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ const { locator, assert } = getLocatorAndAssert(input, options);
53
+ yield assert(locator, options).toBeHidden(options);
54
+ });
55
+ }
56
+ exports.expectElementToBeHidden = expectElementToBeHidden;
57
+ /**
58
+ * Asserts that the given element is present in the DOM and visible.
59
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
60
+ * @param {ExpectOptions} options - The options to pass to the expect function.
61
+ */
62
+ function expectElementToBeVisible(input, options) {
63
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
64
+ const { locator, assert } = getLocatorAndAssert(input, options);
65
+ yield assert(locator, options).toBeVisible(options);
66
+ });
67
+ }
68
+ exports.expectElementToBeVisible = expectElementToBeVisible;
69
+ /**
70
+ * Asserts that the given element is present in the DOM.
71
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
72
+ * @param {ExpectOptions} options - The options to pass to the expect function.
73
+ */
74
+ function expectElementToBeAttached(input, options) {
75
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
76
+ const { locator, assert } = getLocatorAndAssert(input, options);
77
+ yield assert(locator, options).toBeAttached(options);
78
+ });
79
+ }
80
+ exports.expectElementToBeAttached = expectElementToBeAttached;
81
+ /**
82
+ * Asserts that the given element is present in the DOM and visible in the viewport of the page.
83
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
84
+ * @param {ExpectOptions} options - The options to pass to the expect function.
85
+ */
86
+ function expectElementToBeInViewport(input, options) {
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
+ const { locator, assert } = getLocatorAndAssert(input, options);
89
+ yield assert(locator, options).toBeInViewport(options);
90
+ });
91
+ }
92
+ exports.expectElementToBeInViewport = expectElementToBeInViewport;
93
+ /**
94
+ * Asserts that the given element is checked.
95
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
96
+ * @param {ExpectOptions} options - The options to pass to the expect function.
97
+ */
98
+ function expectElementToBeChecked(input, options) {
99
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
100
+ const { locator, assert } = getLocatorAndAssert(input, options);
101
+ yield assert(locator, options).toBeChecked(options);
102
+ });
103
+ }
104
+ exports.expectElementToBeChecked = expectElementToBeChecked;
105
+ /**
106
+ * Asserts that the given element is not checked.
107
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
108
+ * @param {ExpectOptions} options - The options to pass to the expect function.
109
+ */
110
+ function expectElementNotToBeChecked(input, options) {
111
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
112
+ const { locator, assert } = getLocatorAndAssert(input, options);
113
+ yield assert(locator, options).not.toBeChecked(options);
114
+ });
115
+ }
116
+ exports.expectElementNotToBeChecked = expectElementNotToBeChecked;
117
+ /**
118
+ * Asserts that the given element is disabled.
119
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
120
+ * @param {ExpectOptions} options - The options to pass to the expect function.
121
+ */
122
+ function expectElementToBeDisabled(input, options) {
123
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
124
+ const { locator, assert } = getLocatorAndAssert(input, options);
125
+ yield assert(locator, options).toBeDisabled(options);
126
+ });
127
+ }
128
+ exports.expectElementToBeDisabled = expectElementToBeDisabled;
129
+ /**
130
+ * Asserts that the given element is enabled.
131
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
132
+ * @param {ExpectOptions} options - The options to pass to the expect function.
133
+ */
134
+ function expectElementToBeEnabled(input, options) {
135
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
136
+ const { locator, assert } = getLocatorAndAssert(input, options);
137
+ yield assert(locator, options).toBeEnabled(options);
138
+ });
139
+ }
140
+ exports.expectElementToBeEnabled = expectElementToBeEnabled;
141
+ /**
142
+ * Asserts that the given element is editable.
143
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
144
+ * @param {ExpectOptions} options - The options to pass to the expect function.
145
+ */
146
+ function expectElementToBeEditable(input, options) {
147
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
148
+ const { locator, assert } = getLocatorAndAssert(input, options);
149
+ yield assert(locator, options).toBeEditable(options);
150
+ });
151
+ }
152
+ exports.expectElementToBeEditable = expectElementToBeEditable;
153
+ /**
154
+ * Asserts that the element equals the provided string or string array or regular expression.
155
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
156
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
157
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
158
+ */
159
+ function expectElementToHaveText(input, text, options) {
160
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
161
+ const { locator, assert } = getLocatorAndAssert(input, options);
162
+ yield assert(locator, options).toHaveText(text, options);
163
+ });
164
+ }
165
+ exports.expectElementToHaveText = expectElementToHaveText;
166
+ /**
167
+ * Asserts that the element does not equal the provided string or string array or regular expression.
168
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
169
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
170
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
171
+ */
172
+ function expectElementNotToHaveText(input, text, options) {
173
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
174
+ const { locator, assert } = getLocatorAndAssert(input, options);
175
+ yield assert(locator, options).not.toHaveText(text, options);
176
+ });
177
+ }
178
+ exports.expectElementNotToHaveText = expectElementNotToHaveText;
179
+ /**
180
+ * Asserts that the element contains the provided string or string array or regular expression.
181
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
182
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
183
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
184
+ */
185
+ function expectElementToContainText(input, text, options) {
186
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
187
+ const { locator, assert } = getLocatorAndAssert(input, options);
188
+ yield assert(locator, options).toContainText(text, options);
189
+ });
190
+ }
191
+ exports.expectElementToContainText = expectElementToContainText;
192
+ /**
193
+ * Asserts that the element does not contain the provided string or string array or regular expression.
194
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the text to assert.
195
+ * @param {string | string[] | RegExp} text - The string, string array or regular expression to match against the element's text.
196
+ * @param {ExpectOptions & ExpectTextOptions} options - The options to pass to the expect function.
197
+ */
198
+ function expectElementNotToContainText(input, text, options) {
199
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
200
+ const { locator, assert } = getLocatorAndAssert(input, options);
201
+ yield assert(locator, options).not.toContainText(text, options);
202
+ });
203
+ }
204
+ exports.expectElementNotToContainText = expectElementNotToContainText;
205
+ /**
206
+ * Asserts that the given element points to an input text box with the given text or Regex.
207
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
208
+ * @param {string | RegExp} text - The string or regular expression to match against the element's value.
209
+ * @param {ExpectOptions} options - The options to pass to the expect function.
210
+ */
211
+ function expectElementToHaveValue(input, text, options) {
212
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
213
+ const { locator, assert } = getLocatorAndAssert(input, options);
214
+ yield assert(locator, options).toHaveValue(text, options);
215
+ });
216
+ }
217
+ exports.expectElementToHaveValue = expectElementToHaveValue;
218
+ /**
219
+ * Asserts that the given element points to a multi-select/combobox (i.e. a select with the multiple attribute) and the specified values are selected.
220
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
221
+ * @param {Array<string | RegExp>} text - The array of strings or regular expressions to match against the element's values.
222
+ * @param {ExpectOptions} options - The options to pass to the expect function.
223
+ */
224
+ function expectElementToHaveValues(input, text, options) {
225
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
226
+ const { locator, assert } = getLocatorAndAssert(input, options);
227
+ yield assert(locator, options).toHaveValues(text, options);
228
+ });
229
+ }
230
+ exports.expectElementToHaveValues = expectElementToHaveValues;
231
+ /**
232
+ * Asserts that the given element points to an empty editable element or to a DOM node that has no text.
233
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
234
+ * @param {ExpectOptions} options - The options to pass to the expect function.
235
+ */
236
+ function expectElementValueToBeEmpty(input, options) {
237
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
238
+ const { locator, assert } = getLocatorAndAssert(input, options);
239
+ yield assert(locator, options).toBeEmpty(options);
240
+ });
241
+ }
242
+ exports.expectElementValueToBeEmpty = expectElementValueToBeEmpty;
243
+ /**
244
+ * Asserts that the given element points to a non-empty editable element or to a DOM node that has text.
245
+ * @param {string | Locator} input - Either a string (selector) or a Locator object from where we retrieve the input value to assert.
246
+ * @param {ExpectOptions} options - The options to pass to the expect function.
247
+ */
248
+ function expectElementValueNotToBeEmpty(input, options) {
249
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
250
+ const { locator, assert } = getLocatorAndAssert(input, options);
251
+ yield assert(locator, options).not.toBeEmpty(options);
252
+ });
253
+ }
254
+ exports.expectElementValueNotToBeEmpty = expectElementValueNotToBeEmpty;
255
+ /**
256
+ * Asserts that an element has an attribute with the given value.
257
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
258
+ * @param {string} attribute - The attribute to check for.
259
+ * @param {string | RegExp} value - The value to match against the attribute.
260
+ * @param {ExpectOptions} options - The options to pass to the expect function.
261
+ */
262
+ function expectElementToHaveAttribute(input, attribute, value, options) {
263
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
264
+ const { locator, assert } = getLocatorAndAssert(input, options);
265
+ yield assert(locator, options).toHaveAttribute(attribute, value, options);
266
+ });
267
+ }
268
+ exports.expectElementToHaveAttribute = expectElementToHaveAttribute;
269
+ /**
270
+ * Asserts that an element has an attribute which contains the given value.
271
+ * @param {string | Locator} input - Either a string (selector) or a Locator object.
272
+ * @param {string} attribute - The attribute to check for.
273
+ * @param {string | RegExp} value - The value to match against the attribute.
274
+ * @param {ExpectOptions} options - The options to pass to the expect function.
275
+ */
276
+ function expectElementToContainAttribute(input, attribute, value, options) {
277
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
278
+ const { locator, assert } = getLocatorAndAssert(input, options);
279
+ yield assert(locator, options).toHaveAttribute(attribute, new RegExp(value), options);
280
+ });
281
+ }
282
+ exports.expectElementToContainAttribute = expectElementToContainAttribute;
283
+ /**
284
+ * Asserts that the given element has the specified count.
285
+ * @param {string | Locator} input - Either a string (selector) or a Locator object to get the element count.
286
+ * @param {number} count - The count to match against the element's count.
287
+ * @param {ExpectOptions} options - The options to pass to the expect function.
288
+ */
289
+ function expectElementToHaveCount(input, count, options) {
290
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
291
+ const { locator, assert } = getLocatorAndAssert(input, options);
292
+ yield assert(locator, options).toHaveCount(count, options);
293
+ });
294
+ }
295
+ exports.expectElementToHaveCount = expectElementToHaveCount;
296
+ /**
297
+ * 2. Page Assertions: This section contains functions that perform assertions on the entire page.
298
+ * These functions check for conditions such as URL, title, etc.
299
+ */
300
+ /**
301
+ * Asserts that the current page URL matches exactly the provided URL or regular expression.
302
+ * @param {string | RegExp} urlOrRegExp - The URL or regular expression to match against the current page URL.
303
+ */
304
+ function expectPageToHaveURL(urlOrRegExp, options) {
305
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
306
+ const assert = getExpectWithSoftOption(options);
307
+ yield assert((0, page_utils_1.getPage)()).toHaveURL(urlOrRegExp, options);
308
+ });
309
+ }
310
+ exports.expectPageToHaveURL = expectPageToHaveURL;
311
+ /**
312
+ * Asserts that the current page URL contains the provided URL.
313
+ * @param {string } url - The URL to match against the current page URL.
314
+ */
315
+ function expectPageToContainURL(url, options) {
316
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
317
+ const assert = getExpectWithSoftOption(options);
318
+ yield assert((0, page_utils_1.getPage)()).toHaveURL(new RegExp(url), options);
319
+ });
320
+ }
321
+ exports.expectPageToContainURL = expectPageToContainURL;
322
+ /**
323
+ * This method will be used for future stories validations Asserts that the current page Title
324
+ * matches exactly the provided title or regular expression.
325
+ * @param {string | RegExp} titleOrRegExp - The title or regular expression to match against the current page title.
326
+ * @param {ExpectOptions} options - The options to pass to the expect function.
327
+ */
328
+ function expectPageToHaveTitle(titleOrRegExp, options) {
329
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
330
+ const assert = getExpectWithSoftOption(options);
331
+ yield assert((0, page_utils_1.getPage)()).toHaveTitle(titleOrRegExp, options);
332
+ });
333
+ }
334
+ exports.expectPageToHaveTitle = expectPageToHaveTitle;
335
+ //# sourceMappingURL=assert-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-utils.js","sourceRoot":"","sources":["../../../src/vasu-playwright-lib/utils/assert-utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,2CAAqE;AAErE,mDAA6C;AAC7C,6CAAuC;AAEvC;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,OAAoB;IACnD,OAAO,aAAM,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,KAAuB,EAAE,OAAoB;IACxE,MAAM,OAAO,GAAG,IAAA,0BAAU,EAAC,KAAK,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,SAAgB,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AC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CAAA;AAHD,kDAGC;AAED;;;GAGG;AACH,SAAsB,sBAAsB,CAAC,GAAW,EAAE,OAAuB;;QAC/E,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,CAAC,IAAA,oBAAO,GAAE,CAAC,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CAAA;AAHD,wDAGC;AAED;;;;;GAKG;AACH,SAAsB,qBAAqB,CAAC,aAA8B,EAAE,OAAuB;;QACjG,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,MAAM,CAAC,IAAA,oBAAO,GAAE,CAAC,CAAC,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CAAA;AAHD,sDAGC"}
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "vasu-playwright-utils",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Playwright Typescript Library with reusable utilities",
5
5
  "main": "./dist/vasu-playwright-lib/index.js",
6
6
  "types": "./dist/vasu-playwright-lib/index.d.ts",
7
7
  "exports": {
8
8
  ".": "./dist/vasu-playwright-lib/index.js",
9
9
  "./action-utils": "./dist/vasu-playwright-lib/utils/action-utils.js",
10
+ "./assert-utils": "./dist/vasu-playwright-lib/utils/assert-utils.js",
10
11
  "./element-utils": "./dist/vasu-playwright-lib/utils/element-utils.js",
11
12
  "./locator-utils": "./dist/vasu-playwright-lib/utils/locator-utils.js",
12
13
  "./page-utils": "./dist/vasu-playwright-lib/utils/page-utils.js",
13
14
  "./constants": "./dist/vasu-playwright-lib/constants/index.js",
15
+ "./setup": "./dist/vasu-playwright-lib/setup/index.js",
14
16
  "./types": "./dist/vasu-playwright-lib/types/optional-parameter-types.js"
15
17
  },
16
18
  "keywords": [
@@ -41,12 +43,14 @@
41
43
  "node": ">=16.0.0"
42
44
  },
43
45
  "peerDependencies": {
44
- "@playwright/test": "^1.37.1"
46
+ "@playwright/test": "^1.37.1",
47
+ "dotenv": "^16.3.1",
48
+ "winston": "^3.10.0"
45
49
  },
46
- "devDependencies": {
47
- "@types/node": "^20.5.1",
48
- "@typescript-eslint/eslint-plugin": "^6.4.0",
49
- "@typescript-eslint/parser": "^6.4.0",
50
+ "dependencies": {
51
+ "@types/node": "^20.5.2",
52
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
53
+ "@typescript-eslint/parser": "^6.4.1",
50
54
  "eslint": "^8.47.0",
51
55
  "eslint-config-prettier": "^9.0.0",
52
56
  "eslint-import-resolver-typescript": "^3.6.0",
@@ -55,7 +59,7 @@
55
59
  "eslint-plugin-playwright": "^0.15.3",
56
60
  "eslint-plugin-prettier": "^5.0.0",
57
61
  "husky": "^8.0.3",
58
- "lint-staged": "^14.0.0",
62
+ "lint-staged": "^14.0.1",
59
63
  "prettier": "^3.0.2",
60
64
  "rimraf": "^5.0.1",
61
65
  "tslib": "^2.6.2",