codeceptjs / codeceptjs/CodeceptJS

AutoLogin plugin - check is never called

オープン
#1,591 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
4.2k
フォーク
757
平均マージ
2日 9時間
マージ済み PR(30日)
16

説明

#### What are you trying to achieve?
I'm trying to login once and share cookies between tests.
I've put "pause()" and "I.say(...)" call in check and it is never displayed in the results not does it ever pause when ran with --debug.

#### What do you get instead?
I get login on every suite run (using BeforeSuit for this), and not a single check.

### Details

* CodeceptJS version: 2.0.8
* NodeJS Version: 8.11.1
* Operating System: Windows 10
* WebDriverIO: 5.7.6
* Configuration file:

```js
exports.config = {
output: "./output",
helpers: {
WebDriver: {
url: "http://tools.mycompany.com/Tools",
browser: "chrome",
restart: false,
keepBrowserState: true, // keep browser state between tests when restart is set to false
keepCookies: true, // keep cookies between tests when restart set to false
desiredCapabilities: {
chromeOptions: {
args: ["--headless", "--disable-gpu", "--window-size=1920,1200"]
}
}
}
},

include: {
I: "./codecept/steps_file.js",
page1: "./codecept/pages/page1.js",
page2: "./codecept/pages/page2.js",
page3: "./codecept/pages/page3.js",
page4: "./codecept/pages/page4.js",
page5: "./codecept/pages/page5.js",
page6: "./codecept/pages/page6.js",
fragment1: "./codecept/fragments/fragment1.js",
fragment2: "./codecept/fragments/fragment2.js",
fragment3: "./codecept/fragments/fragment3.js"
},

mocha: {},
bootstrap: false,
teardown: null,
hooks: [],
gherkin: {},
plugins: {
screenshotOnFail: { enabled: true },
allure: { enabled: true },
autoLogin: {
enabled: true,
inject: "login",
users: {
testUser: {
login: I => {
return I.login();
},
check: I => {
I.say("CHECK!");
pause();
I.amOnPage("/");
I.see("TEST USER", ".user-fullname");
},
fetch: () => {}, // not neccessary due to "keepCookies" option
restore: () => {} // not neccessary due to "keepCookies" option
}
}
}
},

tests: "./codecept/*_test.js",
timeout: 10000,
name: "Tools.E2eTests"
};
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。