Skip to content

Latest commit

 

History

History
110 lines (90 loc) · 2.03 KB

README.md

File metadata and controls

110 lines (90 loc) · 2.03 KB

allure-codeceptjs

Installation

npm i -D allure-codeceptjs

Usage

Add the allure plugin inside you plugins section of your CodeceptJS config file. For instance the config file is codecept.config.(js|ts) then:

  plugins: {
  ...
    allure: {
      enabled: true,
      require: "allure-codeceptjs",
    },
  ...
  }
};

Metadata usage

Right now you can access allure API through codeceptjs container.

Feature("login-feature");
Scenario("login-scenario1", async () => {
  const allure = codeceptjs.container.plugins("allure");

  allure.label("name", "value");
  allure.tag("tag1");
  allure.tags("tag2", "tag3");
  allure.issue("issueName", "google.com");
  allure.owner("eroshenkoam");
  allure.layer("UI");
  allure.id("228");
  allure.description("aga");
  allure.story("aga");
  allure.feature("aga");
  allure.epic("aga");
  allure.epic("severity");
  allure.addAttachment("data.txt", "some data", "text/plain");
});

You can also use tags to manage labels on scenarios.

Id

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.id:228");

Label

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.label.{{labelName}}:{{labelValue}}");

Story

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.label.story:storyName");

Suite

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.label.suite:suiteName");

Owner

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.label.owner:ownerName");

Tag

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.label.tag:tagName");

or keep it simple:

Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("tagName");