-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix skipped tests reporting cover rest functionality with tests hide jest log during unit tests
- Loading branch information
Showing
18 changed files
with
242 additions
and
4 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,3 @@ | ||
it("json", () => { | ||
allure.attachment(JSON.stringify({ foo: "bar" }), "application/json"); | ||
}); |
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,7 @@ | ||
it("markdown", () => { | ||
allure.description("foo"); | ||
}); | ||
|
||
it("html", () => { | ||
allure.descriptionHtml("foo"); | ||
}); |
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,3 @@ | ||
it("historyId", () => { | ||
allure.historyId("foo"); | ||
}); |
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,6 @@ | ||
it("custom", () => { | ||
allure.parameter("foo", "bar", { | ||
excluded: false, | ||
mode: "hidden", | ||
}); | ||
}); |
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,5 @@ | ||
it.skip("skipped", () => {}); | ||
|
||
describe.skip("suite", () => { | ||
it("skipped", () => {}); | ||
}); |
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,19 @@ | ||
it("passed", async () => { | ||
await allure.step("first step name", async (s1) => { | ||
await s1.step("second step name", async (s2) => { | ||
await s2.step("third step name", (s3) => { | ||
s3.label("foo", "bar"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
it("failed", async () => { | ||
await allure.step("first step name", async (s1) => { | ||
await s1.step("second step name", async (s2) => { | ||
await s2.step("third step name", (s3) => { | ||
throw new Error("foo"); | ||
}); | ||
}); | ||
}); | ||
}); |
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,3 @@ | ||
it("testCaseId", () => { | ||
allure.testCaseId("foo"); | ||
}); |
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 @@ | ||
it.todo("todo"); |
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,19 @@ | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("attachments", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/attachments.test.js"]); | ||
}); | ||
|
||
it("adds markdown description", () => { | ||
const { attachments } = results.json; | ||
|
||
attachments.should.include.something.like({ | ||
name: "Attachment", | ||
type: "application/json", | ||
}); | ||
}); | ||
}); |
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,22 @@ | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("description", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/description.test.js"]); | ||
}); | ||
|
||
it("adds markdown description", () => { | ||
const { description } = results.markdown; | ||
|
||
expect(description).eq("foo"); | ||
}); | ||
|
||
it("adds custom history id", () => { | ||
const { descriptionHtml } = results.html; | ||
|
||
expect(descriptionHtml).eq("foo"); | ||
}); | ||
}); |
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,16 @@ | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("historyId", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/historyId.test.js"]); | ||
}); | ||
|
||
it("adds custom history id", () => { | ||
const { historyId } = results.historyId; | ||
|
||
expect(historyId).eq("foo"); | ||
}); | ||
}); |
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,20 @@ | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("parameters", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/parameters.test.js"]); | ||
}); | ||
|
||
it("adds custom parameter", () => { | ||
const { parameters } = results.custom; | ||
|
||
parameters.should.include.something.that.deep.equals({ | ||
name: "foo", | ||
value: "bar", | ||
excluded: false, | ||
mode: "hidden", | ||
}); | ||
}); | ||
}); |
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 { Stage, Status } from "allure-js-commons"; | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("skipped", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/skipped.test.js"]); | ||
}); | ||
|
||
it("marks skipped test as skipped", () => { | ||
const { stage, status } = results.skipped; | ||
|
||
expect(stage).eq(Stage.PENDING); | ||
expect(status).eq(Status.SKIPPED); | ||
}); | ||
|
||
it("marks test inside skipped suite as skipped", () => { | ||
const { stage, status } = results["suite skipped"]; | ||
|
||
expect(stage).eq(Stage.PENDING); | ||
expect(status).eq(Status.SKIPPED); | ||
}); | ||
}); |
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,50 @@ | ||
import { Stage, Status } from "allure-js-commons"; | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("steps", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/steps.test.js"]); | ||
}); | ||
|
||
describe("passed steps", () => { | ||
it("adds nested steps", () => { | ||
const { steps, labels } = results.passed; | ||
|
||
labels.should.include.something.that.deep.equals({ | ||
name: "foo", | ||
value: "bar", | ||
}); | ||
|
||
expect(steps.length).eq(1); | ||
expect(steps[0].name).eq("first step name"); | ||
expect(steps[0].steps.length).eq(1); | ||
expect(steps[0].steps[0].name).eq("second step name"); | ||
expect(steps[0].steps[0].steps.length).eq(1); | ||
expect(steps[0].steps[0].steps[0].name).eq("third step name"); | ||
}); | ||
}); | ||
|
||
describe("failed steps", () => { | ||
it("fails the test with original step error", () => { | ||
const { status, statusDetails, steps } = results.failed; | ||
|
||
expect(status).eq(Status.FAILED); | ||
expect(statusDetails.message).eq("foo"); | ||
expect(steps).to.have.length(1); | ||
expect(steps[0].name).eq("first step name"); | ||
expect(steps[0].status).eq(Status.BROKEN); | ||
expect(steps[0].statusDetails.message).eq("foo"); | ||
expect(steps[0].steps.length).eq(1); | ||
expect(steps[0].steps[0].name).eq("second step name"); | ||
expect(steps[0].steps[0].status).eq(Status.BROKEN); | ||
expect(steps[0].steps[0].statusDetails.message).eq("foo"); | ||
expect(steps[0].steps[0].steps.length).eq(1); | ||
expect(steps[0].steps[0].steps[0].name).eq("third step name"); | ||
expect(steps[0].steps[0].steps[0].status).eq(Status.BROKEN); | ||
expect(steps[0].steps[0].steps[0].statusDetails.message).eq("foo"); | ||
}); | ||
}); | ||
}); |
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,16 @@ | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("testCaseId", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/testCaseId.test.js"]); | ||
}); | ||
|
||
it("adds custom history id", () => { | ||
const { testCaseId } = results.testCaseId; | ||
|
||
expect(testCaseId).eq("foo"); | ||
}); | ||
}); |
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,18 @@ | ||
import { Stage, Status } from "allure-js-commons"; | ||
import { expect } from "chai"; | ||
import { runJestTests, TestResultsByFullName } from "../utils"; | ||
|
||
describe("todo", () => { | ||
let results: TestResultsByFullName; | ||
|
||
beforeEach(async () => { | ||
results = await runJestTests(["./test/fixtures/todo.test.js"]); | ||
}); | ||
|
||
it("marks todo tests as skipped", () => { | ||
const { stage, status } = results.todo; | ||
|
||
expect(stage).eq(Stage.PENDING); | ||
expect(status).eq(Status.SKIPPED); | ||
}); | ||
}); |
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