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