playwright-ts-automationframework 1.1.68 → 1.1.70

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,269 @@
1
+ import { Actions } from './actions.core';
2
+ import { WebControl } from './webControl.core';
3
+ import { Page } from '@playwright/test';
4
+ /**
5
+ * All Verification methods required for test case verification.
6
+ * @author Ketan Pardeshi
7
+ * */
8
+ export declare class Assertion extends Actions {
9
+ constructor(page: Page);
10
+ /**
11
+ * Verify two objects are equals.
12
+ * If both objects are equal test case gets passed else fails.
13
+ *
14
+ * @param object1 First object.
15
+ * @param object2 Second object.
16
+ * Example:
17
+ *
18
+ * verifyIsEquals("Invalid username", "Invalid username");
19
+ */
20
+ verifyIsEquals(object1: any, object2: any, controlDescription?: string): void;
21
+ verifyIsNotEquals(object1: any, object2: any, controlDescription?: string): void;
22
+ verifyIsEqualIgnorecase(object1: any, object2: any, controlDescription?: string, caseInsensitive?: boolean): void;
23
+ /**
24
+ * Verify first value contains substring as second.
25
+ * If expected value is present in actual value then test case gets passed else failed..
26
+ *
27
+ * @param expected First object which has .
28
+ * @param actual Second object.
29
+ * Example:
30
+ *
31
+ * verifyIsContains("Invalid username Test", "Invalid username");
32
+ */
33
+ verifyIsContains(actual: string, expected: string, controlDescription?: string): void;
34
+ /**
35
+ * Verify element's displayed/not displayed status as per expected value
36
+ * If expected element's displayed status is as per expected then test case gets passed else failed..
37
+ *
38
+ * @param control Control of which enable or disable status.
39
+ * @param expValue Expected value enabled as true or disabled as false.
40
+ * Example:
41
+ *
42
+ * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
43
+ *
44
+ * verifyIsDisplayed(loginBtn, true);
45
+ */
46
+ verifyIsDisplayed(control: WebControl, expectedIsDisplayed?: boolean): Promise<void>;
47
+ /**
48
+ * Verify element is not displayed
49
+ * If expected element's displayed status is false the test case gets passed else failed..
50
+ *
51
+ * @param control Control for which not displayed status need to verify.
52
+ * @param isAlreadyHidden Is control already hidden or need to wait to get hidden.
53
+ * Example:
54
+ *
55
+ * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
56
+ *
57
+ * verifyIsNotDisplayed(loginBtn, true);
58
+ */
59
+ verifyIsNotDisplayed(control: WebControl, isAlreadyHidden?: boolean): Promise<void>;
60
+ /**
61
+ * Verify attribute value of the control
62
+ * If elements attribute value is as per expected value then test case gets passed else failed..
63
+ *
64
+ * @param control Control for which attribute value need to verify.
65
+ * @param attributeName Attribute name.
66
+ * @param attributeValue Expected attribute value
67
+
68
+ * Example:
69
+ *
70
+ * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
71
+ *
72
+ * verifyAttributeValue(loginBtn, "value", "Submit");
73
+ */
74
+ verifyAttributeValue(control: WebControl, attributeName: string, expectedAttributeValue: string): Promise<void>;
75
+ /**
76
+ * Verify element's attribute value contains expected value
77
+ * If element's attribute value contains expected value then test case gets passed else failed..
78
+ *
79
+ * @param control Control of which attribute value need to verify.
80
+ * @param attributeName Attribute name
81
+ * @param expectedText Expected partial value.
82
+ *
83
+ * Example:
84
+ *
85
+ * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
86
+ *
87
+ * verifyAttributeValueContains(loginBtn, "value", "Submit");
88
+ */
89
+ verifyAttributeValueContains(control: WebControl, attributeName: string, attributeValue: string): Promise<void>;
90
+ /**
91
+ * Verify element's enabled/disabled status as per expected value
92
+ * If expected element's enabled status is as per expected then test case gets passed else failed..
93
+ *
94
+ * @param control Control of which enable or disable status.
95
+ * @param expValue Expected value enabled as true or disabled as false.
96
+ * Example:
97
+ *
98
+ * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
99
+ *
100
+ * verifyIsEnabled(loginBtn, true);
101
+ */
102
+ verifyIsEnabled(control: WebControl, expValue?: boolean): Promise<void>;
103
+ verifyIsDisabled(control: WebControl, expValue?: boolean): Promise<void>;
104
+ /**
105
+ * The function `verifyIsSelected` asynchronously verifies if a web control is selected with an
106
+ * expected boolean value.
107
+ * @param {WebControl} control - The `control` parameter is a WebControl object that represents an
108
+ * element on a web page that you want to verify the selected status of.
109
+ * @param {boolean} [expValue=true] - The `expValue` parameter is a boolean value that represents the
110
+ * expected selection status of a web control. By default, it is set to `true`, meaning that the
111
+ * control is expected to be selected.
112
+ */
113
+ verifyIsSelected(control: WebControl, expValue?: boolean): Promise<void>;
114
+ /**
115
+ * Verify element's text as per expected value
116
+ * If expected element's text is as per expected value then test case gets passed else failed..
117
+ *
118
+ * @param control Control of which text need to verify.
119
+ * @param expectedText Expected value.
120
+ * Example:
121
+ *
122
+ * errorMsg = new WebControl(this.page.locator('#error'), 'Login Error message');
123
+ *
124
+ * verifyDisplayedText(loginBtn, "Invalid Username Test User");
125
+ */
126
+ verifyDisplayedText(control: WebControl, expectedText: string): Promise<void>;
127
+ /**
128
+ * Verify element's text contains partial expected value
129
+ * If expected element's text contains expected value then test case gets passed else failed..
130
+ *
131
+ * @param control Control of which text need to verify.
132
+ * @param expectedText Expected partial value.
133
+ * Example:
134
+ *
135
+ * errorMsg = new WebControl(this.page.locator('#error'), 'Login Error message');
136
+ *
137
+ * verifyDisplayedTextContains(loginBtn, "Invalid Username");
138
+ */
139
+ verifyDisplayedTextContains(control: WebControl, expectedText: string): Promise<void>;
140
+ /**
141
+ * Verify element's text does not contains expected value
142
+ * If expected element's text does not contains expected value then test case gets passed else failed..
143
+ *
144
+ * @param control Control of which text need to verify.
145
+ * @param expectedText Expected partial value.
146
+ * Example:
147
+ *
148
+ * errorMsg = new WebControl(this.page.locator('#error'), 'Login Error message');
149
+ *
150
+ * verifyDisplayedTextDoesNotContains(loginBtn, "Enter User");
151
+ */
152
+ verifyDisplayedTextDoesNotContains(control: WebControl, expectedText: string): Promise<void>;
153
+ /**
154
+ * Verify element's textbox is equal to expected value
155
+ * If expected element's textbox value to be expected value then test case gets passed else failed..
156
+ *
157
+ * @param control Textbox control.
158
+ * @param expectedText Expected value.
159
+ * Example:
160
+ *
161
+ * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
162
+ *
163
+ * verifyTextboxValue(usernameTxtbx, "Test@Adactin");
164
+ */
165
+ verifyTextboxValue(control: WebControl, expectedText: string): Promise<void>;
166
+ verifyTextboxValueContains(control: WebControl, expectedText: string): Promise<void>;
167
+ /**
168
+ * Verify element's inner text is equal to expected value
169
+ * If expected element's inner value to be expected value then test case gets passed else failed..
170
+ *
171
+ * @param control Textbox control.
172
+ * @param expectedText Expected value.
173
+ * Example:
174
+ *
175
+ * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
176
+ *
177
+ * verifyTextboxValue(usernameTxtbx, "Test@Adactin");
178
+ */
179
+ verifyInnerText(control: WebControl, expectedText: string): Promise<void>;
180
+ verifyInnerTextContains(control: WebControl, expectedText: string): Promise<void>;
181
+ /**
182
+ * Verify element's input text is equal to expected value
183
+ * If expected element's inner value to be expected value then test case gets passed else failed..
184
+ *
185
+ * @param control Textbox control.
186
+ * @param expectedText Expected value.
187
+ * Example:
188
+ *
189
+ * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
190
+ *
191
+ * verifyTextboxValue(usernameTxtbx, "Test@Adactin");
192
+ */
193
+ verifyInputValue(control: WebControl, expectedText: string): Promise<void>;
194
+ verifyInputValueContains(control: WebControl, expectedText: string): Promise<void>;
195
+ /**
196
+ * Verify element's checkbox/radio value is equal to expected value
197
+ * If expected element's checkbox/radio value to be expected value then test case gets passed else failed..
198
+ *
199
+ * @param control Checkbox/radio control.
200
+ * @param expectedText Expected checkbox/radio value.
201
+ * Example:
202
+ *
203
+ * isMinor = new WebControl(this.page.locator('#isMinor'), 'Is Minor checkbox');
204
+ *
205
+ * verifyCheckboxValue(isMinor, true);
206
+ */
207
+ verifyCheckboxValue(control: WebControl, value: boolean): Promise<void>;
208
+ /**
209
+ * Verify element's tagname is equal to expected value
210
+ * If expected element's Tagname is equal to expected value then test case gets passed else failed..
211
+ *
212
+ * @param control Checkbox/radio control.
213
+ * @param expectedText Expected checkbox/radio value.
214
+ * Example:
215
+ *
216
+ * isMinor = new WebControl(this.page.locator('#isMinor'), 'Is Minor checkbox');
217
+ *
218
+ * verifyTagName(isMinor, "a");
219
+ */
220
+ verifyTagName(control: WebControl, expectedTagName: string): Promise<void>;
221
+ verifyListContainsValue(control: WebControl, valueToVerify: string): Promise<void>;
222
+ verifyListContainsMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
223
+ verifyDropdownOptions(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
224
+ verifyListForMultipleValues(control: WebControl, listOfValueToVerify: string[], waitTillElementIsDisplayed?: boolean): Promise<void>;
225
+ /**
226
+ * Verify Alert text is equal to expected value
227
+ * If alert text is equal to expected value then test case gets passed else failed..
228
+ *
229
+ * @param expectedText Expected alert text.
230
+ * Example:
231
+ *
232
+ * verifyAlertText("Password should be 8 digit.")
233
+ */
234
+ verifyAlertText(expectedText: string): Promise<void>;
235
+ /**
236
+ * Verify URL contains expected value
237
+ * If URL contains expected value then test case gets passed else failed..
238
+ *
239
+ * @param expectedText Expected partial URL.
240
+ * Example:
241
+ *
242
+ * verifyURLContains("google.com");
243
+ */
244
+ verifyURLContains(subString: string): Promise<void>;
245
+ /**
246
+ * Verify count of elements which matched the control
247
+ * If count of elements is equal to expected value then test case will get passed else failed..
248
+ *
249
+ * @param control Control element.
250
+ * @param expectedCount Expected count of elements matching criteria
251
+ * Example:
252
+ *
253
+ * checkboxes = new WebControl(this.page.locator("xpath=//a"), 'checkboxes');
254
+ * verifyCountOfElements(isMinor, 5);
255
+ */
256
+ verifyCountOfElements(control: WebControl, expectedCount: number): Promise<void>;
257
+ verifyCountOfElementsIsGreaterOrEqual(control: WebControl, expectedCount: number): Promise<void>;
258
+ verifyCountOfElementsIsLesseOrEqual(control: WebControl, expectedCount: number): Promise<void>;
259
+ /**
260
+ * Verify title of web page contains expected value
261
+ * If title contains expected value then test case will get passed else failed..
262
+ *
263
+ * @param expectedText Expected partial Title.
264
+ * Example:
265
+ *
266
+ * verifyPageTitleContains("Google");
267
+ */
268
+ verifyPageTitleContains(expectedText: string): Promise<void>;
269
+ }