- Gets list of test-cases IDs from Allure TestOps launch
- Collects a list of test files in the specified directory
- Filters test files that match ID from Allure TestOps launch
- Copies files to the specified directory
- Download source code
wget https://github.com/eftech-open/allurectl-playwright-filter/blob/master/src/allure-filter.ts -O <your_repository_path>
- Add script steps to your CI-file
- allurectl job-run plan --job-run-id $ALLURE_JOB_RUN_ID --output-file testplan.json
- npx ts-node ./tools/allure-filter.ts
- allurectl watch -- npx playwright test ./tests/selected/
- Run test launch from Allure TestOps
Variables allow you to set options for filtering tests
Variables | Description | Default |
---|---|---|
ALLURE_TESTPLAN_PATH | Path to testplan file | ./testplan.json |
PLAYWRIGHT_TEST_DIR | Directory with test files | ./tests/ |
PLAYWRIGHT_TEST_MATCH | Regex filter for test files | .*(test\spec)\\.(js\ts\mjs) |
PLAYWRIGHT_TEST_TARGET | Target directory to copy selected test files | ./tests/selected/ |
Also, launch options can be set via arguments, for instance:
- npx ts-node <repository_path>/allure-filter.ts './testplan.json' './tests/e2e' '.*(test|spec)\\.ts' './tmp/allurectl-tests/'
GitLab CI
stages:
- test
tests:
stage: test
script:
- allurectl job-run plan --job-run-id $ALLURE_JOB_RUN_ID --output-file testplan.json
- npx ts-node ./tools/allure-filter.ts
- allurectl watch -- npx playwright test ./tests/selected
GitHub Actions
- name: Test with Playwright
env:
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }}
run: |
allurectl job-run plan --job-run-id $ALLURE_JOB_RUN_ID --output-file testplan.json
npx ts-node ./tools/allure-filter.ts
allurectl watch -- npx playwright test ./tests/selected