From 0bf99cc7ae7fcecd915dc540dc73757072c82844 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 1 May 2026 10:40:23 +0200 Subject: [PATCH] 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. --- test/test.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/test.js b/test/test.js index 6250cc2..33d13c8 100755 --- a/test/test.js +++ b/test/test.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { app, click, cloudronCli, goto, loginOIDC, sendKeys, setupBrowser, takeScreenshot, teardownBrowser, waitFor } from '@cloudron/charlie'; +import { app, clearCache, click, cloudronCli, goto, loginOIDC, sendKeys, setupBrowser, takeScreenshot, teardownBrowser, waitFor } from '@cloudron/charlie'; /* global it, describe, before, after, afterEach */ @@ -32,12 +32,6 @@ describe('Application life cycle test', function () { await loginOIDC('xpath=//span[contains(., "Bookmarks")] | //strong[text()="Successfully authenticated from Cloudron account."]'); } - async function logout() { - await goto(`https://${app.fqdn}/settings/preferences/appearance`, 'css=#logout'); - await click('css=#logout'); - await waitFor('css=#user_email'); - } - async function checkTimeline() { await goto(`https://${app.fqdn}/home`, 'Your home timeline is empty'); } @@ -70,7 +64,7 @@ describe('Application life cycle test', function () { it('registration is disabled', checkRegistrationClosed); it('can OIDC login', loginOidc); it('can see timeline', checkTimeline); - it('can logout', logout); + it('can logout', clearCache); it('backup app', cloudronCli.createBackup); it('restore app', cloudronCli.restoreFromLatestBackup); @@ -91,7 +85,7 @@ describe('Application life cycle test', function () { // test update it('can install app for update', cloudronCli.appstoreInstall); it('can OIDC login', loginOidc); - it('can logout', logout); + it('can logout', clearCache); it('can update', cloudronCli.update);