mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): navbar missing (#10396)
## Changes 🏗️ <img width="1843" height="321" alt="Screenshot 2025-07-17 at 15 48 01" src="https://github.com/user-attachments/assets/63f528f7-1dc3-4587-a5af-d02b2c858191" /> In this recent PR https://github.com/Significant-Gravitas/AutoGPT/pull/10394/ the navigation bar disappeared when logged out. A change was introduced where the navigation bar does not show up if we don't have profile data ( _which we won't have when logged out_ ). This solves it + adds tests covering the navigation bar in the logged out state. ## Checklist 📋 ### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Run this locally - [x] See the navbar appearing - [x] E2E tests pass on the CI ### For configuration changes: None
This commit is contained in:
@@ -11,7 +11,7 @@ import { getTestUser } from "./utils/auth";
|
||||
import { hasUrl } from "./utils/assertion";
|
||||
|
||||
test.describe.configure({
|
||||
timeout: 40000,
|
||||
timeout: 60000,
|
||||
mode: "parallel",
|
||||
});
|
||||
|
||||
|
||||
@@ -3,13 +3,35 @@
|
||||
import test from "@playwright/test";
|
||||
import { getTestUser } from "./utils/auth";
|
||||
import { LoginPage } from "./pages/login.page";
|
||||
import { hasUrl, isVisible } from "./utils/assertion";
|
||||
import { hasUrl, isHidden, isVisible } from "./utils/assertion";
|
||||
import { getSelectors } from "./utils/selectors";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/login");
|
||||
});
|
||||
|
||||
test("check the navigation when logged out", async ({ page }) => {
|
||||
const { getButton, getText, getLink } = getSelectors(page);
|
||||
|
||||
// Marketplace is by default the homepage
|
||||
await page.goto("/");
|
||||
await hasUrl(page, "/marketplace");
|
||||
|
||||
// Test marketplace link
|
||||
const marketplaceLink = getLink("Marketplace");
|
||||
await isVisible(marketplaceLink);
|
||||
await marketplaceLink.click();
|
||||
await hasUrl(page, "/marketplace");
|
||||
await isVisible(getText("Explore AI agents", { exact: false }));
|
||||
|
||||
// Test login button
|
||||
const loginBtn = getButton("Log In");
|
||||
await isVisible(loginBtn);
|
||||
await loginBtn.click();
|
||||
await hasUrl(page, "/login");
|
||||
await isHidden(loginBtn);
|
||||
});
|
||||
|
||||
test("user can login successfully", async ({ page }) => {
|
||||
const testUser = await getTestUser();
|
||||
const loginPage = new LoginPage(page);
|
||||
|
||||
Reference in New Issue
Block a user