generated from wednesday-solutions/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.spec.js
21 lines (15 loc) · 877 Bytes
/
example.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// @ts-check
const { test, expect } = require('@playwright/test');
test('example test case', async ({ page }) => {
await page.goto('http://localhost:3000');
await expect(page.getByText(/wednesday solutions/i)).toBeVisible();
await expect(page.getByText(/repository search/i)).toBeVisible();
await expect(page.getByTestId('search-bar')).toBeEditable();
await page.getByTestId('search-bar').fill('playwright');
await page.getByRole('button', { name: 'search' }).click();
await expect(page.getByText(/Search query: playwright/i)).toBeVisible();
await expect(page.getByText(/Total number of matching repos: /i)).toBeVisible();
await expect(page.getByText(/Repository Name:/i).nth(1)).toBeVisible();
await expect(page.getByText(/Repository full name:/i).nth(1)).toBeVisible();
await expect(page.getByText(/Repository stars:/i).nth(1)).toBeVisible();
});