Allure integration Jasmine framework
- Learn more about Allure Report at https://allurereport.org
- 📚 Documentation – discover official documentation for Allure Report
- ❓ Questions and Support – get help from the team and community
- 📢 Official annoucements – be in touch with the latest updates
- 💬 General Discussion – engage in casual conversations, share insights and ideas with the community
Use your favorite node package manager to install required packages:
npm add -D allure-jasmine
Create spec/helpers/setup.ts
file with following content:
const AllureJasmineReporter = require("allure-jasmine");
const reporter = new AllureJasmineReporter();
jasmine.getEnv().addReporter(reporter);
Check that the helper matches with helper
field in your spec/support/jasmine.json
file.
The plugin provides custom commands which allow to add additional info inside your tests:
import { epic, attachment, parameter } from "allure-js-commons";
it("my test", async () => {
await attachment("Attachment name", "Hello world!", "text/plain");
await epic("my_epic");
await parameter("parameter_name", "parameter_value", {
mode: "hidden",
excluded: false,
});
});
import { link, issue, tms } from "allure-js-commons";
it("basic test", async () => {
await link("https://allurereport.org", "link type", "Allure Report");
await issue("https://github.com/allure-framework/allure-js/issues/352", "Issue Name", );
await tms("https://github.com/allure-framework/allure-js/tasks/352", "Task Name");
});
You can also configure links formatters to make usage much more convenient. %s
in urlTemplate
parameter will be replaced by given value.
```ts
const AllureJasmineReporter = require("allure-jasmine");
const reporter = new AllureJasmineReporter({
+ links: [
+ {
+ type: "issue",
+ urlTemplate: "https://example.org/issues/%s",
+ nameTemplate: "Issue: %s",
+ },
+ {
+ type: "tms",
+ urlTemplate: "https://example.org/tasks/%s"
+ },
+ {
+ type: "custom",
+ urlTemplate: "https://example.org/custom/%s"
+ },
+ ],
});
jasmine.getEnv().addReporter(reporter);
Then you can assign link using shorter notation:
import { link, issue, tms } from "allure-js-commons";
it("basic test", async () => {
await issue("351");
await issue("352", "Issue Name");
await tms("351");
await tms("352", "Task Name");
await link("custom", "352");
await link("custom", "352", "Link name");
});
The integration supports Allure steps, use them in following way:
import { step } from "allure-js-commons";
it("my test", async () => {
await step("foo", async () => {
await step("bar", async () => {
await step("baz", async () => {});
});
});
});