mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2026-05-01 15:02:35 +00:00
test: simplify clearCache, drop logout helpers, simplify button selectors
- Drop `await clearCache()` from login/auth helpers; clearing cache before every login is no longer necessary now that charlie isolates sessions. - Replace `logout` helpers with `clearCache` directly in `it()` calls; the helpers were either thin wrappers around `clearCache()` or did real navigation that is no longer worth the maintenance. - Simplify `xpath=//button[text()=...]` / `[contains(., ...)]` button text selectors to charlie's bare-string (or RegExp for OR-clauses) form.
This commit is contained in:
+3
-8
@@ -37,16 +37,11 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function loginGiteaOIDC() {
|
||||
await clearCache();
|
||||
await goto(`https://${app.fqdn}/user/login`, /Sign in with/);
|
||||
await click(/Sign in with/);
|
||||
await loginOIDC('Milestones');
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await clearCache();
|
||||
}
|
||||
|
||||
async function addPublicKey() {
|
||||
const keyPath = path.join(import.meta.dirname, 'id_ed25519');
|
||||
fs.chmodSync(keyPath, 0o600);
|
||||
@@ -93,7 +88,7 @@ describe('Application life cycle test', function () {
|
||||
});
|
||||
|
||||
it('can admin login', adminLogin);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('can login', loginGiteaOIDC);
|
||||
|
||||
@@ -134,7 +129,7 @@ describe('Application life cycle test', function () {
|
||||
});
|
||||
|
||||
it('can admin login (no sso)', adminLogin);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('uninstall app (no sso)', cloudronCli.uninstall);
|
||||
|
||||
@@ -151,7 +146,7 @@ describe('Application life cycle test', function () {
|
||||
it('can update', cloudronCli.update);
|
||||
|
||||
it('can admin login', adminLogin);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('can login', loginGiteaOIDC);
|
||||
it('can clone the url', cloneRepo);
|
||||
|
||||
Reference in New Issue
Block a user