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

test: use getText helper instead of executeScript

executeScript is being removed from charlie's public API; getText with
an attribute name reads element attributes (here: img src) directly.

Made-with: Cursor
This commit is contained in:
Girish Ramakrishnan
2026-04-24 16:17:31 +02:00
parent cdb45943d3
commit 99ecdfefff
+2 -5
View File
@@ -10,7 +10,7 @@ import {
clearCache, clearCache,
click, click,
cloudronCli, cloudronCli,
executeScript, getText,
goto, goto,
loginOIDC, loginOIDC,
sendKeys, sendKeys,
@@ -51,10 +51,7 @@ describe('Application life cycle test', function () {
async function checkAvatar() { async function checkAvatar() {
await goto(`https://${app.fqdn}/${username}`, '//div[@id="profile-avatar"]/a/img'); await goto(`https://${app.fqdn}/${username}`, '//div[@id="profile-avatar"]/a/img');
const avatarSrc = await executeScript(() => { const avatarSrc = await getText('//div[@id="profile-avatar"]/a/img', 'src');
const el = document.querySelector('#profile-avatar a img');
return el ? el.getAttribute('src') : null;
});
assert.ok(avatarSrc); assert.ok(avatarSrc);
const avatarUrl = new URL(avatarSrc, `https://${app.fqdn}`).href; const avatarUrl = new URL(avatarSrc, `https://${app.fqdn}`).href;
const response = await superagent.get(avatarUrl); const response = await superagent.get(avatarUrl);