From 317c03bba2508335539557a4bd625e7375e033e5 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 24 Apr 2026 18:32:38 +0200 Subject: [PATCH] test: switch waitForElement to waitFor Made-with: Cursor --- test/test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test.js b/test/test.js index 3c7fb7f..c2f41f6 100755 --- a/test/test.js +++ b/test/test.js @@ -19,7 +19,7 @@ import { takeScreenshot, teardownBrowser, username, - waitForElement, + waitFor, waitForUrl } from '@cloudron/charlie'; @@ -46,7 +46,7 @@ describe('Application life cycle test', function () { await click('//label[contains(text(), "Use Custom Avatar")]'); await setInputFiles('//input[@type="file" and @name="avatar"]', path.resolve(import.meta.dirname, '../logo.png')); await click('//button[contains(text(), "Update Avatar")]'); - await waitForElement('//p[contains(text(),"Your avatar has been updated.")]'); + await waitFor('Your avatar has been updated.'); } async function checkAvatar() { @@ -63,7 +63,7 @@ describe('Application life cycle test', function () { await sendKeys('#user_name', user); await sendKeys('#password', passwd); await click('//form[@action="/user/login"]//button'); - await waitForElement('//nav//img[contains(@class, "avatar")]'); + await waitFor('xpath=//nav//img[contains(@class, "avatar")]'); } async function adminLogin() { @@ -87,7 +87,7 @@ describe('Application life cycle test', function () { async function logout() { await goto(`https://${app.fqdn}`, '//nav//img[contains(@class, "avatar")]'); await click('//nav//img[contains(@class, "avatar")]'); - await waitForElement('//a[@href="/user/logout"]'); + await waitFor('css=a[href="/user/logout"]'); await click('//a[@href="/user/logout"]'); } @@ -100,7 +100,7 @@ describe('Application life cycle test', function () { await sendKeys('#ssh-key-title', 'testkey'); await sendKeys('#ssh-key-content', fs.readFileSync(`${import.meta.dirname}/id_ed25519.pub`, 'utf8').trim()); await click('//form//button[contains(text(),"Add Key")]'); - await waitForElement('//p[contains(text(), "has been added.")]'); + await waitFor('has been added.'); } async function createRepo() {