codeceptjs / codeceptjs/CodeceptJS
Problems with multiple dialog popups using Puppeteer
- Langage dominant
- JavaScript
- Étoiles
- 4.2k
- Forks
- 757
- Merge moyen
- 2 j 9 h
- PR mergées (30 j)
- 16
Description
#### What are you trying to achieve?
I'm converting some WebDriver tests into Puppeteer format and came across a problem with popups.
**Scenario:**
I have a button, that when clicked displays a dialog popup with the text "Are you sure you want to remove this node?"
When accepting the popup, a second popup is displayed with the text "deleteRow"
#### What do you get instead?
Using WebDriver the tests pass, but with Puppeteer I get this error:
> expected text in popup to include "Are you sure you want to remove this node?"
> + expected - actual
>
> -deleteRow
> +Are you sure you want to remove this node?
Original WebDriver test:
```js
I.click('.json-editor-btntype-deletelast');
I.seeInPopup('Are you sure you want to remove this node?');
I.acceptPopup();
I.seeInPopup('deleteRow');
I.acceptPopup();
I.click('.get-value');
assert.equal(await I.grabValueFrom('.debug'), '["A","B"]');
```
Puppetter test:
```js
I.amAcceptingPopups();
I.click('.json-editor-btntype-deletelast');
I.seeInPopup('Are you sure you want to remove this node?');
I.acceptPopup();
I.amAcceptingPopups();
I.seeInPopup('deleteRow');
I.acceptPopup();
I.click('.get-value');
assert.equal(await I.grabValueFrom('.debug'), '["A","B"]');
```
I have tried several different variations of "I.amAcceptingPopups()" positions, but nothing seems to work.
### Details
* CodeceptJS version: 2.3.0
* NodeJS Version: 12.9.0
* Operating System: Windows 19 Home 64Bit
* Puppeteer: 1.19.0
* Configuration file:
```js
exports.config = {
tests: './tests/codeceptjs/**/*_test.js',
timeout: 10000,
output: './e2e/output',
helpers: {
Puppeteer: {
browser: 'chrome',
url: 'localhost:9001/tests/pages/',
show: true,
disableScreenshots: false,
waitForNavigation: 'networkidle0',
waitForAction: 200,
restart: false,
chrome: {
args: ['--ignore-certificate-errors', '--no-sandbox']
}
},
customHelpers: {
require: './config/puppeteer.helpers.js'
}
},
include: {
I: './tests/codeceptjs/steps_file.js'
},
bootstrap: null,
mocha: {
reporterOptions: {
reportDir: './e2e/reports',
inlineAssets: true,
reportPageTitle: 'E2E Test Reports',
reportTitle: 'E2E Test Reports'
}
},
name: 'codeceptjs-json-editor'
}
```
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.