feat: Establish Playwright testing infrastructure with initial tests for authentication, admin, and instructor modules, and fix instructor video and quiz lesson management pages.
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 1m17s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 8s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 2s
All checks were successful
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 1m17s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 8s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 2s
This commit is contained in:
parent
734d922393
commit
9bc24fbe8a
18 changed files with 1344 additions and 7 deletions
31
frontend_management/tests/fixtures/instructor.setup.ts
vendored
Normal file
31
frontend_management/tests/fixtures/instructor.setup.ts
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { test as setup, expect } from '@playwright/test';
|
||||
import { TEST_INSTRUCTOR, TEST_URLS } from './test-data';
|
||||
import { fileURLToPath } from 'url';
|
||||
import path from 'path';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const INSTRUCTOR_AUTH_FILE = path.resolve(__dirname, '../.auth/instructor.json');
|
||||
|
||||
/**
|
||||
* Instructor authentication setup
|
||||
* Logs in as instructor and saves browser state (cookies) for reuse
|
||||
*/
|
||||
setup('authenticate as instructor', async ({ page }) => {
|
||||
await page.goto(TEST_URLS.login);
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
// Fill login form
|
||||
await page.locator('input[type="email"]').fill(TEST_INSTRUCTOR.email);
|
||||
await page.locator('input[type="password"]').fill(TEST_INSTRUCTOR.password);
|
||||
|
||||
// Submit
|
||||
await page.locator('button[type="submit"]').click();
|
||||
|
||||
// Wait for redirect to instructor dashboard
|
||||
await page.waitForURL('**/instructor**', { timeout: 15_000 });
|
||||
await expect(page).toHaveURL(/\/instructor/);
|
||||
|
||||
// Save auth state
|
||||
await page.context().storageState({ path: INSTRUCTOR_AUTH_FILE });
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue