vita-playwright 1.2.1 → 1.2.2
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/README.md +84 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -107,27 +107,59 @@ __Note__: getElementRefByRole() method will work for all types of roles, example
|
|
|
107
107
|
|
|
108
108
|
#### filltheData
|
|
109
109
|
```ts
|
|
110
|
-
|
|
110
|
+
/**
|
|
111
|
+
* @description: sets the text in inputbox.
|
|
112
|
+
* @param {string} locator - css selector/xpath of the inputbox.
|
|
113
|
+
* @param {string} data - Text to be set to inputbox
|
|
114
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
115
|
+
*/
|
|
116
|
+
async filltheData(locator: any, data: any)
|
|
111
117
|
```
|
|
112
118
|
#### clickonWebElement
|
|
113
119
|
```ts
|
|
114
|
-
|
|
120
|
+
/**
|
|
121
|
+
* @description: click the given locator element.
|
|
122
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
123
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
124
|
+
*/
|
|
125
|
+
async clickonWebElement(locator: any)
|
|
115
126
|
```
|
|
116
127
|
#### getInnerHTML
|
|
117
128
|
```ts
|
|
118
|
-
|
|
129
|
+
/**
|
|
130
|
+
* @description: returns inner html of locator element.
|
|
131
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
132
|
+
* @returns {string} - returns inner html string
|
|
133
|
+
*/
|
|
134
|
+
async getInnerHTML(locator: any)
|
|
119
135
|
```
|
|
120
136
|
#### getInnerText
|
|
121
137
|
```ts
|
|
122
|
-
|
|
138
|
+
/**
|
|
139
|
+
* @description: returns inner text of locator element.
|
|
140
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
141
|
+
* @returns {string} - returns inner text string
|
|
142
|
+
*/
|
|
143
|
+
async getInnerText(locator: any)
|
|
123
144
|
```
|
|
124
145
|
#### getText
|
|
125
146
|
```ts
|
|
126
|
-
|
|
147
|
+
/**
|
|
148
|
+
* @description: returns text of locator element.
|
|
149
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
150
|
+
* @returns {string} - returns text string
|
|
151
|
+
*/
|
|
152
|
+
async getText(locator: any)
|
|
127
153
|
```
|
|
128
154
|
#### getAttribute
|
|
129
155
|
```ts
|
|
130
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @description: returns given attribute value of locator element.
|
|
158
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
159
|
+
* @param {string} attribute - html attribute to get value
|
|
160
|
+
* @returns {string} - returns text string
|
|
161
|
+
*/
|
|
162
|
+
async getAttribute(locator: any, attribute: any))
|
|
131
163
|
```
|
|
132
164
|
#### evaluateJS
|
|
133
165
|
```ts
|
|
@@ -135,31 +167,70 @@ __Note__: getElementRefByRole() method will work for all types of roles, example
|
|
|
135
167
|
```
|
|
136
168
|
#### isElementPresent
|
|
137
169
|
```ts
|
|
138
|
-
|
|
170
|
+
/**
|
|
171
|
+
* @description: verifies given locator element is displayed or not.
|
|
172
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
173
|
+
* @returns {boolean} - returns true/false
|
|
174
|
+
*/
|
|
175
|
+
async isElementPresent(locator: any)
|
|
139
176
|
```
|
|
140
177
|
#### isElementEnabled
|
|
141
178
|
```ts
|
|
142
|
-
|
|
179
|
+
/**
|
|
180
|
+
* @description: verifies given locator element is enabled or not.
|
|
181
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
182
|
+
* @returns {boolean} - returns true/false
|
|
183
|
+
*/
|
|
184
|
+
async isElementEnabled(locator: any)
|
|
143
185
|
```
|
|
144
186
|
#### waitTillElementIsVisible
|
|
145
187
|
```ts
|
|
146
|
-
|
|
188
|
+
/**
|
|
189
|
+
* @description: waits until locator element visibles.
|
|
190
|
+
* @param {elementReference} elementSelector - element reference.
|
|
191
|
+
* @param {number} wait time
|
|
192
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
193
|
+
*/
|
|
194
|
+
async waitTillElementIsVisible(elementSelector: any, waitTime = 60000)
|
|
147
195
|
```
|
|
148
196
|
#### getInputBoxValue
|
|
149
197
|
```ts
|
|
150
|
-
|
|
198
|
+
/**
|
|
199
|
+
* @description: returns value of inputbox.
|
|
200
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
201
|
+
* @returns {string} - returns text string
|
|
202
|
+
*/
|
|
203
|
+
async getInputBoxValue(locator: any)
|
|
151
204
|
```
|
|
152
205
|
#### downloadAFile
|
|
153
206
|
```ts
|
|
154
|
-
|
|
207
|
+
/**
|
|
208
|
+
* @description: wait untill download process completes and save file with custom name.
|
|
209
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
210
|
+
* @param {string} filePath - Complete path of the excel file, example: C:/resources/****.xlsx.
|
|
211
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
212
|
+
*/
|
|
213
|
+
async downloadAFile(downloadButton: String, filePath: string)
|
|
155
214
|
```
|
|
156
215
|
#### uploadAFile
|
|
157
216
|
```ts
|
|
158
|
-
|
|
217
|
+
/**
|
|
218
|
+
* @description: wait untill upload process completes and save file with custom name.
|
|
219
|
+
* @param {string} locator - css selector/xpath of the element.
|
|
220
|
+
* @param {string} filePath - Complete path of the excel file, example: C:/resources/****.xlsx.
|
|
221
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
222
|
+
*/
|
|
223
|
+
async uploadAFile(uploadButton: String, uploadFilePath: String)
|
|
159
224
|
```
|
|
160
225
|
#### getElementRefByRole
|
|
161
226
|
```ts
|
|
162
|
-
|
|
227
|
+
/**
|
|
228
|
+
* @description: will perform click action.
|
|
229
|
+
* @param {string} roleType - example: "alert"|"alertdialog"|"application"|"article"|"banner"|"blockquote"|"button"|"caption"|"cell"|"checkbox"|"code"|"columnheader"|"combobox"|"complementary"|"contentinfo"|"definition"|"deletion"|"dialog"|"directory"|"document"|"emphasis"|"feed"|"figure"|"form"|"generic"|"grid"|"gridcell"|"group"|"heading"|"img"|"insertion"|"link"|"list"|"listbox"|"listitem"|"log"|"main"|"marquee"|"math"|"meter"|"menu"|"menubar"|"menuitem"|"menuitemcheckbox"|"menuitemradio"|"navigation"|"none"|"note"|"option"|"paragraph"|"presentation"|"progressbar"|"radio"|"radiogroup"|"region"|"row"|"rowgroup"|"rowheader"|"scrollbar"|"search"|"searchbox"|"separator"|"slider"|"spinbutton"|"status"|"strong"|"subscript"|"superscript"|"switch"|"tab"|"table"|"tablist"|"tabpanel"|"term"|"textbox"|"time"|"timer"|"toolbar"|"tooltip"|"tree"|"treegrid"|"treeitem".
|
|
230
|
+
* @param {string} roleName - name of the element.
|
|
231
|
+
* @returns {Promise<void>} - returns Promise of void
|
|
232
|
+
*/
|
|
233
|
+
async getElementRefByRole(roleType: string, roleName: string)
|
|
163
234
|
```
|
|
164
235
|
|
|
165
236
|
## Utilities
|