codeceptjs / codeceptjs/CodeceptJS

AutoLogin plugin - check is never called

Đang mở
#1,591 2 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 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"
};
```

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.