write-playwright-campaignslisted
Install: claude install-skill jeffsenso/prestashop-skills
# write-playwright-campaigns
Read `@.ai/Component/Playwright/CONTEXT.md` for conventions (testIdentifier, baseContext, Mocha structure, POM usage).
## 1. Directory and naming
Place campaigns in `tests/UI/campaigns/functional/BO/{XX_section}/{XX_subsection}/`:
- Follow existing numbering convention (`XX_` prefix)
- Each campaign file: `XX_descriptiveName.ts`
- CRUD is typically `01_`, filter is `02_`, bulk is `03_`, position is `04_`, tab-specific start at `05_`
## 2. Campaign boilerplate
Every campaign follows this structure:
```typescript
import testContext from '@utils/testContext';
import {expect} from 'chai';
import {
boDashboardPage, boLoginPage, bo{Domain}Page, bo{Domain}CreatePage,
type BrowserContext, Faker{Domain}, type Page, utilsPlaywright,
} from '@prestashop-core/ui-testing';
const baseContext: string = 'functional_BO_{section}_{subsection}_{campaignName}';
describe('BO - {Section} : {Campaign description}', async () => {
let browserContext: BrowserContext;
let page: Page;
before(async function () {
browserContext = await utilsPlaywright.createBrowserContext(this.browser);
page = await utilsPlaywright.newTab(browserContext);
});
after(async () => {
await utilsPlaywright.closeBrowserContext(browserContext);
});
it('should login in BO', async function () {
await testContext.addContextItem(this, 'testIdentifier', 'loginBO', baseContext);
// ...login steps...
});
// ... test steps ...
});
```
## 3. CRUD campaign