requirejs / requirejs

A file and module loader for JavaScript
https://requirejs.org/
Other
12.93k stars 2.38k forks source link

e2e with protractor, requireJs, angular #1292

Open McRaj opened 9 years ago

McRaj commented 9 years ago

I'm trying to run my e2e test with protractor. I have angular manually bootstraped.

here's my config:

exports.config = { allScriptsTimeout: 15000,

seleniumServerJar: '../node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-2.40.0.jar',

specs: [

'test/e2e/spec/*.js'

],

chromeDriver: '../test/lib/chromedriver/2.9/chromedriver_win32/chromedriver',

capabilities: { 'browserName': 'chrome', 'chromeOptions': { 'args': [ ], 'extensions': [

  ]
}

},

baseUrl: 'http://localhost:3000',

framework: 'jasmine'

};

I get this error Error: Angular could not be found on the page http://localhost:3000/ : retries looking for angular exceeded

in my requirejs main file, i'm including angular function() { angular.element(document).ready(function() { FastClick.attach(document.body); angular.bootstrap(document, ['App']); }); }

but in the protractor page, it says that angular should be added with 'ng-app' . but requirejs needs angular bootstrapped. ...

if anyone has done e2e tests with protractor requirejs, angular, please let me know what the solution / fix is.

jagsinghk commented 8 years ago

were you able to solve this? I am having similar issue.

mohammadwali commented 8 years ago

I like this way - http://stackoverflow.com/a/34320632/2940233