1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2025-09-14 17:09:09 +00:00

Fixup tests

This commit is contained in:
Johannes Zellner
2023-11-15 12:50:25 +01:00
parent 90693772de
commit 3e95af2256
6 changed files with 26 additions and 32 deletions

View File

@@ -132,11 +132,25 @@ describe('Application life cycle test', function () {
}
async function addPublicKey() {
var publicKey = fs.readFileSync(__dirname + '/id_rsa.pub', 'utf8');
var publicKey = fs.readFileSync(__dirname + '/id_ed25519.pub', 'utf8');
const sshPage = 'https://' + app.fqdn + '/user/settings/keys';
await browser.get('https://' + app.fqdn + '/user/settings/keys');
await browser.get(sshPage);
await browser.wait(until.elementLocated(By.id('add-ssh-button')), TIMEOUT);
await browser.findElement(By.id('add-ssh-button')).click();
await browser.findElement(By.id('ssh-key-title')).sendKeys('testkey');
await browser.findElement(By.id('ssh-key-content')).sendKeys(publicKey.trim()); // #3480
var button = browser.findElement(By.xpath('//button[contains(text(), "Add Key")]'));
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
await browser.findElement(By.xpath('//form//button[contains(text(),"Add Key")]')).click();
await browser.wait(until.elementLocated(By.xpath('//p[contains(text(), "has been added.")]')), TIMEOUT);
}
async function addPublicKeyOld() {
var publicKey = fs.readFileSync(__dirname + '/id_ed25519.pub', 'utf8');
await browser.get('https://' + app.fqdn + '/user/settings/keys');
await browser.wait(until.elementLocated(By.id('add-ssh-button')), TIMEOUT);
await browser.findElement(By.id('add-ssh-button')).click();