Files
angular.js/test/e2e/tests/helpers/main.js
Caitlin Potter 2240c113f5 chore(tests): implement e2e test harness outside of docs app
Included:

- A sample test fixture
- A sample test
- Server middleware to serve the E2E harness
- Convenient test helpers to simplify loading the right fixture

Closes #9557
Closes #9527
2014-10-20 11:26:09 -04:00

24 lines
481 B
JavaScript

var helper = {
andWaitForAngular: function() {
browser.waitForAngular();
},
loadFixture: function(fixture) {
var i = 0;
while (fixture[i] === '/') ++i;
fixture = fixture.slice(i);
if (!/\/(index\.html)?$/.test(fixture)) {
fixture += '/';
}
if (process.env.USE_JQUERY) {
fixture += '?jquery';
}
browser.get('/e2e/fixtures/' + fixture);
return helper;
}
};
global.test = helper;
global.loadFixture = helper.loadFixture;