Update E2E test settings and methods
Updated the Playwright End-To-End test configurations to run the local dev server before starting the tests. Removed unnecessary page load wait states in the invitation tests. Also, updated the parameters passed in the `visitMailbox` method used in the authentication tests.
This commit is contained in:
4
.github/workflows/workflow.yml
vendored
4
.github/workflows/workflow.yml
vendored
@@ -86,10 +86,6 @@ jobs:
|
|||||||
- name: Supabase Server
|
- name: Supabase Server
|
||||||
run: pnpm run supabase:web:start -- -x studio,migra,deno-relay,pgadmin-schema-diff,imgproxy,logflare
|
run: pnpm run supabase:web:start -- -x studio,migra,deno-relay,pgadmin-schema-diff,imgproxy,logflare
|
||||||
|
|
||||||
- name: Run App
|
|
||||||
run: |
|
|
||||||
pnpm run dev &
|
|
||||||
|
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
run: pnpm run test
|
run: pnpm run test
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ export default defineConfig({
|
|||||||
baseURL: 'http://localhost:3000',
|
baseURL: 'http://localhost:3000',
|
||||||
|
|
||||||
// take a screenshot when a test fails
|
// take a screenshot when a test fails
|
||||||
screenshot: "on",
|
screenshot: 'on',
|
||||||
|
|
||||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry'
|
||||||
},
|
},
|
||||||
|
|
||||||
// test timeout set to 2 minutes
|
// test timeout set to 2 minutes
|
||||||
@@ -43,8 +43,8 @@ export default defineConfig({
|
|||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
name: 'chromium',
|
name: 'chromium',
|
||||||
use: { ...devices['Desktop Chrome'] },
|
use: { ...devices['Desktop Chrome'] }
|
||||||
},
|
}
|
||||||
/* Test against mobile viewports. */
|
/* Test against mobile viewports. */
|
||||||
// {
|
// {
|
||||||
// name: 'Mobile Chrome',
|
// name: 'Mobile Chrome',
|
||||||
@@ -67,9 +67,11 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
|
|
||||||
/* Run your local dev server before starting the tests */
|
/* Run your local dev server before starting the tests */
|
||||||
// webServer: {
|
webServer: {
|
||||||
// command: 'npm run start',
|
command: 'cd ../../ && pnpm run dev',
|
||||||
// url: 'http://127.0.0.1:3000',
|
url: 'http://localhost:3000',
|
||||||
// reuseExistingServer: !process.env.CI,
|
reuseExistingServer: !process.env.CI,
|
||||||
// },
|
stdout: 'pipe',
|
||||||
|
stderr: 'pipe'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export class AuthPageObject {
|
|||||||
await this.page.fill('input[name="email"]', params.email);
|
await this.page.fill('input[name="email"]', params.email);
|
||||||
await this.page.fill('input[name="password"]', params.password);
|
await this.page.fill('input[name="password"]', params.password);
|
||||||
await this.page.fill('input[name="repeatPassword"]', params.repeatPassword);
|
await this.page.fill('input[name="repeatPassword"]', params.repeatPassword);
|
||||||
|
|
||||||
await this.page.click('button[type="submit"]');
|
await this.page.click('button[type="submit"]');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ export class AuthPageObject {
|
|||||||
deleteAfter: boolean
|
deleteAfter: boolean
|
||||||
}) {
|
}) {
|
||||||
return expect(async() => {
|
return expect(async() => {
|
||||||
const res = await this.mailbox.visitMailbox(email);
|
const res = await this.mailbox.visitMailbox(email, params);
|
||||||
|
|
||||||
expect(res).not.toBeNull();
|
expect(res).not.toBeNull();
|
||||||
}).toPass();
|
}).toPass();
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ test.describe('Invitations', () => {
|
|||||||
await invitations.setup();
|
await invitations.setup();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Full invite flow', async ({page}) => {
|
test('Full invite flow', async () => {
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
await invitations.navigateToMembers();
|
await invitations.navigateToMembers();
|
||||||
await invitations.openInviteForm();
|
await invitations.openInviteForm();
|
||||||
|
|
||||||
@@ -57,9 +55,7 @@ test.describe('Invitations', () => {
|
|||||||
await expect(await invitations.teamAccounts.getTeams()).toHaveCount(1);
|
await expect(await invitations.teamAccounts.getTeams()).toHaveCount(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('users can delete invites', async ({page}) => {
|
test('users can delete invites', async () => {
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
await invitations.navigateToMembers();
|
await invitations.navigateToMembers();
|
||||||
await invitations.openInviteForm();
|
await invitations.openInviteForm();
|
||||||
|
|
||||||
@@ -81,9 +77,7 @@ test.describe('Invitations', () => {
|
|||||||
await expect(await invitations.getInvitations()).toHaveCount(0);
|
await expect(await invitations.getInvitations()).toHaveCount(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('users can update invites', async ({page}) => {
|
test('users can update invites', async () => {
|
||||||
await page.waitForLoadState('networkidle');
|
|
||||||
|
|
||||||
await invitations.navigateToMembers();
|
await invitations.navigateToMembers();
|
||||||
await invitations.openInviteForm();
|
await invitations.openInviteForm();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user