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,
click,
cloudronCli,
executeScript,
getText,
goto,
loginOIDC,
sendKeys,
@@ -51,10 +51,7 @@ describe('Application life cycle test', function () {
async function checkAvatar() {
await goto(`https://${app.fqdn}/${username}`, '//div[@id="profile-avatar"]/a/img');
const avatarSrc = await executeScript(() => {
const el = document.querySelector('#profile-avatar a img');
return el ? el.getAttribute('src') : null;
});
const avatarSrc = await getText('//div[@id="profile-avatar"]/a/img', 'src');
assert.ok(avatarSrc);
const avatarUrl = new URL(avatarSrc, `https://${app.fqdn}`).href;
const response = await superagent.get(avatarUrl);