1
0
mirror of https://git.cloudron.io/cloudron/gitea-app synced 2026-04-29 22:21:13 +00:00

tests: prefix bare CSS selectors with css= for charlie

Made-with: Cursor
This commit is contained in:
Girish Ramakrishnan
2026-04-27 09:43:22 +02:00
parent 317c03bba2
commit f7166969a0
+10 -10
View File
@@ -59,9 +59,9 @@ describe('Application life cycle test', function () {
} }
async function login(user, passwd) { async function login(user, passwd) {
await goto(`https://${app.fqdn}/user/login`, '#user_name'); await goto(`https://${app.fqdn}/user/login`, 'css=#user_name');
await sendKeys('#user_name', user); await sendKeys('css=#user_name', user);
await sendKeys('#password', passwd); await sendKeys('css=#password', passwd);
await click('//form[@action="/user/login"]//button'); await click('//form[@action="/user/login"]//button');
await waitFor('xpath=//nav//img[contains(@class, "avatar")]'); await waitFor('xpath=//nav//img[contains(@class, "avatar")]');
} }
@@ -95,18 +95,18 @@ describe('Application life cycle test', function () {
const keyPath = path.join(import.meta.dirname, 'id_ed25519'); const keyPath = path.join(import.meta.dirname, 'id_ed25519');
fs.chmodSync(keyPath, 0o600); fs.chmodSync(keyPath, 0o600);
await goto(`https://${app.fqdn}/user/settings/keys`, '#add-ssh-button'); await goto(`https://${app.fqdn}/user/settings/keys`, 'css=#add-ssh-button');
await click('#add-ssh-button'); await click('css=#add-ssh-button');
await sendKeys('#ssh-key-title', 'testkey'); await sendKeys('css=#ssh-key-title', 'testkey');
await sendKeys('#ssh-key-content', fs.readFileSync(`${import.meta.dirname}/id_ed25519.pub`, 'utf8').trim()); await sendKeys('css=#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 waitFor('has been added.'); await waitFor('has been added.');
} }
async function createRepo() { async function createRepo() {
await goto(`https://${app.fqdn}/repo/create`, '#repo_name'); await goto(`https://${app.fqdn}/repo/create`, 'css=#repo_name');
await sendKeys('#repo_name', reponame); await sendKeys('css=#repo_name', reponame);
await click('#auto-init'); await click('css=#auto-init');
await click('//button[contains(text(), "Create Repository")]'); await click('//button[contains(text(), "Create Repository")]');
await waitForUrl(`https://${app.fqdn}/${username}/${reponame}`); await waitForUrl(`https://${app.fqdn}/${username}/${reponame}`);
} }