This commit is contained in:
parent
b09d5ce6c4
commit
47120c40b0
1 changed files with 21 additions and 4 deletions
|
@ -9,8 +9,25 @@ import User from "./user";
|
|||
test("Create admin fixture @setup", async ({ page }) => {
|
||||
const admin = new User(config.ADMIN_USERNAME);
|
||||
admin.setAdmin();
|
||||
await admin.register(page);
|
||||
await admin.logout(page);
|
||||
await expect(page).toHaveTitle("Forgejo: Beyond coding. We forge.");
|
||||
console.log("looks like admin is already registered");
|
||||
await page.goto(config.INSTANCE_URL.toString());
|
||||
await page.getByRole("link", { name: "Register" }).click();
|
||||
await page.waitForURL("**/user/sign_up");
|
||||
|
||||
await page.getByLabel("Username").clear();
|
||||
await page.getByLabel("Email Address").clear();
|
||||
await page.getByLabel("Password", { exact: true }).clear();
|
||||
await page.getByLabel("Confirm Password").clear();
|
||||
|
||||
await page.getByLabel("Username").fill(admin.username);
|
||||
await page.getByLabel("Email Address").fill(admin.email);
|
||||
await page.getByLabel("Password", { exact: true }).fill(admin.password);
|
||||
await page.getByLabel("Confirm Password").fill(admin.password);
|
||||
await page.getByRole("button", { name: "Register Account" }).click();
|
||||
|
||||
await page.waitForURL(config.INSTANCE_URL.toString());
|
||||
|
||||
expect(page.locator(".positive > p:nth-child(1)")).toContainText(
|
||||
"Account was successfully created. Welcome!"
|
||||
);
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue