-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,4 +119,6 @@ prime/ | |
# Manpage | ||
/man | ||
test-results/ | ||
playwright-report/ | ||
|
||
# E2E | ||
tools/e2e/reports/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
// @ts-check | ||
import {test, expect} from '@playwright/test'; | ||
|
||
test('Load Homepage', async ({page}) => { | ||
test('Load Homepage', async ({page}, workerInfo) => { | ||
const response = await page.goto('/'); | ||
await expect(response.status()).toBe(200); // Status OK | ||
await expect(response?.status()).toBe(200); // Status OK | ||
await expect(page).toHaveTitle(/^Gitea: Git with a cup of tea\s*$/); | ||
await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg'); | ||
await page.screenshot({ path: 'screenshot.png', fullPage: true}); | ||
}); | ||
|
||
test('Test Register Form', async ({page}, workerInfo) => { | ||
const response = await page.goto('/user/sign_up'); | ||
await expect(response?.status()).toBe(200); // Status OK | ||
await page.type('input[name=user_name]', `test-${workerInfo.workerIndex}`); | ||
await page.type('input[name=email]', `test-${workerInfo.workerIndex}@test.com`); | ||
await page.type('input[name=password]', 'test123'); | ||
await page.type('input[name=retype]', 'test123'); | ||
await page.click('form button.ui.green.button:visible'); | ||
// Make sure we routed to the home page. Else login failed. | ||
await expect(page.url()).toBe(`${workerInfo.project.use.baseURL}/`); | ||
// Uncomment to see visual testing | ||
//await expect(page).toHaveScreenshot({ timeout: 20000, mask: [page.locator('footer div.ui.left')] }); | ||
//await page.screenshot({ path: `tools/e2e/screenshots/${workerInfo.title}-${workerInfo.project.name}.png` }); | ||
}); |