Skip to content

Commit 50edadf

Browse files
committed
update config files
1 parent 371c256 commit 50edadf

File tree

5 files changed

+97
-25
lines changed

5 files changed

+97
-25
lines changed

cucumber.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
module.exports = {
2+
23
default: {
3-
requireModule: ["ts-node/register"],
4-
paths: ["tests/features/*.feature"],
5-
require: ["tests/steps/*.ts", "tests/hooks/*.ts"],
6-
format: ["progress-bar", "html:cucumber-report.html"],
7-
},
4+
5+
require: [
6+
'tests/steps/**/*.ts',
7+
'tests/support/**/*.ts',
8+
'tests/hooks/**/*.ts'
9+
],
10+
11+
requireModule: ['ts-node/register'],
12+
13+
paths: ['tests/features/**/*.feature'],
14+
15+
publishQuiet: true,
16+
17+
format: ['progress', 'html:cucumber-report.html']
18+
19+
}
20+
821
};
22+
23+
//module.exports = {
24+
// default: [
25+
// '--require-module', 'ts-node/register',
26+
// '--require', 'tests/support/world.ts',
27+
// '--require', 'tests/hooks/hooks.ts',
28+
// '--require', 'tests/steps/**/*.ts',
29+
// '--format', 'progress',
30+
// 'tests/features/**/*.feature'
31+
// ]
32+
// };

package-lock.json

Lines changed: 28 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22
"name": "playwright-typescript-practice",
33
"version": "1.0.0",
44
"main": "index.js",
5-
"scripts": {},
5+
"scripts": {
6+
"cucumber": "npx cucumber-js",
7+
"tests": "npx playwright test",
8+
"test-file": "npx playwright test --grep file-name.spec.ts",
9+
"test-tag": "npx playwright test --grep @tagName",
10+
"test-smoke": "npx playwright test --grep @smoke",
11+
"report": "npx playwright show-report"
12+
},
613
"keywords": [],
7-
"author": "",
14+
"author": "Amine",
815
"license": "ISC",
916
"description": "",
1017
"devDependencies": {
1118
"@cucumber/cucumber": "^12.2.0",
1219
"@playwright/test": "^1.56.0",
13-
"@types/node": "^24.7.0",
14-
"ts-node": "^10.9.2"
20+
"@types/cucumber": "^6.0.1",
21+
"@types/node": "^24.7.2",
22+
"dotenv": "^16.0.0",
23+
"ts-node": "^10.9.2",
24+
"typescript": "^5.9.3"
1525
}
1626
}

playwright.config.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, devices } from '@playwright/test';
1+
import { defineConfig, devices } from "@playwright/test";
22

33
/**
44
* Read environment variables from file.
@@ -12,7 +12,7 @@ import { defineConfig, devices } from '@playwright/test';
1212
* See https://playwright.dev/docs/test-configuration.
1313
*/
1414
export default defineConfig({
15-
testDir: './tests',
15+
testDir: "./tests",
1616
/* Run tests in files in parallel */
1717
fullyParallel: true,
1818
/* Fail the build on CI if you accidentally left test.only in the source code. */
@@ -22,31 +22,33 @@ export default defineConfig({
2222
/* Opt out of parallel tests on CI. */
2323
workers: process.env.CI ? 1 : undefined,
2424
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
25-
reporter: 'html',
25+
reporter: "html",
2626
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2727
use: {
2828
/* Base URL to use in actions like `await page.goto('')`. */
2929
// baseURL: 'http://localhost:3000',
3030

3131
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
32-
trace: 'on-first-retry',
32+
trace: "on-first-retry",
33+
headless: false,
34+
screenshot: 'only-on-failure'
3335
},
3436

3537
/* Configure projects for major browsers */
3638
projects: [
3739
{
38-
name: 'chromium',
39-
use: { ...devices['Desktop Chrome'] },
40+
name: "chromium",
41+
use: { ...devices["Desktop Chrome"] },
4042
},
4143

4244
{
43-
name: 'firefox',
44-
use: { ...devices['Desktop Firefox'] },
45+
name: "firefox",
46+
use: { ...devices["Desktop Firefox"] },
4547
},
4648

4749
{
48-
name: 'webkit',
49-
use: { ...devices['Desktop Safari'] },
50+
name: "webkit",
51+
use: { ...devices["Desktop Safari"] },
5052
},
5153

5254
/* Test against mobile viewports. */

tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"module": "commonjs",
5+
"strict": true,
6+
"esModuleInterop": true,
7+
"skipLibCheck": true,
8+
"resolveJsonModule": true,
9+
"types": ["@types/node", "@cucumber/cucumber"]
10+
},
11+
"include": ["tests/**/*.ts"]
12+
}
13+
14+

0 commit comments

Comments
 (0)