Add ci tag for running non headed tests, add command to package.json

This commit is contained in:
Emili Castells Guasch 2023-02-27 16:38:49 +01:00
parent e9eba09ebb
commit d31a9a982b
3 changed files with 4 additions and 2 deletions

View file

@ -43,7 +43,8 @@
"ddev:composer-update": "ddev composer update && ddev composer update --lock",
"ddev:unit-tests": "ddev exec phpunit",
"ddev:e2e-tests": "cp -n .env.e2e.example .env.e2e && ddev php tests/e2e/PHPUnit/setup.php && ddev exec phpunit -c tests/e2e/phpunit.xml.dist",
"ddev:test": "yarn run ddev:unit-tests && yarn run ddev:e2e-tests",
"ddev:pw-tests": "npx playwright test --grep @ci",
"ddev:test": "yarn run ddev:unit-tests && yarn run ddev:e2e-tests && yarn run ddev:pw-tests",
"ddev:lint": "yarn ddev:phpcs && yarn ddev:psalm",
"ddev:phpcs": "ddev exec phpcs --parallel=8 -s",
"ddev:psalm": "ddev exec psalm --show-info=false --threads=8 --diff",

View file

@ -8,6 +8,7 @@ Allows using environment variables inside the tests.
## Run Tests
```
$ npx playwright test
$ npx playwright test --grep @ci
$ npx playwright test example.spec.js --headed
$ npx playwright test example.spec.js --debug
$ npx playwright test -g "Test name here"

View file

@ -46,7 +46,7 @@ test('PayPal button place order from Product page', async ({page}) => {
await expect(title).toHaveText('Order received');
});
test('Advanced Credit and Debit Card (ACDC) place order from Checkout page', async ({page}) => {
test('Advanced Credit and Debit Card (ACDC) place order from Checkout page @ci', async ({page}) => {
await page.goto('/product/product/');
await page.locator('.single_add_to_cart_button').click();