mirror of
https://git.cloudron.io/cloudron/gitea-app.git
synced 2024-11-29 03:30:59 +00:00
fix the tests
This commit is contained in:
parent
24893502f5
commit
a71425cbab
1 changed files with 7 additions and 7 deletions
14
test/test.js
14
test/test.js
|
@ -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);
|
browser.wait(until.elementLocated(by.linkText('Dashboard')), 4000).then(done);
|
||||||
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);
|
browser.wait(until.elementLocated(by.xpath('p[contains(text(), "added successfully!")]')), 4000).then(done);
|
||||||
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);
|
}, 4000).then(done);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('displays correct clone url', function (done) {
|
it('displays correct clone url', function (done) {
|
||||||
|
|
Loading…
Reference in a new issue