netresearch/typo3-testing-skill / skills/typo3-testing
typo3-testing
FlaggedUse when reproducing defects as failing tests, testing template or rendered output changes, confirming changes on a running TYPO3 instance, or setting up TYPO3 extension tests: unit/functional/E2E, PHPUnit 11-13, mutation testing, final-class mocks (v14), CI matrix across TYPO3 12/13/14.3 LTS, typo3-ci-workflows meta-package, CI failures. Also: transaction rollback, worker crashes, competing requests, testing-framework setup, test matrix, integration/e2e testing, coverage, test generation.
assets/Build/playwright/tests/playwright/fixtures/setup-fixtures.ts
View on GitHub/**
* Playwright Test Fixtures for TYPO3 Backend Testing
*
* This file provides reusable fixtures (Page Object Models) for
* testing TYPO3 backend functionality.
*
* Usage:
* import { test, expect } from '../fixtures/setup-fixtures';
*
* test('my test', async ({ backend }) => {
* await backend.gotoModule('web_layout');
* });
*/
import { test as base, type Locator, type Page, expect } from '@playwright/test';
/**
* Backend Page Object Model
*/
export class BackendPage {
readonly page: Page;
readonly moduleMenu: Locator;
readonly contentFrame: ReturnType<Page['frameLocator']>;
constructor(page: Page) {
this.page = page;
this.moduleMenu = page.locator('#modulemenu');
this.contentFrame = page.frameLocator('#typo3-contentIframe');
}
/**
* Navigate to a TYPO3 backend module
*/
async gotoModule(identifier: string): Promise<void> {
const moduleLink = this.moduleMenu.locator(
`[data-modulemenu-identifier="${identifier}"]`
);
await moduleLink.click();
await expect(moduleLink).toHaveClass(/modulemenu-action-active/);
}
/**
* Wait for module to finish loading
*/
async moduleLoaded(): Promise<void> {
await this.page.evaluate(() => {
return new Promise<void>((resolve) => {
document.addEventListener('typo3-module-loaded', () => resolve(), {
once: true,
});
});
});
}
/**
* Wait for a specific backend response
*/
async waitForModuleResponse(urlPattern: string | RegExp): Promise<void> {
await this.page.waitForResponse((response) => {
const url = response.url();
const matches =
typeof urlPattern === 'string'
? url.includes(urlPattern)
: urlPattern.test(url);
return matches && response.status() === 200;
});
}
}
/**
* Modal Page Object Model
*/
export class Modal {
readonly page: Page;
readonly container: Locator;
readonly title: Locator;
readonly closeButton: Locator;
constructor(page: Page) {
this.page = page;
this.container = page.locator('.modal');
this.title = this.container.locator('.modal-title');
this.closeButton = this.container.locator('[data-bs-dismiss="modal"]');
}
async close(): Promise<void> {
await this.closeButton.click();
await expect(this.container).not.toBeVisible();
}
}
/**
* Fixture type definitions
*/
type BackendFixtures = {
backend: BackendPage;
modal: Modal;
};
/**
* Extended test with TYPO3 backend fixtures
*/
export const test = base.extend<BackendFixtures>({
backend: async ({ page }, use) => {
await use(new BackendPage(page));
},
modal: async ({ page }, use) => {
await use(new Modal(page));
},
});
export { expect, Locator };
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |