| 1 |
import { test, expect } from '@playwright/test'; |
| 2 |
import { execFileSync } from 'node:child_process'; |
| 3 |
import { readdirSync } from 'node:fs'; |
| 4 |
import { basename, resolve } from 'node:path'; |
| 5 |
|
| 6 |
// Each script uses its own temporary options table, so these checks can run |
| 7 |
// alongside browser tests without changing their WordPress settings. |
| 8 |
for (const file of readdirSync(resolve('tests/Regression')).filter(name => name.endsWith('.php'))) { |
| 9 |
test(`WordPress regression: ${file}`, () => { |
| 10 |
const output = execFileSync(resolve('node_modules/.bin/wp-env'), [ |
| 11 |
'run', 'cli', 'wp', 'eval-file', |
| 12 |
`wp-content/plugins/${basename(process.cwd())}/tests/Regression/${file}`, |
| 13 |
], { encoding: 'utf8', timeout: 45000 }); |
| 14 |
expect(output).toContain('Regression checks passed'); |
| 15 |
}); |
| 16 |
} |
| 17 |
|