Skip to main content
Glama
Southclaws

Storyden

by Southclaws
login.spec.ts2.2 kB
import { expect, test } from "@playwright/test"; test.describe("Login", () => { test("should login successfully with correct credentials", async ({ page, }) => { const timestamp = Date.now(); const username = `testuser${timestamp}`; const password = "TestPassword123!"; await page.goto("/register"); await page.getByRole("textbox", { name: "username" }).fill(username); await page.getByRole("textbox", { name: "password" }).fill(password); await page.getByRole("button", { name: "Register" }).click(); await expect(page).toHaveURL("/", { timeout: 10000 }); await page.getByRole("button", { name: "Account menu" }).click(); await page.getByRole("link", { name: "Logout" }).click(); await page.getByRole("link", { name: "Login" }).click(); await page.getByRole("textbox", { name: "username" }).fill(username); await page.getByRole("textbox", { name: "password" }).fill(password); await page.getByRole("button", { name: "Login" }).click(); await expect(page).toHaveURL("/", { timeout: 10000 }); await expect( page.getByRole("button", { name: `Account menu` }), ).toBeVisible(); }); test("should fail to login with wrong password", async ({ page }) => { const timestamp = Date.now(); const username = `testuser${timestamp}`; const password = "TestPassword123!"; const wrongPassword = "WrongPassword456!"; await page.goto("/register"); await page.getByRole("textbox", { name: "username" }).fill(username); await page.getByRole("textbox", { name: "password" }).fill(password); await page.getByRole("button", { name: "Register" }).click(); await expect(page).toHaveURL("/", { timeout: 10000 }); await page.getByRole("button", { name: "Account menu" }).click(); await page.getByRole("link", { name: "Logout" }).click(); await page.getByRole("link", { name: "Login" }).click(); await page.getByRole("textbox", { name: "username" }).fill(username); await page.getByRole("textbox", { name: "password" }).fill(wrongPassword); await page.getByRole("button", { name: "Login" }).click(); await expect(page).not.toHaveURL("/", { timeout: 5000 }); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server