@smartbit4all/playwright-qa 0.1.4 → 0.1.5
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 +21 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -185,6 +185,27 @@ await screenshot(page, 'context-menu-open');
|
|
|
185
185
|
await page.keyboard.press('Escape');
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
### Dialog
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import { topDialog, clickInDialog } from '@smartbit4all/playwright-qa/steps';
|
|
192
|
+
|
|
193
|
+
// Get the topmost open dialog (Angular Material or PrimeNG)
|
|
194
|
+
const dialog = topDialog(page);
|
|
195
|
+
|
|
196
|
+
// Click a button inside the topmost dialog — useful when multiple dialogs are stacked
|
|
197
|
+
await clickInDialog(page, 'Mentés');
|
|
198
|
+
|
|
199
|
+
// Example: dialog-in-dialog workflow
|
|
200
|
+
await clickInDialog(page, 'Akció beállítás'); // opens second dialog on top
|
|
201
|
+
await screenshot(page, 'second-dialog');
|
|
202
|
+
await clickInDialog(page, 'Mentés'); // clicks Mentés in the TOP dialog
|
|
203
|
+
// first dialog is still open
|
|
204
|
+
await clickInDialog(page, 'Bezárás'); // closes first dialog
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
When multiple dialogs are open, `topDialog` always targets the last (topmost) one. This prevents accidentally clicking buttons in a background dialog.
|
|
208
|
+
|
|
188
209
|
### Utilities
|
|
189
210
|
|
|
190
211
|
```typescript
|
package/package.json
CHANGED