Skip to content

Adding links templates

Alexandr D edited this page Feb 12, 2019 · 4 revisions

Adding links templates

Available from version 2.5.1.

In most cases, when using the issue/link/tms attributes, you always use the same url.

In order not to write every time in the attribute the entire url, you can create a links templates in configuration file.

When using link templates, the value inside {} in the pattern will be replaced by url value from the corresponding attribute.

If in some link you do not want to use pattern, you can pass the false argument to attribute.

Some examples:

Links templates in cfg:

"links": [
  "http://site.com/{link}"
]

Code:

[AllureLink("http://mysite.com/ID-123", false)] // will not replaced by pattern and be the same
[AllureLink("ID-124")] // will replaced to => http://site.com/ID-124
public void Test()
{
   //
}