diff --git a/test/test.js b/test/test.js index 33d13c8..6c7842f 100755 --- a/test/test.js +++ b/test/test.js @@ -14,9 +14,9 @@ describe('Application life cycle test', function () { }); async function checkRegistrationClosed() { - await goto(`https://${app.fqdn}`, 'xpath=//div[@class="sign-in-banner"]/descendant::button/span[contains(text(), "Create account")] | //div[@class="sign-in-banner"]/descendant::a/span[contains(text(), "Create account")]'); - await click('xpath=//div[@class="sign-in-banner"]/descendant::button/span[contains(text(), "Create account")] | //div[@class="sign-in-banner"]/descendant::a/span[contains(text(), "Create account")]'); - await waitFor('is currently not possible'); + await goto(`https://${app.fqdn}`, 'Create account'); + await click('Create account'); + await waitFor(/is currently not possible/); } async function login(addr, pass) { @@ -27,13 +27,13 @@ describe('Application life cycle test', function () { } async function loginOidc() { - await goto(`https://${app.fqdn}/auth/sign_in`, 'xpath=//a[contains(@class, "button") and text()="Cloudron"]'); - await click('xpath=//a[contains(@class, "button") and text()="Cloudron"]'); - await loginOIDC('xpath=//span[contains(., "Bookmarks")] | //strong[text()="Successfully authenticated from Cloudron account."]'); + await goto(`https://${app.fqdn}/auth/sign_in`, 'Cloudron'); + await click('Cloudron'); + await loginOIDC(/Bookmarks|Successfully authenticated from Cloudron account\./); } async function checkTimeline() { - await goto(`https://${app.fqdn}/home`, 'Your home timeline is empty'); + await goto(`https://${app.fqdn}/home`, /Your home timeline is empty/); } // No SSO @@ -53,7 +53,7 @@ describe('Application life cycle test', function () { }); it('shows confirmation page', async function () { - await waitFor('xpath=//a[@href="/auth/confirmation/new"] | //form[@id="edit_user_1"]'); + await waitFor('css=a[href="/auth/confirmation/new"], form#edit_user_1'); }); it('uninstall app (no sso)', cloudronCli.uninstall);