mirror of
https://git.cloudron.io/cloudron/syncthing-app
synced 2026-05-02 14:55:49 +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:
+4
-12
@@ -18,7 +18,6 @@ describe('Application life cycle test', function () {
|
||||
});
|
||||
|
||||
async function login(uname, pass) {
|
||||
await clearCache();
|
||||
await goto(`https://${app.fqdn}`, 'css=#user');
|
||||
await sendKeys('css=#user', uname);
|
||||
await sendKeys('css=#password', pass);
|
||||
@@ -26,13 +25,6 @@ describe('Application life cycle test', function () {
|
||||
await waitFor('Actions');
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await goto(`https://${app.fqdn}`, 'Actions');
|
||||
await click('Actions');
|
||||
await click('Log Out');
|
||||
await waitFor('css=#user');
|
||||
}
|
||||
|
||||
async function loadPage() {
|
||||
await goto(`https://${app.fqdn}`, 'Actions');
|
||||
}
|
||||
@@ -67,7 +59,7 @@ describe('Application life cycle test', function () {
|
||||
it('can login', login.bind(null, username, password));
|
||||
it('can load page', loadPage);
|
||||
it('can add folder', addFolder);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('backup app', cloudronCli.createBackup);
|
||||
it('restore app', cloudronCli.restoreFromLatestBackup);
|
||||
@@ -75,14 +67,14 @@ describe('Application life cycle test', function () {
|
||||
it('can login', login.bind(null, username, password));
|
||||
it('can load page', loadPage);
|
||||
it('can check folder', checkFolder);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('move to different location', cloudronCli.changeLocation);
|
||||
|
||||
it('can login', login.bind(null, username, password));
|
||||
it('can load page', loadPage);
|
||||
it('can check folder', checkFolder);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('uninstall app', cloudronCli.uninstall);
|
||||
|
||||
@@ -91,7 +83,7 @@ describe('Application life cycle test', function () {
|
||||
it('can login', login.bind(null, username, password));
|
||||
it('can load page', loadPage);
|
||||
it('can add folder', addFolder);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('can update', cloudronCli.update);
|
||||
it('can login', login.bind(null, username, password));
|
||||
|
||||
Reference in New Issue
Block a user