Skip to content

Commit 8060ef3

Browse files
committed
fix(allure-js): fix test duplicating by adding package name to path
1 parent 244cc18 commit 8060ef3

File tree

80 files changed

+703
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+703
-341
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "allure-js",
3-
"version": "3.4.4",
3+
"version": "3.4.5",
44
"private": true,
55
"workspaces": [
66
"packages/*"

packages/allure-codeceptjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "allure-codeceptjs",
3-
"version": "3.4.4",
3+
"version": "3.4.5",
44
"description": "Allure codeceptjs integration",
55
"keywords": [
66
"allure",

packages/allure-codeceptjs/src/reporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class AllureCodeceptJsReporter extends AllureMochaReporter {
227227

228228
stopCurrentStep(updateFunc: (result: StepResult) => void) {
229229
const root = this.currentHook ?? this.currentTest;
230-
const currentStep = root ? this.runtime.currentStep(root) : undefined;
230+
const currentStep = root ? (this.runtime.currentStep(root)) : undefined;
231231

232232
this.stopStepById(currentStep, updateFunc);
233233
}

packages/allure-codeceptjs/test/spec/labels.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ it("should add package label", async () => {
7373
labels: expect.arrayContaining([
7474
{
7575
name: "package",
76-
value: "nested.login.test.js",
76+
value: "allure-codeceptjs.nested.login.test.js",
7777
},
7878
]),
7979
}),
@@ -82,7 +82,7 @@ it("should add package label", async () => {
8282
labels: expect.arrayContaining([
8383
{
8484
name: "package",
85-
value: "nested.login.test.js",
85+
value: "allure-codeceptjs.nested.login.test.js",
8686
},
8787
]),
8888
}),
@@ -110,21 +110,21 @@ it("should not depend on CWD", async () => {
110110
expect.arrayContaining([
111111
expect.objectContaining({
112112
name: "failed-scenario",
113-
fullName: "nested/login.test.js: login-feature > failed-scenario",
113+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > failed-scenario",
114114
labels: expect.arrayContaining([
115115
{
116116
name: "package",
117-
value: "nested.login.test.js",
117+
value: "allure-codeceptjs.nested.login.test.js",
118118
},
119119
]),
120120
}),
121121
expect.objectContaining({
122122
name: "passed-scenario",
123-
fullName: "nested/login.test.js: login-feature > passed-scenario",
123+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > passed-scenario",
124124
labels: expect.arrayContaining([
125125
{
126126
name: "package",
127-
value: "nested.login.test.js",
127+
value: "allure-codeceptjs.nested.login.test.js",
128128
},
129129
]),
130130
}),

packages/allure-codeceptjs/test/spec/simple.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,34 @@ it("handles simple scenarios", async () => {
2222
expect.objectContaining({
2323
status: Status.PASSED,
2424
name: "logout-scenario1",
25-
fullName: "logout.test.js: logout-feature > logout-scenario1",
26-
testCaseId: "b1cbd7e3cf91f03aa08b912903a297a0",
27-
historyId: "b1cbd7e3cf91f03aa08b912903a297a0:d41d8cd98f00b204e9800998ecf8427e",
25+
fullName: "allure-codeceptjs:logout.test.js: logout-feature > logout-scenario1",
26+
testCaseId: "778e673c36fe833488ed693c737b345d",
27+
historyId: "778e673c36fe833488ed693c737b345d:d41d8cd98f00b204e9800998ecf8427e",
2828
}),
2929

3030
expect.objectContaining({
3131
status: Status.PASSED,
3232
stage: Stage.FINISHED,
3333
name: "logout-scenario2",
34-
fullName: "logout.test.js: logout-feature > logout-scenario2",
35-
testCaseId: "cf2fc4ae2f9143145a3ee3bae6dff66b",
36-
historyId: "cf2fc4ae2f9143145a3ee3bae6dff66b:d41d8cd98f00b204e9800998ecf8427e",
34+
fullName: "allure-codeceptjs:logout.test.js: logout-feature > logout-scenario2",
35+
testCaseId: "7692f3496c3d2d7d6de55c0484320613",
36+
historyId: "7692f3496c3d2d7d6de55c0484320613:d41d8cd98f00b204e9800998ecf8427e",
3737
}),
3838
expect.objectContaining({
3939
status: Status.PASSED,
4040
stage: Stage.FINISHED,
4141
name: "login-scenario1",
42-
fullName: "nested/login.test.js: login-feature > login-scenario1",
43-
testCaseId: "157be92d422d04e9b79d6d2fbb5020de",
44-
historyId: "157be92d422d04e9b79d6d2fbb5020de:d41d8cd98f00b204e9800998ecf8427e",
42+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > login-scenario1",
43+
testCaseId: "d0043c593f1348f10b0cbea74efb4c72",
44+
historyId: "d0043c593f1348f10b0cbea74efb4c72:d41d8cd98f00b204e9800998ecf8427e",
4545
}),
4646
expect.objectContaining({
4747
status: Status.PASSED,
4848
stage: Stage.FINISHED,
4949
name: "login-scenario2",
50-
fullName: "nested/login.test.js: login-feature > login-scenario2",
51-
testCaseId: "fbb987bcdcd21440bb0a4f4d79711387",
52-
historyId: "fbb987bcdcd21440bb0a4f4d79711387:d41d8cd98f00b204e9800998ecf8427e",
50+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > login-scenario2",
51+
testCaseId: "c4b12b93e5c7ebe3f4a12445843388f6",
52+
historyId: "c4b12b93e5c7ebe3f4a12445843388f6:d41d8cd98f00b204e9800998ecf8427e",
5353
}),
5454
]),
5555
);

packages/allure-codeceptjs/test/spec/skipped.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ it("doesn't report skipped features and steps", async () => {
2626
expect(tests).toEqual(
2727
expect.arrayContaining([
2828
expect.objectContaining({
29-
fullName: "skipped_feature1.test.js: logout-feature1 > logout-scenario1",
29+
fullName: "allure-codeceptjs:skipped_feature1.test.js: logout-feature1 > logout-scenario1",
3030
name: "logout-scenario1",
3131
status: Status.SKIPPED,
3232
statusDetails: expect.objectContaining({
3333
message: "Test skipped",
3434
}),
3535
}),
3636
expect.objectContaining({
37-
fullName: "skipped_feature2.test.js: logout-feature2 > logout-scenario1",
37+
fullName: "allure-codeceptjs:skipped_feature2.test.js: logout-feature2 > logout-scenario1",
3838
name: "logout-scenario1",
3939
status: Status.SKIPPED,
4040
statusDetails: expect.objectContaining({
4141
message: "Test skipped",
4242
}),
4343
}),
4444
expect.objectContaining({
45-
fullName: "skipped_scenario1.test.js: logout-feature3 > logout-scenario1",
45+
fullName: "allure-codeceptjs:skipped_scenario1.test.js: logout-feature3 > logout-scenario1",
4646
name: "logout-scenario1",
4747
status: Status.SKIPPED,
4848
statusDetails: expect.objectContaining({
4949
message: "Test skipped",
5050
}),
5151
}),
5252
expect.objectContaining({
53-
fullName: "skipped_scenario2.test.js: logout-feature4 > logout-scenario1",
53+
fullName: "allure-codeceptjs:skipped_scenario2.test.js: logout-feature4 > logout-scenario1",
5454
name: "logout-scenario1",
5555
status: Status.SKIPPED,
5656
statusDetails: expect.objectContaining({

packages/allure-codeceptjs/test/spec/testplan.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ it("should support test plan", async () => {
1212
selector: "invalid",
1313
},
1414
{
15-
selector: "nested/login.test.js: login-feature > login-scenario1",
15+
selector: "allure-codeceptjs:nested/login.test.js: login-feature > login-scenario1",
1616
},
1717
{
18-
selector: "logout.test.js: logout-feature > logout-scenario1",
18+
selector: "allure-codeceptjs:logout.test.js: logout-feature > logout-scenario1",
1919
},
2020
],
2121
};
@@ -47,19 +47,19 @@ it("should support test plan", async () => {
4747
expect.objectContaining({
4848
status: Status.PASSED,
4949
name: "logout-scenario1",
50-
fullName: "logout.test.js: logout-feature > logout-scenario1",
50+
fullName: "allure-codeceptjs:logout.test.js: logout-feature > logout-scenario1",
5151
}),
5252
expect.objectContaining({
5353
status: Status.PASSED,
5454
stage: Stage.FINISHED,
5555
name: "login-scenario1",
56-
fullName: "nested/login.test.js: login-feature > login-scenario1",
56+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > login-scenario1",
5757
}),
5858
expect.objectContaining({
5959
status: Status.PASSED,
6060
stage: Stage.FINISHED,
6161
name: "login-scenario3",
62-
fullName: "nested/login.test.js: login-feature > login-scenario3 @allure.id:321",
62+
fullName: "allure-codeceptjs:nested/login.test.js: login-feature > login-scenario3 @allure.id:321",
6363
}),
6464
]),
6565
);

packages/allure-codeceptjs/test/spec/titlePath.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ it("should assign titlePath property to the test result", async () => {
1313

1414
const [tr] = tests;
1515

16-
expect(tr.titlePath).toEqual(["spec", "test", "sample.test.js", "login-feature"]);
16+
expect(tr.titlePath).toEqual(["allure-codeceptjs", "spec", "test", "sample.test.js", "login-feature"]);
1717
});

packages/allure-codeceptjs/test/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const runCodeceptJsInlineTest = async (
2424
): Promise<RunResult> => {
2525
const testFiles = {
2626
// package.json is used to find project root in case of absolute file paths are used
27-
"package.json": '{ "name": "dummy"}',
27+
"package.json": JSON.stringify({ name: "allure-codeceptjs" }),
2828
"codecept.conf.js": await readFile(resolvePath(__dirname, "./samples/codecept.conf.js"), "utf-8"),
2929
"helper.js": await readFile(resolvePath(__dirname, "./samples/helper.js"), "utf-8"),
3030
...files,

packages/allure-cucumberjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "allure-cucumberjs",
3-
"version": "3.4.4",
3+
"version": "3.4.5",
44
"description": "Allure Cucumber.JS integration",
55
"keywords": [
66
"allure",

0 commit comments

Comments
 (0)