artes 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +1 -1
- package/src/helper/executers/projectCreator.js +14 -9
package/README.md
CHANGED
|
@@ -310,27 +310,27 @@ Undefined hooks are automatically skipped.
|
|
|
310
310
|
// tests/steps/hooks.js
|
|
311
311
|
|
|
312
312
|
export function BeforeStep() {
|
|
313
|
-
|
|
313
|
+
// hook for before each step
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
export function Before() {
|
|
317
|
-
|
|
317
|
+
// hook for before each test
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
export function BeforeAll() {
|
|
321
|
-
|
|
321
|
+
// hook for before all tests
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
export function AfterStep() {
|
|
325
|
-
|
|
325
|
+
// hook for after each step
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
export function After() {
|
|
329
|
-
|
|
329
|
+
// hook for after each test
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
export function AfterAll() {
|
|
333
|
-
|
|
333
|
+
// hook for after all tests
|
|
334
334
|
}
|
|
335
335
|
```
|
|
336
336
|
|
package/package.json
CHANGED
|
@@ -16,16 +16,21 @@ function createProject(createYes) {
|
|
|
16
16
|
path.join(projectDir, ".vscode"),
|
|
17
17
|
].forEach((dir) => fs.mkdirSync(dir, { recursive: true }));
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
console.log("🚀 Initializing project...");
|
|
20
|
-
execSync(`npm init ${createYes ? "-y" : ""}`, { stdio: "inherit" });
|
|
21
|
-
execSync("npm i artes", { stdio: "inherit" });
|
|
21
|
+
execSync(`npm init ${createYes ? "-y" : ""}`, {cwd: projectDir, stdio: "inherit" });
|
|
22
|
+
execSync("npm i artes", {cwd: projectDir, stdio: "inherit" });
|
|
22
23
|
|
|
23
24
|
console.log("📦 Setting up browsers...");
|
|
24
|
-
execSync("npx playwright install", { stdio: "inherit" });
|
|
25
|
+
execSync("npx playwright install", {cwd: projectDir, stdio: "inherit" });
|
|
25
26
|
|
|
26
27
|
const packageJsonPath = path.join(projectDir, "package.json");
|
|
27
28
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
28
29
|
|
|
30
|
+
if (packageJson.type) {
|
|
31
|
+
delete packageJson.type;
|
|
32
|
+
}
|
|
33
|
+
|
|
29
34
|
packageJson.scripts = {
|
|
30
35
|
test: "npx artes",
|
|
31
36
|
testWithReport: "npx artes -r",
|
|
@@ -125,27 +130,27 @@ await context.page.goto("https://www.saucedemo.com/");
|
|
|
125
130
|
|
|
126
131
|
const hooksContent = `
|
|
127
132
|
export function BeforeStep() {
|
|
128
|
-
|
|
133
|
+
// hook for before each step
|
|
129
134
|
}
|
|
130
135
|
|
|
131
136
|
export function Before() {
|
|
132
|
-
|
|
137
|
+
// hook for before each test
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
export function BeforeAll() {
|
|
136
|
-
|
|
141
|
+
// hook for before all tests
|
|
137
142
|
}
|
|
138
143
|
|
|
139
144
|
export function AfterStep() {
|
|
140
|
-
|
|
145
|
+
// hook for after each step
|
|
141
146
|
}
|
|
142
147
|
|
|
143
148
|
export function After() {
|
|
144
|
-
|
|
149
|
+
// hook for after each test
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
export function AfterAll() {
|
|
148
|
-
|
|
153
|
+
// hook for after all tests
|
|
149
154
|
}
|
|
150
155
|
`;
|
|
151
156
|
|