@mechris3/glassbox 0.1.5 → 0.1.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/README.md +20 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,7 +102,26 @@ await fetch('http://...', { headers: { Authorization: `Bearer ${apiKey}` } });
|
|
|
102
102
|
|
|
103
103
|
### Page Objects
|
|
104
104
|
|
|
105
|
-
Extend `BasePage` — no constructor needed
|
|
105
|
+
Extend `BasePage` — no constructor needed. The following methods are available via `this`:
|
|
106
|
+
|
|
107
|
+
| Method | Description |
|
|
108
|
+
|--------|-------------|
|
|
109
|
+
| `click(selector)` | Click an element |
|
|
110
|
+
| `fill(selector, value)` | Clear and set an input's value |
|
|
111
|
+
| `type(selector, value, {delay?})` | Type character by character (for autocomplete etc.) |
|
|
112
|
+
| `getText(selector)` | Get an element's text content |
|
|
113
|
+
| `getInputValue(selector)` | Get an input's current value |
|
|
114
|
+
| `getAttribute(selector, attr)` | Get an element's attribute value |
|
|
115
|
+
| `countElements(selector)` | Count matching elements |
|
|
116
|
+
| `isVisible(selector)` | Check if element is visible |
|
|
117
|
+
| `isDisabled(selector)` | Check if element is disabled |
|
|
118
|
+
| `waitForSelector(selector, {timeout?})` | Wait for element to appear (default 5s) |
|
|
119
|
+
| `waitForHidden(selector, {timeout?})` | Wait for element to disappear |
|
|
120
|
+
| `goto(url)` | Navigate (relative URLs resolve against target URL) |
|
|
121
|
+
| `evaluate(script)` | Execute arbitrary JS in the page |
|
|
122
|
+
| `clearSession(origin?)` | Clear cookies and storage |
|
|
123
|
+
|
|
124
|
+
Example:
|
|
106
125
|
|
|
107
126
|
```typescript
|
|
108
127
|
// page-objects/login.page.ts
|
package/package.json
CHANGED