fix: mount /apps and docker socket in PR workflow build-and-deploy-ci job (#41)
Reviewed-on: #41 Co-authored-by: David Gwilliam <dhgwilliam@gmail.com> Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #41.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { prisma } from '@/lib/prisma';
|
||||
const BASE_URL = process.env.CI ? 'https://euchre-ci.notsosm.art' : 'http://localhost:3000';
|
||||
|
||||
|
||||
function getTestCredentials() {
|
||||
@@ -35,11 +36,11 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
testName = credentials.name;
|
||||
|
||||
// Create test user via API with proper origin header
|
||||
const response = await fetch('http://localhost:3000/api/auth/sign-up/email', {
|
||||
const response = await fetch(`${BASE_URL}/api/auth/sign-up/email`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Origin': 'http://localhost:3000',
|
||||
'Origin': BASE_URL,
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
@@ -92,7 +93,7 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
|
||||
test('Logout button appears in navigation when logged in', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
|
||||
// Wait for page to load
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
@@ -132,7 +133,7 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
|
||||
// Wait a moment for the navigation component to update
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForTimeout(200);
|
||||
|
||||
// Debug: Check what's on the page
|
||||
const pageContent = await page.content();
|
||||
@@ -156,7 +157,7 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
|
||||
test('Logout clears session and redirects to home', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
await page.fill('input[name="email"]', testEmail);
|
||||
await page.fill('input[name="password"]', testPassword);
|
||||
await page.click('button[type="submit"]');
|
||||
@@ -180,7 +181,7 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
|
||||
test('After logout, protected pages redirect to login', async ({ page }) => {
|
||||
// Login first
|
||||
await page.goto('http://localhost:3000/auth/login');
|
||||
await page.goto('/auth/login');
|
||||
await page.fill('input[name="email"]', testEmail);
|
||||
await page.fill('input[name="password"]', testPassword);
|
||||
await page.click('button[type="submit"]');
|
||||
@@ -200,7 +201,7 @@ test.describe.serial('Epic 1: User Logout', () => {
|
||||
await page.waitForURL('**/auth/login**', { timeout: 10000 });
|
||||
|
||||
// Try to access admin page
|
||||
await page.goto('http://localhost:3000/admin');
|
||||
await page.goto('/admin');
|
||||
|
||||
// Should redirect to login
|
||||
await expect(page).toHaveURL(/.*auth\/login.*/);
|
||||
|
||||
Reference in New Issue
Block a user