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:
+10
-10
@@ -59,9 +59,9 @@ describe('Application life cycle test', function () {
|
||||
}
|
||||
|
||||
async function login(user, passwd) {
|
||||
await goto(`https://${app.fqdn}/user/login`, '#user_name');
|
||||
await sendKeys('#user_name', user);
|
||||
await sendKeys('#password', passwd);
|
||||
await goto(`https://${app.fqdn}/user/login`, 'css=#user_name');
|
||||
await sendKeys('css=#user_name', user);
|
||||
await sendKeys('css=#password', passwd);
|
||||
await click('//form[@action="/user/login"]//button');
|
||||
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');
|
||||
fs.chmodSync(keyPath, 0o600);
|
||||
|
||||
await goto(`https://${app.fqdn}/user/settings/keys`, '#add-ssh-button');
|
||||
await click('#add-ssh-button');
|
||||
await sendKeys('#ssh-key-title', 'testkey');
|
||||
await sendKeys('#ssh-key-content', fs.readFileSync(`${import.meta.dirname}/id_ed25519.pub`, 'utf8').trim());
|
||||
await goto(`https://${app.fqdn}/user/settings/keys`, 'css=#add-ssh-button');
|
||||
await click('css=#add-ssh-button');
|
||||
await sendKeys('css=#ssh-key-title', 'testkey');
|
||||
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 waitFor('has been added.');
|
||||
}
|
||||
|
||||
async function createRepo() {
|
||||
await goto(`https://${app.fqdn}/repo/create`, '#repo_name');
|
||||
await sendKeys('#repo_name', reponame);
|
||||
await click('#auto-init');
|
||||
await goto(`https://${app.fqdn}/repo/create`, 'css=#repo_name');
|
||||
await sendKeys('css=#repo_name', reponame);
|
||||
await click('css=#auto-init');
|
||||
await click('//button[contains(text(), "Create Repository")]');
|
||||
await waitForUrl(`https://${app.fqdn}/${username}/${reponame}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user