Backend: - conftest with async SQLite DB, factory fixtures for all models - pytest-asyncio config in pyproject.toml - Tests: auth (JWT, dev login), RBAC (access service), audit (query, export), brand enforcement (colors, fonts, logos, contrast), retention (cleanup, purge), content intelligence (regex classifiers), slide mapping, review workflow, analytics data queries Frontend: - Cypress E2E config with baseUrl and viewport settings - Custom commands (devLogin, createPresentation) - E2E specs: login flow, wizard navigation, admin panel, review workflow - Test scripts in package.json Infrastructure: - Makefile: test-e2e and test-all targets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
39 lines
1,011 B
TypeScript
39 lines
1,011 B
TypeScript
/// <reference types="cypress" />
|
|
|
|
// Custom commands for DeckForge E2E tests
|
|
|
|
Cypress.Commands.add("devLogin", (email = "admin@oliver.com") => {
|
|
cy.request("POST", "/api/v1/auth/dev-login", {
|
|
email,
|
|
password: Cypress.env("DEV_AUTH_PASSWORD") || "devpass123",
|
|
}).then((response) => {
|
|
const { token } = response.body;
|
|
window.localStorage.setItem("deckforge_token", token);
|
|
});
|
|
});
|
|
|
|
Cypress.Commands.add("createPresentation", (title = "E2E Test Deck") => {
|
|
const token = window.localStorage.getItem("deckforge_token");
|
|
cy.request({
|
|
method: "POST",
|
|
url: "/api/v1/ppt/presentation/create",
|
|
headers: { Authorization: `Bearer ${token}` },
|
|
body: {
|
|
content: "Test brief content for E2E testing.",
|
|
n_slides: 5,
|
|
language: "English",
|
|
title,
|
|
},
|
|
});
|
|
});
|
|
|
|
declare global {
|
|
namespace Cypress {
|
|
interface Chainable {
|
|
devLogin(email?: string): Chainable<void>;
|
|
createPresentation(title?: string): Chainable<void>;
|
|
}
|
|
}
|
|
}
|
|
|
|
export {};
|