Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/372.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 量角器:未定义:堆栈跟踪_Javascript_Angularjs_Testing_Selenium Webdriver_Protractor - Fatal编程技术网

Javascript 量角器:未定义:堆栈跟踪

Javascript 量角器:未定义:堆栈跟踪,javascript,angularjs,testing,selenium-webdriver,protractor,Javascript,Angularjs,Testing,Selenium Webdriver,Protractor,我正在尝试基于量角器的角度js测试。我现在掌握的线索是 Starting selenium standalone server... Selenium standalone server started at http://192.168.0.150:51197/wd/hub F Failures: 1) E2E: The Dashboard : Main Page should have a working dashboard Message: timeout: tim

我正在尝试基于量角器的角度js测试。我现在掌握的线索是

Starting selenium standalone server...
Selenium standalone server started at http://192.168.0.150:51197/wd/hub
F

Failures:

  1) E2E: The Dashboard : Main Page should have a working dashboard
   Message:
     timeout: timed out after 5000 msec waiting for spec to complete
   Stacktrace:
     undefined

Finished in 5.659 seconds
1 test, 1 assertion, 1 failure
正在关闭selenium独立服务器。 这是我的规范

describe('E2E: Open Login Page', function() {
  var driver = browser.driver;
  driver.get('http://localhost:8080/accounts/login/?next=/dashboard/')
  driver.findElement(By.name("username")).sendKeys("user");
  driver.findElement(By.name("password")).sendKeys('password');
  //driver.findElement(By.xpath("\\button[]")
  driver.findElement(By.xpath("//button[contains(text(), 'Login')]")).click();
});

describe('E2E: The Dashboard', function() {
  var ptor = protractor.getInstance();

  describe(': Main Page', function() {
    it('should have a working dashboard', function() {
      ptor.get('/dashboard/#/');
      expect(ptor.getTitle()).toContain('Dashboard');
    })
  })
});

我做错了什么??请确保您正在运行应用程序
http://localhost:8080
。量角器不会启动应用程序服务器,只会启动selenium服务器

如果必须在一个会话中完成这一切,则可以运行如下命令:

nohup bash -c "RAILS_ENV=test bundle exec rails s &";

启动服务器(在本例中为rails测试服务器)并将输出附加到nohup.out。然后可以运行命令启动量角器测试。我建议在该命令之后插入一个sleep,以便在量角器测试开始执行之前给应用程序服务器足够的时间站起来

您是否添加了一些跟踪来识别阻塞指令?“当Jasmine取消测试时,它没有堆栈跟踪,只是超时。”如图所示