我遇到了以下问题:
Failures:
1) Signin page should allow user to signin
Message:
Failed: Angular could not be found on the page http://localhost:8080/#/signin : retries looking for angular exceeded
Stack:
Error: Failed: Angular could not be found on the page http://localhost:8080/#/signin : retries looking for angular exceeded
at /var/go/node_modules/jasminewd2/index.js:104:16
at /var/go/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/var/go/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
at notify (/var/go/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
Message:
Failed: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
Stack:
Error: Failed: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
at /var/go/node_modules/jasminewd2/index.js:104:16
at /var/go/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/var/go/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
at notify (/var/go/node_modules/selenium-webdriver/lib/webdriver/promise.js:465:12)
1 spec, 1 failure
Finished in 10.742 seconds
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #1 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
Command ./snapci/end2end_tests.sh failed with status 1. Took 2 minutes 54.9 seconds.
我使用量角器1.8.0。
这是我的量角器配置:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['test/e2e/*.spec.e2e.js'],
framework: 'jasmine2'
};
if (process.env.SNAP_CI) {
exports.config.chromeDriver = '/usr/local/bin/chromedriver';
exports.config.chromeOnly= true;
}
有人可以帮忙吗?
编辑1 :来自规范:
describe('Signin page', function () {
beforeEach(function(){
browser.get('http://localhost:8080/#/signin');
browser.refresh();
});
it('should allow user to signin', function () {
element(by.model('credentials.username')).sendKeys('balteo@example.fr');
element(by.model('credentials.password')).sendKeys('------');
element(by.id('submit')).click();
expect(element(by.tagName('h2')).getText()).toBe('Dashboard');
});
});
来自index.html(包括登录视图):
<!DOCTYPE html>
<html lang="fr" ng-app="bignibou" ng-strict-di>
<head>
编辑2 :以下是我运行量角器的方法。我想到,在量角器启动的时候,java应用程序可能还没有启动...有没有办法确保应用程序有机会通过使用bash shell启动?
#Install and start application
./gradlew assemble
java -jar bignibou-server/build/libs/bignibou-server.jar&
#Run end2end tests
node_modules/.bin/protractor bignibou-client/protractor.conf.js