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:
+6
-13
@@ -29,7 +29,6 @@ describe('Application life cycle test', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function login(accessKey, secretKey, acceptLicense = false) {
|
async function login(accessKey, secretKey, acceptLicense = false) {
|
||||||
await clearCache();
|
|
||||||
await goto(`https://${app.fqdn}/login`, 'css=#accessKey');
|
await goto(`https://${app.fqdn}/login`, 'css=#accessKey');
|
||||||
await sendKeys('css=#accessKey', accessKey);
|
await sendKeys('css=#accessKey', accessKey);
|
||||||
await sendKeys('css=#secretKey', secretKey);
|
await sendKeys('css=#secretKey', secretKey);
|
||||||
@@ -37,17 +36,11 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
if (acceptLicense) await confirmLicense();
|
if (acceptLicense) await confirmLicense();
|
||||||
|
|
||||||
await waitFor('xpath=//button[contains(., "Create Bucket")]');
|
await waitFor('Create Bucket');
|
||||||
}
|
|
||||||
|
|
||||||
async function logout() {
|
|
||||||
await waitFor('xpath=//button[contains(., "Create Bucket")]');
|
|
||||||
await click('css=#sign-out');
|
|
||||||
await waitFor('css=#accessKey');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addBucket() {
|
async function addBucket() {
|
||||||
await click('xpath=//button[contains(., "Create Bucket")]');
|
await click('Create Bucket');
|
||||||
await sendKeys('css=#bucket-name', BUCKET);
|
await sendKeys('css=#bucket-name', BUCKET);
|
||||||
await click('css=#create-bucket');
|
await click('css=#create-bucket');
|
||||||
await waitFor(`xpath=//h1[contains(text(), "${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 admin login', login.bind(null, 'minioadmin', 'minioadmin', true));
|
||||||
it('can add bucket', addBucket);
|
it('can add bucket', addBucket);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
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('can admin login', login.bind(null, 'minioakey', 'minioskey', false));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
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('can admin login', login.bind(null, 'minioakey', 'minioskey', false));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
|
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
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('can admin login', login.bind(null, 'minioakey', 'minioskey', true));
|
||||||
it('has bucket', checkBucket);
|
it('has bucket', checkBucket);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
|
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|||||||
Reference in New Issue
Block a user