Added boilerplate for running end-to-end tests.\nThis is done using Protractor, which looks for a .gitignored file environment-protractor.js which contains the selenium endpoint url.
This commit is contained in:
parent
e68dc04900
commit
e3152188ef
|
@ -25,5 +25,6 @@ graph/*.png
|
||||||
graph/*.dot
|
graph/*.dot
|
||||||
|
|
||||||
webclient/config.js
|
webclient/config.js
|
||||||
|
webclient/test/environment-protractor.js
|
||||||
|
|
||||||
uploads
|
uploads
|
||||||
|
|
|
@ -1,9 +1,22 @@
|
||||||
Requires:
|
Requires:
|
||||||
- npm
|
- nodejs/npm
|
||||||
- npm install karma
|
- npm install karma
|
||||||
- npm install jasmine
|
- npm install jasmine
|
||||||
|
- npm install protractor (e2e testing)
|
||||||
|
|
||||||
Setting up continuous integration / run the tests:
|
Setting up continuous integration / run the unit tests (make sure you're in
|
||||||
|
this directory so it can find the config file):
|
||||||
karma start
|
karma start
|
||||||
|
|
||||||
|
Setting up e2e tests (only if you don't have a selenium server to run the tests
|
||||||
|
on. If you do, edit the config to point to that url):
|
||||||
|
webdriver-manager update
|
||||||
|
webdriver-manager start
|
||||||
|
|
||||||
|
Running e2e tests:
|
||||||
|
protractor protractor.conf.js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
describe("user page", function() {
|
||||||
|
it("should have a title", function() {
|
||||||
|
browser.get("http://matrix.org/alpha/#/login");
|
||||||
|
expect(browser.getTitle()).toEqual("[matrix]");
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,6 @@
|
||||||
|
var env = require("./environment-protractor.js");
|
||||||
|
|
||||||
|
exports.config = {
|
||||||
|
seleniumAddress: env.seleniumAddress,
|
||||||
|
specs: ['e2e/*.spec.js']
|
||||||
|
}
|
|
@ -21,13 +21,12 @@ describe("UserCtrl", function() {
|
||||||
|
|
||||||
getDisplayName: function(uid) {
|
getDisplayName: function(uid) {
|
||||||
var d = $q.defer();
|
var d = $q.defer();
|
||||||
// FIXME: everything goes into fire here
|
|
||||||
d.resolve({
|
d.resolve({
|
||||||
data: {
|
data: {
|
||||||
displayname: displayName
|
displayname: displayName
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return d;
|
return d.promise;
|
||||||
},
|
},
|
||||||
|
|
||||||
getProfilePictureUrl: function(uid) {
|
getProfilePictureUrl: function(uid) {
|
||||||
|
@ -37,7 +36,7 @@ describe("UserCtrl", function() {
|
||||||
avatar_url: avatarUrl
|
avatar_url: avatarUrl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return d;
|
return d.promise;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
scope = $rootScope.$new();
|
scope = $rootScope.$new();
|
||||||
|
@ -49,7 +48,6 @@ describe("UserCtrl", function() {
|
||||||
'$routeParams': routeParams,
|
'$routeParams': routeParams,
|
||||||
'matrixService': matrixService
|
'matrixService': matrixService
|
||||||
});
|
});
|
||||||
console.log("end inject");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue