我们已经有一个应用程序正在为 CI 添加测试用例。
我们有一个小代码尝试登录过程并检查可能的登录状态(如成功、失败、无效帐户帐户锁定等)后会发生什么。
所以我尝试了以下代码。
visit('/login')
.fillIn('#identification', "testuser")
.fillIn('#password', "testpass")
.click('input[type="submit"]')
andThen(function(){
ok(!exists('button:contains(sign in)'), '3. Login button is not displayed when authenticated');
ok(exists('.dropDownMenuOptions li:contains(Logout)'), '4. Logout button is displayed when authenticated');
});
它在控制台中给出以下错误。
ember.debug.js:5162 Uncaught Error: Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in a run
执行单击后会发生此错误。当单击对服务器进行 AJAX 调用并在其响应时进行路由转换。
对于成功登录的情况,我想检查我的路线是否因此错误而无法/login
更改。/
请建议。
谢谢