mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-11-10 04:41:59 -10:00
fix(frontend): the Microsoft onboarding smoke test signs in through the API
The test typed its email and password into /login straight after the page loaded. On 46b3d63's CI run the form was replaced right after the email went in (the page's session checks re-rendered it), so it submitted an empty email, showed "Invalid email" and never left /login. The test is about onboarding, so it now signs in through /api/auth/sign-in/email, as the journeys do. Run locally against a full stack with the seeded Microsoft user: passes, reaching the Microsoft 365 offer and the team step after "Not now". Co-authored-by: Claude Opus 5.5 (Claude Code) <[email protected]>
This commit is contained in:
1 parent
46b3d63f56
commit
7ff101adfb
1 file changed
+10
-9
@@ -3,21 +3,22 @@ import { getSeededTestUser } from "./credentials/accounts";
|
||||
|
||||
test("microsoft sign-up: onboarding opens on the Microsoft 365 offer", async ({
|
||||
page,
|
||||
baseURL,
|
||||
}) => {
|
||||
test.setTimeout(90000);
|
||||
const user = getSeededTestUser("microsoftSignIn");
|
||||
|
||||
// Not LoginPage.login, which completes onboarding on the way past it.
|
||||
await page.goto("/login");
|
||||
await page.locator('input[type="email"]').fill(user.email);
|
||||
await page.locator('input[type="password"]').fill(user.password);
|
||||
await page.getByRole("button", { name: "Log in", exact: true }).click();
|
||||
await page.waitForURL((url) => url.pathname !== "/login");
|
||||
// Signs in through the API, since this test is about onboarding: the login
|
||||
// form can be replaced just after it loads, dropping a typed email. Not
|
||||
// LoginPage.login either, which completes onboarding on the way past it.
|
||||
const signIn = await page.request.post("/api/auth/sign-in/email", {
|
||||
headers: { Origin: new URL(baseURL ?? "http://localhost:3000").origin },
|
||||
data: { email: user.email, password: user.password },
|
||||
});
|
||||
expect(signIn.ok(), `sign-in failed: ${signIn.status()}`).toBe(true);
|
||||
|
||||
// Start onboarding over, so a retry doesn't resume or skip the last attempt.
|
||||
const reset = await page.request.post(
|
||||
new URL("/api/proxy/api/onboarding/reset", page.url()).toString(),
|
||||
);
|
||||
const reset = await page.request.post("/api/proxy/api/onboarding/reset");
|
||||
expect(reset.ok()).toBe(true);
|
||||
await page.goto("/onboarding");
|
||||
|
||||
|
||||
Reference in new issue
Block a user