playwright-ts-automationframework 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright-ts-automationframework",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "https://github.com/ketanp88/playwright-TS-AutomationFramework"
13
+ "url": "git+https://github.com/ketanp88/playwright-TS-AutomationFramework.git"
14
14
  },
15
15
  "keywords": [],
16
16
  "author": "ketan_pardeshiarun@yahoo.com",
@@ -1,340 +0,0 @@
1
- import { Page } from "@playwright/test";
2
- import { BasePage } from "./basePage.core";
3
- import { WebControl } from "./webControl.core";
4
- /**
5
- * All wrapper methods over playwright actions methods with logger.
6
- * @author Ketan Pardeshi
7
- * */
8
- export declare class Actions extends BasePage {
9
- constructor(page: Page);
10
- /**
11
- * Click on an element.
12
- *
13
- * @param WebControl Control on which user want to click.
14
- *
15
- * Example:
16
- *
17
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
18
- *
19
- * click(loginBtn);
20
- */
21
- click(control: WebControl): Promise<void>;
22
- /**
23
- * Mouse hover on an element.
24
- *
25
- * @param WebControl Control on which user want to mouse hover.
26
- *
27
- * Example:
28
- *
29
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
30
- *
31
- * mouseHover(loginBtn);
32
- */
33
- mouseHover(control: WebControl): Promise<void>;
34
- /**
35
- * Focus on element and press keyboard button.
36
- *
37
- * @param WebControl Control on which user want to focus and perform the keyboard action.
38
- * @param action Keyboard action which needs to perform.
39
- *
40
- * Example:
41
- *
42
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
43
- *
44
- * focusAndPressSpace(loginBtn, "Enter");
45
- */
46
- focusAndPressKeyboardEvent(control: WebControl, action: string): Promise<void>;
47
- /**
48
- * Enter value in textbox control.
49
- *
50
- * @param WebControl Textbox control on which user want to enter value.
51
- * @param textTobeEntered Value user want to enter in textbox.
52
- * Example:
53
- *
54
- * usernameTxtbx = new WebControl(this.page.locator("#username"), 'Username textbox');
55
- *
56
- * type(usernameTxtbx);
57
- */
58
- type(control: WebControl, textTobeEntered: string): Promise<void>;
59
- /**
60
- * Press Keyboard event.
61
- *
62
- * @param WebControl Control on which user want perform the keyboard action.
63
- * @param key Keyboard action which needs to perform.
64
- *
65
- * Example:
66
- *
67
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
68
- *
69
- * pressKeyboardEvent(loginBtn, "Enter");
70
- */
71
- pressKeyboardEvent(control: WebControl, key: string): Promise<void>;
72
- /**
73
- * Select dropdown element by value.
74
- *
75
- * @param WebControl Dropdown Control of which value need to be selected.
76
- * @param optionTobeSelcted Dropdown value which needs to be selected.
77
- *
78
- * Example:
79
- *
80
- * cityDrpdwn = new WebControl(this.page.locator('#city'), 'City dropdown');
81
- *
82
- * selectFromDropdownByValue(cityDrpdwn, "Sydney");
83
- */
84
- selectFromDropdownByValue(control: WebControl, optionTobeSelcted: string): Promise<void>;
85
- /**
86
- * Select dropdown element by text.
87
- *
88
- * @param WebControl Dropdown Control.
89
- * @param optionTobeSelcted Dropdown text which needs to be selected.
90
- *
91
- * Example:
92
- *
93
- * cityDrpdwn = new WebControl(this.page.locator('#city'), 'City dropdown');
94
- *
95
- * selectDropDownByText(cityDrpdwn, "Sydney");
96
- */
97
- selectDropDownByText(control: WebControl, optionTobeSelcted: string): Promise<void>;
98
- /**
99
- * Select dropdown element by index.
100
- *
101
- * @param WebControl Dropdown Control.
102
- * @param index Item number which needs to be selected.
103
- *
104
- * Example:
105
- *
106
- * cityDrpdwn = new WebControl(this.page.locator('#city'), 'City dropdown');
107
- *
108
- * selectFromDropdownByIndex(cityDrpdwn, 1);
109
- */
110
- selectFromDropdownByIndex(control: WebControl, index: number): Promise<void>;
111
- /**
112
- * Select checkbox element.
113
- *
114
- * @param WebControl Checkbox Control .
115
- * @param expectedCheckboxValue Expected checkbox value. If user want to select checkbox then provide 'true' else 'false'
116
- *
117
- * Example:
118
- *
119
- * isMinorChkbx = new WebControl(this.page.locator('#Minor'), 'Minor Checkbox');
120
- *
121
- * selectCheckbox(isMinorChkbx, true);
122
- */
123
- selectCheckbox(control: WebControl, expectedCheckboxValue?: boolean): Promise<void>;
124
- /**
125
- * Info to get weather checkbox/Radio element is selected or not.
126
- * Returns true if element is selected else false
127
- *
128
- * @param WebControl Checkbox Control of which selected value need to retrived.
129
- *
130
- * Example:
131
- *
132
- * isMinorChkbx = new WebControl(this.page.locator('#Minor'), 'Minor Checkbox');
133
- *
134
- * let checkboxValue = isSelected(isMinorChkbx);
135
- */
136
- isSelected(control: WebControl): Promise<boolean>;
137
- /**
138
- * Info to get wheather element is enabled or not.
139
- * Returns true if element is enabled else false
140
- *
141
- * @param WebControl Control of which enabled or disabled value need to be retrived.
142
- *
143
- * Example:
144
- *
145
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
146
- *
147
- * let enabledValue = isEnabled(loginBtn);
148
- */
149
- isEnabled(control: WebControl): Promise<boolean>;
150
- /**
151
- * Info to get wheather element is displayed or not.
152
- * Returns true if element is displayed else false
153
- *
154
- * @param WebControl Control of which is displayed value need to be retrived.
155
- *
156
- * Example:
157
- *
158
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
159
- *
160
- * let displayedValue = isDisplayed(loginBtn);
161
- */
162
- isDisplayed(control: WebControl): Promise<boolean>;
163
- /**
164
- * Read text of an element
165
- *
166
- * @param WebControl Control of which text need to be retrieved.
167
- *
168
- * Example:
169
- *
170
- * errorMsg = new WebControl(this.page.locator('#Alert'), 'Invalid Credentials Error message');
171
- *
172
- * let errorMessage = getText(errorMsg);
173
- */
174
- getText(control: WebControl): Promise<string>;
175
- /**
176
- * Read textbox value of an element
177
- *
178
- * @param WebControl textbox Control.
179
- *
180
- * Example:
181
- *
182
- * usernameTxtbx = new WebControl(this.page.locator("#username"), 'Username textbox');
183
- *
184
- * let textboxValue = getTextboxValue(usernameTxtbx);
185
- */
186
- getTextboxValue(control: WebControl): Promise<string>;
187
- /**
188
- * Read selected dropdown item.
189
- *
190
- * @param WebControl Dropdown Control.
191
- *
192
- * Example:
193
- *
194
- * cityDrpdwn = new WebControl(this.page.locator('#City'), 'City dropdown');
195
- *
196
- * let selectedItem = getSelectedItemFromDropdown(cityDrpdwn);
197
- */
198
- getSelectedItemFromDropdown(control: WebControl): Promise<string>;
199
- /**
200
- * Read attribute value of element.
201
- *
202
- * @param WebControl Control of which attriubute value need to retrieved.
203
- * @param attributeName Name of attribute.
204
- *
205
- * Example:
206
- *
207
- * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
208
- *
209
- * let attributeValue = getAttributeValue(usernameTxtbx, "title");
210
- */
211
- getAttributeValue(control: WebControl, attributeName: string): Promise<string | null>;
212
- /**
213
- * Scroll to an element.
214
- *
215
- * @param WebControl Control on which scroll need to perform.
216
- *
217
- * Example:
218
- *
219
- * loginBtn = new WebControl(this.page.locator('#login'), 'Login button');
220
- *
221
- * scrollToControl(loginBtn);
222
- */
223
- scrollToControl(control: WebControl): Promise<void>;
224
- /**
225
- * Navigate back on browser.
226
- *
227
- * Example:
228
- *
229
- * navigateBack();
230
- */
231
- navigateBack(): Promise<void>;
232
- /**
233
- * Handle web Alert by accepting or dismissing it
234
- *
235
- * @param action If send parameter as "accept" it accept alert else dismiss it.
236
- *
237
- * Example:
238
- *
239
- * handleAlert("Accept");
240
- */
241
- handleAlert(action: string): Promise<void>;
242
- /**
243
- * Read the web alert message
244
- *
245
- * Example:
246
- *
247
- * let alertMsg = getAlertDialogMessage();
248
- */
249
- getAlertDialogMessage(): Promise<Page>;
250
- /**
251
- * Return all elements for given search criteria.
252
- *
253
- * @param WebControl Control on which user want to click.
254
- *
255
- * Example:
256
- *
257
- * dateColumn = new WebControl(this.page.locator('#date'), 'Date Column values');
258
- *
259
- * findAll(dateColumn);
260
- */
261
- findAll(control: WebControl): Promise<import("playwright-core").Locator[]>;
262
- /**
263
- * Read the web URL
264
- *
265
- * Example:
266
- *
267
- * let url = getURL();
268
- */
269
- getURL(): Promise<string>;
270
- /**
271
- * Read the title of web Page
272
- *
273
- * Example:
274
- *
275
- * let title = getTitle();
276
- */
277
- getTitle(): Promise<void>;
278
- /**
279
- * Wait till URL contains value
280
- *
281
- * @param url Wait for URL.
282
- *
283
- * Example:
284
- *
285
- * waitTillPageURLContains("https://www.google.com/");
286
- */
287
- waitTillPageURLContains(url: string): Promise<void>;
288
- /**
289
- * Wait till element is present
290
- *
291
- * @param control Wait for element to be present.
292
- *
293
- * Example:
294
- *
295
- * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
296
- *
297
- * waitTillElementIsPresent(usernameTxtbx);
298
- */
299
- waitTillElementIsPresent(control: WebControl): Promise<void>;
300
- /**
301
- * Wait till element is attached to the dom
302
- *
303
- * @param control Wait for element to be attached in dom.
304
- *
305
- * Example:
306
- *
307
- * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
308
- *
309
- * waitTillElementIsAttached(usernameTxtbx);
310
- */
311
- waitTillElementIsAttached(control: WebControl): Promise<void>;
312
- /**
313
- * Wait till element is not displayed
314
- *
315
- * @param control WebControl for which wait to get hidden.
316
- *
317
- * Example:
318
- *
319
- * usernameTxtbx = new WebControl(this.page.locator('#username'), 'Username textbox');
320
- *
321
- * waitTillElementIsNotPresent(usernameTxtbx);
322
- */
323
- waitTillElementIsNotPresent(control: WebControl): Promise<void>;
324
- /**
325
- * Wait for execution to stop for given time
326
- *
327
- * @param milliseconds Time for which executed should halt in seconds
328
- *
329
- * Example:
330
- *
331
- * sleep(10);
332
- */
333
- sleep(milliseconds?: number): Promise<unknown>;
334
- /**
335
- * Close the browser instance
336
- *
337
- * closeBrowser();
338
- */
339
- closeBrowser(): Promise<void>;
340
- }