Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/playwright-report/
/blob-report/
/playwright/.cache/
/playwright/.auth/

# next.js
/.next/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The platform will expand to include contact groups, allowing members to organize

### Team

The PRFC Connect team consists of 18 Cal Poly students. Over the course of about 9 months, we work as a team to deploy this web application.
The PRFC Connect team consists of 12 Cal Poly students. Over the course of about 9 months, we work as a team to deploy this web application.

- [Austin Lee](https://www.linkedin.com/in/austinlee17/) - Project Manager
- [Kevin Rutledge](https://www.linkedin.com/in/rutledge-kevin/) - Tech Lead
Expand Down
32 changes: 32 additions & 0 deletions e2e/auth.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test as setup, expect } from "@playwright/test";

const ADMIN_AUTH_FILE = "playwright/.auth/admin.json";
const MEMBER_AUTH_FILE = "playwright/.auth/member.json";

// Admin: ownerid 100001 (first mock member, in mockAdminIds)
// Member: ownerid 100003 (third mock member, not in mockAdminIds)
// Admin status is derived from mockAdminIds (first two members are admins)

setup("authenticate as admin", async ({ page }) => {
await page.goto("/dev/mock-portal");

await page.getByText("Dev Tools").click();
await page.getByLabel("Select Member").selectOption("100001");
await page.getByRole("button", { name: "Login" }).click();

await page.waitForURL("/");
await expect(page).toHaveURL("/");
await page.context().storageState({ path: ADMIN_AUTH_FILE });
});

setup("authenticate as member", async ({ page }) => {
await page.goto("/dev/mock-portal");

await page.getByText("Dev Tools").click();
await page.getByLabel("Select Member").selectOption("100003");
await page.getByRole("button", { name: "Login" }).click();

await page.waitForURL("/");
await expect(page).toHaveURL("/");
await page.context().storageState({ path: MEMBER_AUTH_FILE });
});
Loading