1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2026-05-02 23:25:50 +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:
Girish Ramakrishnan
2026-05-01 10:40:49 +02:00
parent b3fce86d02
commit 231a7485a4
+6 -13
View File
@@ -29,7 +29,6 @@ describe('Application life cycle test', function () {
}
async function login(accessKey, secretKey, acceptLicense = false) {
await clearCache();
await goto(`https://${app.fqdn}/login`, 'css=#accessKey');
await sendKeys('css=#accessKey', accessKey);
await sendKeys('css=#secretKey', secretKey);
@@ -37,17 +36,11 @@ describe('Application life cycle test', function () {
if (acceptLicense) await confirmLicense();
await waitFor('xpath=//button[contains(., "Create Bucket")]');
}
async function logout() {
await waitFor('xpath=//button[contains(., "Create Bucket")]');
await click('css=#sign-out');
await waitFor('css=#accessKey');
await waitFor('Create Bucket');
}
async function addBucket() {
await click('xpath=//button[contains(., "Create Bucket")]');
await click('Create Bucket');
await sendKeys('css=#bucket-name', BUCKET);
await click('css=#create-bucket');
await waitFor(`xpath=//h1[contains(text(), "${BUCKET}")]`);
@@ -81,7 +74,7 @@ describe('Application life cycle test', function () {
it('can admin login', login.bind(null, 'minioadmin', 'minioadmin', true));
it('can add bucket', addBucket);
it('can logout', logout);
it('can logout', clearCache);
it('does redirect', checkRedirect);
it('check api', checkApi);
@@ -91,7 +84,7 @@ describe('Application life cycle test', function () {
it('can admin login', login.bind(null, 'minioakey', 'minioskey', false));
it('has bucket', checkBucket);
it('can logout', logout);
it('can logout', clearCache);
it('does redirect', checkRedirect);
it('check api', checkApi);
@@ -100,7 +93,7 @@ describe('Application life cycle test', function () {
it('can admin login', login.bind(null, 'minioakey', 'minioskey', false));
it('has bucket', checkBucket);
it('can logout', logout);
it('can logout', clearCache);
it('does redirect', checkRedirect);
it('check api', checkApi);
@@ -109,7 +102,7 @@ describe('Application life cycle test', function () {
it('can admin login', login.bind(null, 'minioakey', 'minioskey', true));
it('has bucket', checkBucket);
it('can logout', logout);
it('can logout', clearCache);
it('does redirect', checkRedirect);
it('check api', checkApi);