second-brain/client/verification/logout.spec.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

import { test, expect } from '@playwright/test';
test('Sign Out Test', async ({ page }) => {
console.log('Navigating to app...');
await page.goto('http://localhost:3000');
// Wait for page to load
await page.waitForLoadState('networkidle');
console.log('Looking for user profile...');
// Find the user profile dropdown trigger
const profileDropdown = page.locator('.group.relative.cursor-pointer').first();
await expect(profileDropdown).toBeVisible();
console.log('Hovering over profile...');
// Hover to show the dropdown
await profileDropdown.hover();
// Wait for dropdown to appear
await page.waitForTimeout(500);
console.log('Looking for Sign out button...');
const signOutButton = page.getByRole('button', { name: /sign out/i });
await expect(signOutButton).toBeVisible();
console.log('Clicking Sign out...');
await signOutButton.click();
// Wait for navigation or redirect
await page.waitForTimeout(1000);
console.log('Current URL:', page.url());
// Take screenshot
await page.screenshot({ path: 'logout_test.png', fullPage: true });
});