mllrsohn / gulp-protractor

gulp wrapper for protractor tests
MIT License
136 stars 82 forks source link

Getting 'angular never provided resumeBootstrap' #108

Closed ekarudianto closed 8 years ago

ekarudianto commented 8 years ago

been using gulp-protractor for my starter template. I have some trouble when creating a testcase here is my configuration files

gulpfile.js

var gulp = require('gulp')
var protractor = require('gulp-protractor').protractor
var webdriver_update = require('gulp-protractor').webdriver_update;

gulp.task('test:end', ['webdriver_update'], function () {

    gulp.src('./test/e2e/**/*.spec.js')
        .pipe(protractor({
            configFile: 'protractor.conf.js'
        }))

});

gulp.task('webdriver_update', webdriver_update);

up til now all is well. Then the issue appear when I trying to write a test spec

protractor.conf.js


exports.config = {
    specs: ['test/e2e/**/*.spec.js'],
    baseUrl: 'http://127.0.0.1:9010'
};

home.spec.js

describe('Binding angular starter template homepage', function () {

    beforeEach(function () {
        browser.get('#/home');
    });

    it('should print correct title', function () {
        expect(browser.getTitle()).toBe('Binding angular starter template');
    });

});

when I did a gulp test:end I got below errors

[18:42:00] Using gulpfile C:\xampp\htdocs\binding-angular\gulpfile.js
[18:42:00] Starting 'webdriver_update'...
selenium standalone is up to date.
chromedriver is up to date.
[18:42:01] Finished 'webdriver_update' after 490 ms
[18:42:01] Starting 'test:end'...
[18:42:01] Finished 'test:end' after 7.83 ms
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.0.12:55965/wd/hub
Started
F

Failures:
1) Binding angular starter template homepage should print correct title
  Message:
    Failed: Angular could not be found on the page http://127.0.0.1:9010/#/home : angular never provided resumeBootstrap
  Stack:
    Error: Angular could not be found on the page http://127.0.0.1:9010/#/home : angular never provided resumeBootstrap
        at C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\built\protractor.js:680:17
        at Promise.invokeCallback_ (C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1329:14)
        at TaskQueue.execute_ (C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2790:14)
        at TaskQueue.executeNext_ (C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2773:21)
        at C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2652:27
        at C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:639:7
        at process._tickCallback (node.js:369:9)
    From: Task: Run beforeEach in control flow
        at Object.<anonymous> (C:\xampp\htdocs\binding-angular\node_modules\gulp-protractor\node_modules\protractor\node_modules\jasminewd2\index.js:81:14)
    From asynchronous test:
    Error
        at Suite.<anonymous> (C:\xampp\htdocs\binding-angular\test\e2e\home.spec.js:3:5)
        at Object.<anonymous> (C:\xampp\htdocs\binding-angular\test\e2e\home.spec.js:1:1)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)

1 spec, 1 failure
Finished in 11.433 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #01 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: protractor exited with code 1

I get Angular could not be found on the page http://127.0.0.1:9010/#/home : angular never provided resumeBootstrap I'm not sure why I getting that error.. could anyone help me ?

below is my app files for angular bootstrap

app.js

'use strict';

require('./controllers/controllers');
require('./directives/directives');
require('./filters/filters');
require('./services/services');
require('./app.bootstrap');

var app = angular.module('app', [
    'ngRoute',
    'ngCookies',
    'app.controllers',
    'app.directives',
    'app.filters',
    'app.services'
]);

/**
 * route collections
 */

app.config(require('./app.routes'));

/**
 * constant / value collections
 */

app.constant('CONFIG', require('./app.config'));

/**
 * run method
 */

app.run(require('./app.run'));

/**
 * exports module
 */

module.exports = app;

app.bootstrap.js

'use strict';

/**
 * manual bootstraping
 */

angular.element(document).ready(function () {
    angular.bootstrap(document, ['app']);
});
ekarudianto commented 8 years ago

resolved the issue by including browser.ignoreSynchronization = true;