Closed hang-ren closed 6 years ago
File ../modules/desinerlogin:
import { t } from 'testcafe';
var logindata = require('../data/designerlogin.js');
export default class LoginCSS {
constructor () {
this.logina = logindata.logina;
this.loginpage = logindata.loginpage;
this.usernameInput = logindata.usernameInput;
this.pwdInput = logindata.pwdInput;
this.loginBtn = logindata.loginBtn;
this.loginLink = logindata.loginLink;
}
async login () {
await t
.maximizeWindow()
.wait(5000)
.click(this.logina)
.wait(2000)
.switchToIframe( this.loginpage )
.wait(2000)
.typeText(this.usernameInput,logindata.usname)
.wait(2000)
.typeText(this.pwdInput, logindata.pwd)
.wait(2000)
.click(this.loginBtn)
.wait(2000)
.switchToMainWindow()
.wait(2000)
}
}
File ../data/desinerlogin:
import { Selector } from 'testcafe';
var usname = "13621084964";
var pwd = "123456";
var logina = Selector('li[id="no-login"]');
var loginpage = Selector('iframe[id="login-iframe"]');
var usernameInput = Selector('input[placeholder="手机/邮箱/用户名"]');
var pwdInput = Selector('input[placeholder="密码"]');
var loginBtn = Selector('a[class="sso-submit"]');
exports.usname = usname;
exports.pwd = pwd;
exports.logina = logina;
exports.loginpage = loginpage;
exports.usernameInput = usernameInput;
exports.pwdInput = pwdInput;
exports.loginBtn = loginBtn;
@hang-ren, thank you for your report. We are aware about this problem - it occurs when the colsole.log
method is called in the iframe before we initialize some of our stuff (you can see more information in this issue).
We will fix it ASAP.
@helen-dikareva, thanks Helen!
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.
Are you requesting a feature or reporting a bug?
A bug
What is the current behavior?
Throw exception that block my test.
What is the expected behavior?
Run pass.
How would you reproduce the current behavior (if this is a bug)?
Just run my case. It will pass if ran it manually.
Provide the test code and the tested page URL (if applicable)
Tested page URL: https://alpha-www.shejijia.com/ Test code
Specify your