【问题标题】:.Error Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.Error 在 jasmine.DEFAULT_TIMEOUT_INTERVAL 指定的超时时间内未调用异步回调
【发布时间】:2019-11-04 05:30:03
【问题描述】:

conf.js

exports.config = {

    directConnect: true,

    framework: 'jasmine',
    //seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['FirstTestcase.js'],

    asmineNodeOpts: {
      defaultTimeoutInterval: 20000
    },

    capabilities: {
        browserName: 'chrome'
      }

}

testcase.js

describe("my first test case",function(){
    it("execute test case",function(){
        browser.waitForAngularEnabled(false);    
        browser.get("");
            element(By.id("username")).sendKeys("test");
            element(By.id("tenant")).sendKeys("demo");
            element(By.id("continue")).click();
            element(By.id("password")).sendKeys("test");
            element(By.id("login")).click();
            browser.waitForAngularEnabled(true);


    });
});

我面临的问题是。我的登录页面不是用 angular js 开发的,一旦我登录,应用程序就是 angular js。

点击代码登录后

我试过了

beforeEach(function(done) {
    setTimeout(function() {
        value = 0;
        done();
    }, 6000);
}) 

但没有任何帮助。

谁能给出解决方案?

【问题讨论】:

  • 可能是因为你有asmineNodeOpts 而不是jasmineNodeOpts

标签: javascript node.js angularjs jasmine protractor


【解决方案1】:

尝试增加 - jasmineNodeOpts.defaultTimeoutInterval: 20000 到 jasmineNodeOpts.defaultTimeoutInterval: 120000 是 20 秒 2分钟

由于您的配置文件中有 jasmineNodeOpts.defaultTimeoutInterval: 20000,因此测试中的每个块函数 = beforeAll、beforeEach、afterEach 和 afterAll 以及 it() 都应在 20 秒内分别完成,否则运行器会出现超时错误并显示你得到的错误。

【讨论】:

  • 你能告诉我拒绝投票的原因吗?
猜你喜欢
  • 1970-01-01
  • 2016-04-21
  • 2014-05-01
  • 1970-01-01
  • 2018-07-30
  • 2016-05-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多