Skip to content

Commit 400059c

Browse files
author
DavertMik
committed
added support for custom config -c, added checks to workflows
1 parent 2e33858 commit 400059c

File tree

4 files changed

+35
-32
lines changed

4 files changed

+35
-32
lines changed

.github/workflows/playwright.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,41 @@ env:
1515

1616
jobs:
1717
build:
18-
1918
runs-on: ubuntu-latest
2019

2120
strategy:
2221
matrix:
2322
node-version: [20.x]
2423

2524
steps:
26-
- uses: actions/checkout@v4
27-
- name: Use Node.js ${{ matrix.node-version }}
28-
uses: actions/setup-node@v4
29-
with:
30-
node-version: ${{ matrix.node-version }}
31-
- uses: shivammathur/setup-php@v2
32-
with:
33-
php-version: 7.4
34-
- name: npm install
35-
run: |
36-
npm i --force
37-
env:
38-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
39-
- name: Install browsers and deps
40-
run: npx playwright install && npx playwright install-deps
41-
- name: start a server
42-
run: "php -S 127.0.0.1:8000 -t test/data/app &"
43-
- name: run chromium tests
44-
run: "./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
45-
- name: run chromium with restart==browser tests
46-
run: "BROWSER_RESTART=browser ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
47-
- name: run chromium with restart==session tests
48-
run: "BROWSER_RESTART=session ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
49-
- name: run firefox tests
50-
run: "BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
51-
- name: run webkit tests
52-
run: "BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
53-
- name: run chromium unit tests
54-
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000
25+
- uses: actions/checkout@v4
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
- uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: 7.4
33+
- name: npm install
34+
run: |
35+
npm i --force
36+
env:
37+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
38+
- name: Install browsers and deps
39+
run: npx playwright install && npx playwright install-deps
40+
- name: check
41+
run: './bin/codecept.js check -c test/acceptance/codecept.Playwright.js'
42+
- name: start a server
43+
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
44+
- name: run chromium tests
45+
run: './bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
46+
- name: run chromium with restart==browser tests
47+
run: 'BROWSER_RESTART=browser ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
48+
- name: run chromium with restart==session tests
49+
run: 'BROWSER_RESTART=session ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
50+
- name: run firefox tests
51+
run: 'BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
52+
- name: run webkit tests
53+
run: 'BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug'
54+
- name: run chromium unit tests
55+
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000

.github/workflows/webdriver.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
3939
- name: start a server
4040
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
41+
- name: Check CodeceptJS can be started
42+
run: './bin/codecept.js check -c test/acceptance/codecept.WebDriver.js'
4143
- name: run unit tests
4244
run: ./node_modules/.bin/mocha test/helper/WebDriver_test.js --exit
4345
- name: run tests

bin/codecept.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ program
6060

6161
program
6262
.command('check')
63+
.option(commandFlags.config.flag, commandFlags.config.description)
6364
.description('Checks configuration and environment before running tests')
6465
.option('-t, --timeout [ms]', 'timeout for checks in ms, 20000 by default')
6566
.action(errorHandler(require('../lib/command/check')))

lib/command/check.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const { createTest } = require('../mocha/test')
1010
const { getMachineInfo } = require('./info')
1111
const definitions = require('./definitions')
1212

13-
module.exports = async function (test, options) {
14-
if (options.grep) process.env.grep = options.grep
13+
module.exports = async function (options) {
1514
const configFile = options.config
1615

1716
setTimeout(() => {

0 commit comments

Comments
 (0)