mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2026-05-01 15:02:35 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0e98b3ea0 | |||
| 335940ab4a | |||
| 7c3fa660e0 |
+6
-26
@@ -4,22 +4,7 @@ import assert from 'node:assert/strict';
|
|||||||
import { execSync } from 'node:child_process';
|
import { execSync } from 'node:child_process';
|
||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import {
|
import { app, clearCache, click, cloudronCli, goto, loginOIDC, sendKeys, setupBrowser, takeScreenshot, teardownBrowser, username, waitFor, waitForUrl, press } from '@cloudron/charlie';
|
||||||
app,
|
|
||||||
clearCache,
|
|
||||||
click,
|
|
||||||
cloudronCli,
|
|
||||||
goto,
|
|
||||||
loginOIDC,
|
|
||||||
sendKeys,
|
|
||||||
setupBrowser,
|
|
||||||
takeScreenshot,
|
|
||||||
teardownBrowser,
|
|
||||||
username,
|
|
||||||
waitFor,
|
|
||||||
waitForUrl,
|
|
||||||
press
|
|
||||||
} from '@cloudron/charlie';
|
|
||||||
|
|
||||||
/* global it, describe, before, after, afterEach */
|
/* global it, describe, before, after, afterEach */
|
||||||
|
|
||||||
@@ -36,7 +21,7 @@ describe('Application life cycle test', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async function () {
|
afterEach(async function () {
|
||||||
await takeScreenshot(this.currentTest.title);
|
await takeScreenshot(this.currentTest);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function login(user, passwd) {
|
async function login(user, passwd) {
|
||||||
@@ -52,16 +37,11 @@ describe('Application life cycle test', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function loginGiteaOIDC() {
|
async function loginGiteaOIDC() {
|
||||||
await clearCache();
|
|
||||||
await goto(`https://${app.fqdn}/user/login`, /Sign in with/);
|
await goto(`https://${app.fqdn}/user/login`, /Sign in with/);
|
||||||
await click(/Sign in with/);
|
await click(/Sign in with/);
|
||||||
await loginOIDC('Milestones');
|
await loginOIDC('Milestones');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logout() {
|
|
||||||
await clearCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function addPublicKey() {
|
async function addPublicKey() {
|
||||||
const keyPath = path.join(import.meta.dirname, 'id_ed25519');
|
const keyPath = path.join(import.meta.dirname, 'id_ed25519');
|
||||||
fs.chmodSync(keyPath, 0o600);
|
fs.chmodSync(keyPath, 0o600);
|
||||||
@@ -108,7 +88,7 @@ describe('Application life cycle test', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can admin login', adminLogin);
|
it('can admin login', adminLogin);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
|
|
||||||
it('can login', loginGiteaOIDC);
|
it('can login', loginGiteaOIDC);
|
||||||
|
|
||||||
@@ -149,11 +129,11 @@ describe('Application life cycle test', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can admin login (no sso)', adminLogin);
|
it('can admin login (no sso)', adminLogin);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
|
|
||||||
it('uninstall app (no sso)', cloudronCli.uninstall);
|
it('uninstall app (no sso)', cloudronCli.uninstall);
|
||||||
|
|
||||||
it('can install app from appstore', async function () {
|
it('can install app for update', async function () {
|
||||||
await cloudronCli.appstoreInstall({ tcpPortFlags: INSTALL_TCP_FLAGS });
|
await cloudronCli.appstoreInstall({ tcpPortFlags: INSTALL_TCP_FLAGS });
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -166,7 +146,7 @@ describe('Application life cycle test', function () {
|
|||||||
it('can update', cloudronCli.update);
|
it('can update', cloudronCli.update);
|
||||||
|
|
||||||
it('can admin login', adminLogin);
|
it('can admin login', adminLogin);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
|
|
||||||
it('can login', loginGiteaOIDC);
|
it('can login', loginGiteaOIDC);
|
||||||
it('can clone the url', cloneRepo);
|
it('can clone the url', cloneRepo);
|
||||||
|
|||||||
Reference in New Issue
Block a user