-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
17 changed files
with
356 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect, it } from "vitest"; | ||
import { runCodeceptJsInlineTest } from "../utils.js"; | ||
|
||
it("sets allure labels from env variables", async () => { | ||
const { tests } = await runCodeceptJsInlineTest( | ||
{ | ||
"sample.test.js": ` | ||
Feature("sample-feature"); | ||
Scenario("sample-scenario", async () => {}); | ||
`, | ||
}, | ||
{ | ||
ALLURE_LABEL_A: "a", | ||
ALLURE_LABEL_B: "b", | ||
}, | ||
); | ||
|
||
expect(tests).toHaveLength(1); | ||
expect(tests[0].labels).toEqual( | ||
expect.arrayContaining([ | ||
{ name: "A", value: "a" }, | ||
{ name: "B", value: "b" }, | ||
]), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { expect, it } from "vitest"; | ||
import { Stage, Status } from "allure-js-commons"; | ||
import { runCucumberInlineTest } from "../utils.js"; | ||
|
||
it("sets label from env variables", async () => { | ||
const { tests } = await runCucumberInlineTest(["simple"], ["simple"], undefined, undefined, { | ||
ALLURE_LABEL_A: "a", | ||
ALLURE_LABEL_B: "b", | ||
}); | ||
|
||
expect(tests).toHaveLength(3); | ||
expect(tests).toContainEqual( | ||
expect.objectContaining({ | ||
name: "passed", | ||
status: Status.PASSED, | ||
stage: Stage.FINISHED, | ||
steps: [ | ||
expect.objectContaining({ | ||
name: "Given a passed step", | ||
status: Status.PASSED, | ||
stage: Stage.FINISHED, | ||
}), | ||
], | ||
labels: expect.arrayContaining([ | ||
{ | ||
name: "A", | ||
value: "a", | ||
}, | ||
{ | ||
name: "B", | ||
value: "b", | ||
}, | ||
]), | ||
}), | ||
); | ||
expect(tests).toContainEqual( | ||
expect.objectContaining({ | ||
name: "failed", | ||
status: Status.FAILED, | ||
stage: Stage.FINISHED, | ||
steps: [ | ||
expect.objectContaining({ | ||
name: "Given a failed step", | ||
status: Status.FAILED, | ||
stage: Stage.FINISHED, | ||
statusDetails: expect.objectContaining({ | ||
message: expect.stringContaining("AssertionError"), | ||
trace: expect.any(String), | ||
}), | ||
}), | ||
], | ||
labels: expect.arrayContaining([ | ||
{ | ||
name: "A", | ||
value: "a", | ||
}, | ||
{ | ||
name: "B", | ||
value: "b", | ||
}, | ||
]), | ||
}), | ||
); | ||
expect(tests).toContainEqual( | ||
expect.objectContaining({ | ||
name: "broken", | ||
status: Status.BROKEN, | ||
stage: Stage.FINISHED, | ||
steps: [ | ||
expect.objectContaining({ | ||
name: "Given a broken step", | ||
status: Status.BROKEN, | ||
stage: Stage.FINISHED, | ||
statusDetails: expect.objectContaining({ | ||
message: expect.stringContaining("Error"), | ||
trace: expect.any(String), | ||
}), | ||
}), | ||
], | ||
labels: expect.arrayContaining([ | ||
{ | ||
name: "A", | ||
value: "a", | ||
}, | ||
{ | ||
name: "B", | ||
value: "b", | ||
}, | ||
]), | ||
}), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { expect, it } from "vitest"; | ||
import { Stage, Status } from "allure-js-commons"; | ||
import { runCypressInlineTest } from "../utils.js"; | ||
|
||
it("sets allure labels from env variables", async () => { | ||
const { tests } = await runCypressInlineTest( | ||
{ | ||
"cypress/e2e/sample.cy.js": () => ` | ||
it("passed", () => { | ||
cy.wrap(1).should("eq", 1); | ||
}); | ||
`, | ||
}, | ||
() => ({ | ||
ALLURE_LABEL_A: "a", | ||
ALLURE_LABEL_B: "b", | ||
}), | ||
); | ||
|
||
expect(tests).toHaveLength(1); | ||
expect(tests[0].status).toBe(Status.PASSED); | ||
expect(tests[0].stage).toBe(Stage.FINISHED); | ||
expect(tests[0].labels).toEqual( | ||
expect.arrayContaining([ | ||
{ name: "A", value: "a" }, | ||
{ name: "B", value: "b" }, | ||
]), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect, it } from "vitest"; | ||
import { runJasmineInlineTest } from "../utils.js"; | ||
|
||
it("sets allure labels from env variables", async () => { | ||
const { tests } = await runJasmineInlineTest( | ||
{ | ||
"spec/test/sample1.spec.js": ` | ||
it("should pass", () => { | ||
expect(true).toBe(true); | ||
}); | ||
`, | ||
}, | ||
{ | ||
ALLURE_LABEL_A: "a", | ||
ALLURE_LABEL_B: "b", | ||
}, | ||
); | ||
|
||
expect(tests).toHaveLength(1); | ||
expect(tests[0].labels).toEqual( | ||
expect.arrayContaining([ | ||
{ name: "A", value: "a" }, | ||
{ name: "B", value: "b" }, | ||
]), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect, it } from "vitest"; | ||
import { runJestInlineTest } from "../utils.js"; | ||
|
||
it("sets allure labels from env variables", async () => { | ||
const { tests } = await runJestInlineTest( | ||
{ | ||
"sample.spec.js": ` | ||
it("should pass", () => { | ||
expect(true).toBe(true); | ||
}); | ||
`, | ||
}, | ||
() => ({ | ||
ALLURE_LABEL_A: "a", | ||
ALLURE_LABEL_B: "b", | ||
}), | ||
); | ||
|
||
expect(tests).toHaveLength(1); | ||
expect(tests[0].labels).toEqual( | ||
expect.arrayContaining([ | ||
{ name: "A", value: "a" }, | ||
{ name: "B", value: "b" }, | ||
]), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.