fix the tests

This commit is contained in:
Girish Ramakrishnan 2015-11-25 00:56:04 -08:00
parent 24893502f5
commit a71425cbab
1 changed files with 7 additions and 7 deletions

View File

@ -31,11 +31,14 @@ describe('Application life cycle test', function () {
var SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
server = new SeleniumServer(seleniumJar.path, { port: 4444 });
server.start();
done();
});
after(function () {
after(function (done) {
browser.quit();
server.stop();
done();
});
var LOCATION = 'test' + Date.now();
@ -73,8 +76,7 @@ describe('Application life cycle test', function () {
browser.findElement(by.id('user_name')).sendKeys(username);
browser.findElement(by.id('password')).sendKeys(password);
browser.findElement(by.tagName('form')).submit();
browser.wait(until.elementLocated(by.linkText('Dashboard')), 4000);
done();
browser.wait(until.elementLocated(by.linkText('Dashboard')), 4000).then(done);
});
it('can add public key', function (done) {
@ -85,8 +87,7 @@ describe('Application life cycle test', function () {
browser.findElement(by.id('title')).sendKeys('testkey');
browser.findElement(by.id('content')).sendKeys(publicKey);
browser.findElement(by.xpath('//button[contains(text(), "Add Key")]')).click();
browser.wait(until.elementLocated(by.xpath('p[contains(text(), "added successfully!")]')), 4000);
done();
browser.wait(until.elementLocated(by.xpath('p[contains(text(), "added successfully!")]')), 4000).then(done);
});
it('can create repo', function (done) {
@ -100,8 +101,7 @@ describe('Application life cycle test', function () {
return browser.getCurrentUrl().then(function (url) {
return url === 'https://' + app.fqdn + '/' + username + '/' + reponame;
});
}, 4000);
done();
}, 4000).then(done);
});
it('displays correct clone url', function (done) {