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,
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user