codeceptjs / codeceptjs/CodeceptJS

Problems with multiple dialog popups using Puppeteer

Đang mở
#1,872 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
757
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Mô tả

#### 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'
}
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.