mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:36:42 +00:00
test: add a test of rigster
This commit is contained in:
parent
cee91490c6
commit
7d58699846
13
.vscode/launch.json
vendored
13
.vscode/launch.json
vendored
@ -37,6 +37,19 @@
|
||||
"runtimeArgs": ["run", "test:client", "${relativeFile}"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Debug E2E Tests",
|
||||
"runtimeExecutable": "yarn",
|
||||
"runtimeArgs": ["test:e2e", "${file}"],
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"windows": {
|
||||
"runtimeArgs": ["test:e2e", "${fileBasename}"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
34
packages/plugins/auth/src/client/__tests__/e2e/auth.e2e.ts
Normal file
34
packages/plugins/auth/src/client/__tests__/e2e/auth.e2e.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.describe('auth', () => {
|
||||
// 重置登录状态
|
||||
test.use({
|
||||
storageState: {
|
||||
cookies: [],
|
||||
origins: [],
|
||||
},
|
||||
});
|
||||
|
||||
test('register', async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await page.getByRole('link', { name: 'Create an account' }).click();
|
||||
await page.getByPlaceholder('Username').click();
|
||||
await page.getByPlaceholder('Username').fill('zidonghuaceshi');
|
||||
await page.getByPlaceholder('Password', { exact: true }).click();
|
||||
await page.getByPlaceholder('Password', { exact: true }).fill('zidonghuaceshi123');
|
||||
await page.getByPlaceholder('Confirm password').click();
|
||||
await page.getByPlaceholder('Confirm password').fill('zidonghuaceshi123');
|
||||
await page.getByRole('button', { name: 'Sign up' }).click();
|
||||
|
||||
await expect(page.getByText('Sign up successfully, and automatically jump to the sign in page')).toBeVisible();
|
||||
|
||||
// 用新账户登录
|
||||
await page.getByPlaceholder('Username/Email').click();
|
||||
await page.getByPlaceholder('Username/Email').fill('zidonghuaceshi');
|
||||
await page.getByPlaceholder('Password').click();
|
||||
await page.getByPlaceholder('Password').fill('zidonghuaceshi123');
|
||||
await page.getByRole('button', { name: 'Sign in' }).click();
|
||||
|
||||
await expect(page.getByText('zidonghuaceshi')).toBeVisible();
|
||||
});
|
||||
});
|
@ -9,7 +9,7 @@ export const commonConfig: any = {
|
||||
};
|
||||
|
||||
export const deleteNocoBase = () => {
|
||||
execSync(`yarn pm2 delete 0`, commonConfig);
|
||||
execSync(`yarn pm2 delete 0`);
|
||||
};
|
||||
|
||||
export const runNocoBase = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user