Girish Ramakrishnan 7 rokov pred
rodič
commit
f93096b7e3
1 zmenil súbory, kde vykonal 9 pridanie a 3 odobranie
  1. 9 3
      test/test.js

+ 9 - 3
test/test.js

@@ -112,6 +112,9 @@ describe('Application life cycle test', function () {
             return browser.wait(until.elementLocated(by.xpath('//*[contains(text(), "New Repository")]')), TIMEOUT);
         }).then(function () {
             return browser.findElement(by.id('repo_name')).sendKeys(reponame);
+        }).then(function () {
+            var button = browser.findElement(by.xpath('//button[contains(text(), "Create Repository")]'));
+            return browser.executeScript('arguments[0].scrollIntoView(true)', button);
         }).then(function () {
             return browser.findElement(by.id('auto-init')).click();
         }).then(function () {
@@ -147,7 +150,7 @@ describe('Application life cycle test', function () {
             return browser.executeScript('arguments[0].CodeMirror.setValue("' + text + '");', cm);
         }).then(function () {
             return browser.findElement(by.xpath('//input[@name="commit_summary"]')).sendKeys('Dummy edit');
-        })..then(function () {
+        }).then(function () {
             return browser.findElement(by.xpath('//button[contains(text(), "Commit Changes")]')).click();
         }).then(function () {
             waitForUrl('https://' + app.fqdn + '/' + username + '/' + reponame + '/src/master/newfile', done);
@@ -170,14 +173,17 @@ describe('Application life cycle test', function () {
     }
 
     function addPublicKey(done) {
-        browser.get('https://' + app.fqdn + '/user/settings/ssh').then(function () {
-            var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
+        var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
 
+        browser.get('https://' + app.fqdn + '/user/settings/ssh').then(function () {
             return browser.findElement(by.xpath('//div[text()="Add Key"]')).click();
         }).then(function () {
             return browser.findElement(by.id('title')).sendKeys('testkey');
         }).then(function () {
             return browser.findElement(by.id('content')).sendKeys(publicKey.trim()); // #3480
+        }).then(function () {
+            var button = browser.findElement(by.xpath('//button[contains(text(), "Add Key")]'));
+            return browser.executeScript('arguments[0].scrollIntoView(false)', button);
         }).then(function () {
             return browser.findElement(by.xpath('//button[contains(text(), "Add Key")]')).click();
         }).then(function () {