feat: first user sign up E2E test (#214)

This commit is contained in:
kimatata
2025-04-27 20:58:54 +09:00
committed by GitHub
parent c767d544bd
commit 5a55e56387
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import { test, expect } from '@playwright/test';
test('First User signup and create project', async ({ page }) => {
const screenshotDir = 'playwright-report/screenshots/first-user-signup';
// Move to Sign up page
await page.goto('http://localhost:8000/en/account/signup');
// Fill sign up form
await page.getByRole('textbox', { name: 'Email*' }).fill('user1@example.com');
await page.getByRole('textbox', { name: 'User name*' }).fill('user1');
await page.getByRole('textbox', { name: 'Password Password' }).fill('password');
await page.getByRole('textbox', { name: 'Password (confirm)' }).fill('password');
// Sign up
await page.getByRole('button', { name: 'Sign up' }).click();
await page.waitForURL('**/en/account');
await page.screenshot({ path: `${screenshotDir}/after-sign-up.png`, fullPage: true });
// Move to projects page
await page.getByRole('button', { name: 'Find Projects' }).click();
await page.waitForURL('**/en/projects');
// Create new project
await page.getByRole('button', { name: 'New Project' }).click();
await page.getByLabel('Project Name').fill('sample project');
await page.getByRole('button', { name: 'Create' }).click();
// Move to new project
const projectLink = await page.getByRole('link', { name: 'sample project' });
await expect(projectLink).toBeVisible();
await projectLink.click();
await page.waitForURL('**/en/projects/1/home');
await page.screenshot({
path: `${screenshotDir}/after-create-project.png`,
fullPage: true,
});
});

View File

@@ -41,11 +41,13 @@ export default defineConfig({
{ {
name: 'firefox', name: 'firefox',
use: { ...devices['Desktop Firefox'] }, use: { ...devices['Desktop Firefox'] },
testIgnore: '**/first-user-signup.spec.ts',
}, },
{ {
name: 'webkit', name: 'webkit',
use: { ...devices['Desktop Safari'] }, use: { ...devices['Desktop Safari'] },
testIgnore: '**/first-user-signup.spec.ts',
}, },
/* Test against mobile viewports. */ /* Test against mobile viewports. */