-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add log to test backend * fix tests
- Loading branch information
Showing
12 changed files
with
141 additions
and
112 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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
NODE_ENV=test | ||
|
||
CI_TEST=true | ||
API_URL=http://localhost:2021/trpc | ||
API_URL=http://127.0.0.1:2021/trpc | ||
|
||
# Cookie secret key. Generate something random and long. | ||
DATABASE_URL=postgres://postgres:[email protected]:5432/celluloid | ||
REDIS_URL=redis://127.0.0.1 | ||
|
||
COOKIE_SECRET=cisecret3 | ||
DATABASE_URL=postgres://postgres:postgres@localhost:5432/celluloid | ||
REDIS_URL=redis://localhost | ||
COOKIE_DOMAIN=127.0.0.1 | ||
COOKIE_SECURE=false | ||
|
||
|
||
# email params. Check with your SMTP provider | ||
SMTP_HOST= | ||
|
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
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
This file was deleted.
Oops, something went wrong.
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,17 +1,31 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { expect, Page, test } from '@playwright/test'; | ||
|
||
test('test signup', async ({ page }) => { | ||
await page.goto('http://localhost:3000/'); | ||
|
||
const randomNum = Math.floor(Math.random() * 10000); | ||
const TEST_USERNANE = `test${randomNum}` | ||
const TEST_USER_EMAIL = `${TEST_USERNANE}@server.com`; | ||
|
||
let page: Page; | ||
test.describe.configure({ mode: 'serial' }); | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
page = await browser.newPage(); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await page.close(); | ||
}); | ||
|
||
test('test signup', async () => { | ||
await page.goto('http://127.0.0.1:3000/'); | ||
await page.getByTestId('header-login-button').click(); | ||
await page.getByTestId('signup').click(); | ||
await expect(page).toHaveURL(/.*\/signup/); | ||
|
||
await page.getByTestId('username').click(); | ||
await page.getByTestId('username').fill('[email protected]'); | ||
await page.getByTestId('username').click(); | ||
await page.getByTestId('username').fill('test5'); | ||
await page.getByTestId('username').fill(TEST_USERNANE); | ||
await page.getByTestId('email').click(); | ||
await page.getByTestId('email').fill('[email protected]'); | ||
await page.getByTestId('email').fill(TEST_USER_EMAIL); | ||
await page.getByTestId('password').click(); | ||
await page.getByTestId('password').fill('testtest'); | ||
await page.getByTestId('passwordConfirmation').click(); | ||
|
@@ -25,7 +39,34 @@ test('test signup', async ({ page }) => { | |
await page.getByTestId('code').fill('0000'); | ||
await page.getByTestId('submit').click(); | ||
|
||
// await page.getByTestId('header-profile-button').click(); | ||
// await page.getByRole('heading', { name: 'test5' }).click(); | ||
// await page.getByText('[email protected] - Teacher').click(); | ||
await page.goto('http://127.0.0.1:3000/'); | ||
|
||
await page.getByTestId('header-account-menu').click(); | ||
await page.getByTestId('header-logout-button').click(); | ||
|
||
await expect(page.getByTestId('profile-header-title')).toHaveText(TEST_USERNANE) | ||
|
||
}); | ||
|
||
|
||
test('test reconnect with existing account without confirmation', async () => { | ||
|
||
|
||
await page.goto('http://127.0.0.1:3000/'); | ||
await page.getByTestId('header-login-button').click(); | ||
await expect(page).toHaveURL(/.*\/login/); | ||
|
||
await page.getByTestId('username').click(); | ||
await page.getByTestId('username').fill(TEST_USER_EMAIL); | ||
await page.getByTestId('username').press('Tab'); | ||
await page.getByTestId('password').fill('testtest'); | ||
await page.getByTestId('submit').click(); | ||
|
||
await expect(page).toHaveURL('http://127.0.0.1:3000/'); | ||
|
||
await page.getByTestId('header-account-menu').click(); | ||
await page.getByTestId('header-logout-button').click(); | ||
|
||
await expect(page).toHaveURL('http://127.0.0.1:3000/'); | ||
|
||
}); |
Oops, something went wrong.