mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-11 07:43:28 +08:00
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
24 lines
481 B
JavaScript
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;
|