mirror of
https://git.cloudron.io/cloudron/freshrss-app
synced 2026-05-09 09:55:51 +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
-11
@@ -32,18 +32,10 @@ describe('Application life cycle test', function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function loginViaOIDC() {
|
async function loginViaOIDC() {
|
||||||
await clearCache();
|
|
||||||
await goto(`https://${app.fqdn}/i/`);
|
await goto(`https://${app.fqdn}/i/`);
|
||||||
await loginOIDC('css=#btn-subscription');
|
await loginOIDC('css=#btn-subscription');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logout() {
|
|
||||||
await goto(`https://${app.fqdn}`, 'css=#stream');
|
|
||||||
await click('css=.dropdown-toggle');
|
|
||||||
await click('xpath=//li/*[contains(@class,"signout")]');
|
|
||||||
await waitFor('css=#loginButton');
|
|
||||||
}
|
|
||||||
|
|
||||||
async function addSubscription() {
|
async function addSubscription() {
|
||||||
const url = 'https://blog.cloudron.io/rss/';
|
const url = 'https://blog.cloudron.io/rss/';
|
||||||
const addUrl = app.manifest.version === '1.10.0' ? `${baseUrl()}/i/?c=subscription` : `${baseUrl()}/i/?c=subscription&a=add`;
|
const addUrl = app.manifest.version === '1.10.0' ? `${baseUrl()}/i/?c=subscription` : `${baseUrl()}/i/?c=subscription&a=add`;
|
||||||
@@ -59,11 +51,11 @@ describe('Application life cycle test', function () {
|
|||||||
|
|
||||||
if (relogin) {
|
if (relogin) {
|
||||||
await sendKeys('css=#passwordPlain', admin_password);
|
await sendKeys('css=#passwordPlain', admin_password);
|
||||||
await click('xpath=//button[contains(.,"Login")]');
|
await click('Login');
|
||||||
}
|
}
|
||||||
|
|
||||||
await click('css=#api_enabled');
|
await click('css=#api_enabled');
|
||||||
await click('xpath=//button[text()="Submit"]');
|
await click('Submit');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkApiConfiguration() {
|
async function checkApiConfiguration() {
|
||||||
@@ -92,7 +84,7 @@ describe('Application life cycle test', function () {
|
|||||||
it('can check configuration', checkApiConfiguration);
|
it('can check configuration', checkApiConfiguration);
|
||||||
it('subscription exists', subscriptionExists);
|
it('subscription exists', subscriptionExists);
|
||||||
it('can get static extension file', getStaticExtensionFile);
|
it('can get static extension file', getStaticExtensionFile);
|
||||||
it('can logout', logout);
|
it('can logout', clearCache);
|
||||||
it('uninstall app', cloudronCli.uninstall);
|
it('uninstall app', cloudronCli.uninstall);
|
||||||
|
|
||||||
// SSO
|
// SSO
|
||||||
|
|||||||
Reference in New Issue
Block a user