mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-31 20:39:11 -06:00
Edit tests/initial.spec.ts
This commit is contained in:
committed by
GitHub
parent
e563b3330a
commit
096947a93a
@@ -14,23 +14,23 @@ async function createUser(page) {
|
||||
await page.press('input[name="password"]', "Enter");
|
||||
}
|
||||
|
||||
async function loginUser(page) {
|
||||
await page.getByText("Login").click();
|
||||
await page.getByText("Login with Email").click();
|
||||
await page.fill('input[name="email"]', email);
|
||||
await page.press('input[name="email"]', "Tab");
|
||||
await page.fill('input[name="password"]', password);
|
||||
await page.press('input[name="password"]', "Enter");
|
||||
class LoginPage {
|
||||
async login(page, email, password) {
|
||||
await page.getByText("Login").click();
|
||||
await page.getByText("Login with Email").click();
|
||||
await page.fill('input[name="email"]', email);
|
||||
await page.press('input[name="email"]', "Tab");
|
||||
await page.fill('input[name="password"]', password);
|
||||
await page.press('input[name="password"]', "Enter");
|
||||
}
|
||||
}
|
||||
|
||||
async function completeOnboarding(page) {
|
||||
await page.getByText("Begin (1 min)").click();
|
||||
await page.getByLabel("Engineer").check();
|
||||
await page.getByText("Next").click();
|
||||
await page.getByLabel("Improve user retention").check();
|
||||
await page.getByText("Next").click();
|
||||
await page.getByLabel("Your product name").fill("test");
|
||||
await page.getByText("Done").click();
|
||||
test("create account, login, and complete onboarding", async ({ page }) => {
|
||||
const loginPage = new LoginPage();
|
||||
await createUser(page);
|
||||
await loginPage.login(page, email, password);
|
||||
await completeOnboarding(page);
|
||||
});
|
||||
await expect(page).toHaveTitle(/Your Surveys | Formbricks/);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user