1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2026-04-25 12:13:03 +00:00

test: switch waitForElement to waitFor

Made-with: Cursor
This commit is contained in:
Girish Ramakrishnan
2026-04-24 18:32:38 +02:00
parent adb5a3e683
commit 317c03bba2
+5 -5
View File
@@ -19,7 +19,7 @@ import {
takeScreenshot, takeScreenshot,
teardownBrowser, teardownBrowser,
username, username,
waitForElement, waitFor,
waitForUrl waitForUrl
} from '@cloudron/charlie'; } from '@cloudron/charlie';
@@ -46,7 +46,7 @@ describe('Application life cycle test', function () {
await click('//label[contains(text(), "Use Custom Avatar")]'); await click('//label[contains(text(), "Use Custom Avatar")]');
await setInputFiles('//input[@type="file" and @name="avatar"]', path.resolve(import.meta.dirname, '../logo.png')); await setInputFiles('//input[@type="file" and @name="avatar"]', path.resolve(import.meta.dirname, '../logo.png'));
await click('//button[contains(text(), "Update Avatar")]'); 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() { async function checkAvatar() {
@@ -63,7 +63,7 @@ describe('Application life cycle test', function () {
await sendKeys('#user_name', user); await sendKeys('#user_name', user);
await sendKeys('#password', passwd); await sendKeys('#password', passwd);
await click('//form[@action="/user/login"]//button'); 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() { async function adminLogin() {
@@ -87,7 +87,7 @@ describe('Application life cycle test', function () {
async function logout() { async function logout() {
await goto(`https://${app.fqdn}`, '//nav//img[contains(@class, "avatar")]'); await goto(`https://${app.fqdn}`, '//nav//img[contains(@class, "avatar")]');
await click('//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"]'); 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-title', 'testkey');
await sendKeys('#ssh-key-content', fs.readFileSync(`${import.meta.dirname}/id_ed25519.pub`, 'utf8').trim()); await sendKeys('#ssh-key-content', fs.readFileSync(`${import.meta.dirname}/id_ed25519.pub`, 'utf8').trim());
await click('//form//button[contains(text(),"Add Key")]'); await click('//form//button[contains(text(),"Add Key")]');
await waitForElement('//p[contains(text(), "has been added.")]'); await waitFor('has been added.');
} }
async function createRepo() { async function createRepo() {