codeceptjs / codeceptjs/CodeceptJS

Bug: using a "dynamic" restart=false with webdriverio backend leaves browser instances running

未關閉
#2,023 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
JavaScript
星號
4.2k
分支
757
平均合併
2 天 9 小時
30 天內合併 PR
16

描述

#### What are you trying to achieve?

I'm trying to configure a single feature to keep the browser open between tests.
Configuring globally is not an option because our tests are not ready to handle that yet.
I want to have some tests run with browser restart: true, and others with restart: false.

I'm running the following command:
```bash
codeceptjs run path-to-my-test
```

I expect the browser to close after tests are executed.

(All tests pass btw.)

#### What do you get instead?

Browser remains open after all tests finish.

```bash
› [Suite Config] WebDriver {"restart":false}
› Started SeleniumStandaloneLauncher
› [Session] Starting singleton browser session
› [Window Size] [object Object]

# ...
# irrelevant tests output
# ....

Emitted | test.after ([object Object])
› [Session] cleaning cookies and localStorage
Emitted | suite.after ([object Object])
› [Suite Config] Reverted for WebDriver

OK | 7 passed // 23s
Emitted | global.result ([object Object])
Emitted | global.after ([object Object])
› Stopped SeleniumStandaloneLauncher
```

> Provide test source code if related

```js
Feature('Feature').config('WebDriver', {
restart: false,
});
```

### Details

* CodeceptJS version: ^2.3.2
* NodeJS Version: v10.15.3
* Operating System: Ubuntu 19.04
* Protractor || WebDriverIO || Nightmare version (if related): ` "@wdio/selenium-standalone-service": "^5.15.0",`
* Configuration file:

```js
helpers: {
GraphQL: {
endpoint: 'http://localhost:4060/graphql',
},
WebDriver: {
url: 'http://localhost:4050/',
browser: 'chrome',
windowSize: 'maximize',
version: chromeVersion,
desiredCapabilities: {
chromeOptions: {
binary: process.env.CI ? void 0 : chromiumBinary.path,
args: ['--disable-gpu'],
},
},
smartWait: 5000,
},
},
```

Related but not the same: https://github.com/Codeception/CodeceptJS/issues/1069

貢獻指南

開啟貢獻指南

研究方向

使用 `codeceptjs run path-to-my-test` 以及所示的 `Feature('Feature').config('WebDriver', { restart: false })` 設定重現此問題。圍繞回報的 `global.after` 輸出,追蹤 WebDriver 工作階段與 suite 的生命週期;完成標準是每個 feature 的重新啟動設定生效,且執行後瀏覽器關閉,並加入涵蓋此情況的回歸測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, node.js
領域
testing-qa
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。