After login success, testcafe throw an error of [object DOMException]
No matter I put Selector('.work_btn')
in constructor or before click, it throw out the same error, why?
Error Msg:
1) Error on page "...":
[object DOMException]
Browser: Chrome 62.0.3202 / Windows 7 0.0.0
30 | .click(this.loginButton);
31 |
32 | if (await this.workBetch.exists && await this.workBetch.visible) {
33 | // Enter
34 | await t
> 35 | .click(this.workBetch)
36 | .click(this.experienceProject)
My Test Code
// test.js
import ...
test('Login', async t => {
await new Page().init();
})
// Page.js
import ...
class Page {
constructor() {
this.loginAccout = Selector('#domain_account');
this.loginPass = Selector('#domain_password');
this.loginButton = Selector('#domain_submit');
}
async int() {
const workBetch = Selector('.work_btn');
await t
.typeText(this.loginAccout, BaseConfig.User.Account)
.typeText(this.loginPass, BaseConfig.User.Password)
.click(this.loginButton);
if (await workBetch.exists && await workBetch.visible) {
await t
.click(workBetch)
.click(....)
}
}
}
export default Page;