allure-js icon indicating copy to clipboard operation
allure-js copied to clipboard

added support for links to issues and tms for codeceptjs

Open guiyomh opened this issue 1 year ago • 8 comments

Context

I want use allure xray plugin, but I must configure link on my test. So, I propose this PR to set up the links to issue and tms.

Issue Link

Setup codeceptjs plugin with:

const { setHeadlessWhen, setCommonPlugins } = require("@codeceptjs/configure");
const path = require("path");

setCommonPlugins();

module.exports.config = {
  tests: "./**/*.test.js",
  output: path.resolve(__dirname, "./output"),
  plugins: {
    allure: {
      enabled: true,
      require: "allure-codeceptjs",
+      issueURlTemplate: "https://example.qameta.io/allure-framework/allure-js/issues/%s",
    },
  },
};
Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.issue:MY-ISSUE-82");

TMS Link

Setup codeceptjs plugin with:

const { setHeadlessWhen, setCommonPlugins } = require("@codeceptjs/configure");
const path = require("path");

setCommonPlugins();

module.exports.config = {
  tests: "./**/*.test.js",
  output: path.resolve(__dirname, "./output"),
  plugins: {
    allure: {
      enabled: true,
      require: "allure-codeceptjs",
+      tmsURLTemplate: "https://example.qameta.io/allure-framework/allure-js/tests/%s",
    },
  },
};
Feature("login-feature");
Scenario("login-scenario1", async () => {
  // your test
}).tag("@allure.tms:MY-TEST-CASE-64");

Checklist

guiyomh avatar Mar 14 '23 18:03 guiyomh

@vovsemenv is this feature right for you?

guiyomh avatar Mar 15 '23 09:03 guiyomh

Hello @guiyomh! Looking good, but I have thoughts that this feature needs to be handled by the report-generator side of allure. I will add more detailed review later

vovsemenv avatar Mar 15 '23 10:03 vovsemenv

You mean make a java plugin that does this job?

guiyomh avatar Mar 15 '23 10:03 guiyomh

yep

vovsemenv avatar Mar 15 '23 10:03 vovsemenv

I think it's a good idea, but I don't know the plugin system very well. I didn't see how to manage the priority between plugins. For example if I convert this feature to an allure2 plugin. It should be executed before the xray plugin, otherwise it doesn't make sense.

@vovsemenv do you know where can I found documentation about this ?

guiyomh avatar Mar 15 '23 14:03 guiyomh

@vovsemenv @guiyomh we'll add tags processing on the generator side for labels. Still, the links should be processed independently at the framework side because links require additional configuration (link patterns), and users may build an aggregated report from different tests, which my require different link patterns per test type.

baev avatar Mar 17 '23 05:03 baev

BTW for allure-cucumberjs we have the following config https://github.com/allure-framework/allure-js/tree/master/packages/allure-cucumberjs

We really need to try harder to align simular features between the frameworks 🤪

baev avatar Mar 17 '23 05:03 baev

If you want, I can do other PR to align other framework on this MR.

guiyomh avatar Mar 19 '23 14:03 guiyomh