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:
+2
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user