codeceptjs / codeceptjs/CodeceptJS

Parameter restart not working in CodeceptJs with Playwright

Đang mở
#2,992 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
playwright
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 am using CodeceptJS + Playwright

I'm looking for a before all solution to open browser e execute some steps before scenarios but can't find anyone in codeceptjs+playwright. BeforeSuite can't access browser.

#### What do you get instead?

I tried to use restart:false to run all scenarios in same browser window but the browser is always restarted before each scenario.

I could see something strange....when using restart:false and test finish, browser close and then another instance browser is opened but closes again and finally open another instance and continue the scenarios.

This not happen when restart:true, browser close and open ok between scenarios.

> Provide test source code if related

Here is my helper with restart parameter:

```
helpers: {
Playwright: {
show: true,
browser: 'chromium',
windowSize: '1280x960',
waitForNavigation: "networkidle0",
restart: false,
keepBrowserState: true
},
},
```

### Details

* CodeceptJS version: 3.1.1
* NodeJS Version: 14.9.0
* Operating System: Windows
* Playwright version: 1.14.0
* Configuration file:

```
const dotenv = require('dotenv').config();

exports.config = {
tests: './specs/site/*.js',
output: './reports/e2esitecc',
helpers: {
Playwright: {
show: true,
browser: 'chromium',
windowSize: '1280x960',
waitForNavigation: "networkidle0",
restart: false,
keepBrowserState: true
},
},
include: {
I: './steps_file.js',
testePage: './pages/testePage.js',
loginPage: './pages/login_po.js',
},
bootstrap: null,
mocha: {},
name: 'e2e-web-codeceptjs',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
}
}
}
```

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.