forked from line/centraldogma
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanding.spec.ts
More file actions
27 lines (22 loc) · 1.01 KB
/
landing.spec.ts
File metadata and controls
27 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { test, expect } from '@playwright/test';
test.beforeEach('Login', async ({ page }) => {
await page.goto('/');
await expect(page.getByText(/Login/)).toBeVisible();
await page.getByPlaceholder('ID').fill('foo');
await page.getByPlaceholder('Password').fill('bar');
const loginResponse = page.waitForResponse((response) => response.url().includes('/api/v1/login'));
await page.getByRole('button', { name: 'Login' }).click();
await loginResponse;
});
test('welcome message', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to Central Dogma!' })).toBeVisible();
});
test('search project', async ({ page }) => {
await page.goto('/');
await expect(page.getByText('Search project ...')).toBeVisible();
await expect(page.getByRole('combobox')).toBeVisible();
await page.locator('#home-search').click();
await expect(page.getByRole('option', { name: 'dogma' })).toBeVisible();
await expect(page.getByRole('option', { name: 'foo' })).toBeVisible();
});