Merge pull request #216 from kimatata/develop

This commit is contained in:
kimatata
2025-04-27 21:18:25 +09:00
committed by GitHub
5 changed files with 52 additions and 6 deletions

View File

@@ -22,11 +22,14 @@ jobs:
run: | run: |
sudo apt install -y docker-compose sudo apt install -y docker-compose
- name: Install dependencies
run: npm install
- name: Install Playwright - name: Install Playwright
run: npx playwright install run: npx playwright install --with-deps
- name: Start docker containers - name: Start docker containers
run: docker-compose up --build run: docker-compose up --build -d
- name: Run E2E tests - name: Run E2E tests
run: npm run e2e run: npm run e2e
@@ -34,6 +37,7 @@ jobs:
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: always() if: always()
with: with:
name: playwright-report name: e2e-report
path: playwright-report/ path: |
retention-days: 30 playwright-report/
playwright-screenshots/

1
.gitignore vendored
View File

@@ -3,5 +3,6 @@ coverage/
.env .env
/test-results/ /test-results/
/playwright-report/ /playwright-report/
/playwright-screenshots/
/blob-report/ /blob-report/
/playwright/.cache/ /playwright/.cache/

View File

@@ -0,0 +1,39 @@
import { test, expect } from '@playwright/test';
test('First User signup and create project', async ({ page }) => {
const screenshotDir = 'playwright-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

@@ -94,7 +94,7 @@ export default function HeaderNavbarMenu({ messages, locale }: Props) {
<NavbarItem className="hidden md:block"> <NavbarItem className="hidden md:block">
<Chip size="sm" variant="flat"> <Chip size="sm" variant="flat">
<Link className="data-[active=true]:text-primary data-[active=true]:font-medium" href="/" locale={locale}> <Link className="data-[active=true]:text-primary data-[active=true]:font-medium" href="/" locale={locale}>
1.0.0-beta.10 1.0.0-beta.11
</Link> </Link>
</Chip> </Chip>
</NavbarItem> </NavbarItem>

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. */