@zohodesk/testinglibrary 0.1.6-exp.3 → 0.1.6-exp.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,8 +34,10 @@ class Formatter {
34
34
  }
35
35
  test(node, fixtures, children) {
36
36
  const fixturesStr = [...fixtures].join(', ');
37
+ // TODO: Adding tags to title might cause test title to become larger and it might cause issues while reporting
38
+ // Currently playwright is working on tags API. https://github.com/microsoft/playwright/issues/21202
37
39
  // prettier-ignore
38
- return [`test${this.getSubFn(node)}(${this.quoted(node.title)}, async ({ ${fixturesStr} }) => {`, ...children.map(indent), `});`, ''];
40
+ return [`test${this.getSubFn(node)}(${this.quoted([node.title, ...node.tags].join(" "))}, async ({ ${fixturesStr} }) => {`, ...children.map(indent), `});`, ''];
39
41
  }
40
42
  // eslint-disable-next-line max-params
41
43
  step(keyword, text, argument, fixtureNames = []) {
@@ -57,7 +59,7 @@ class Formatter {
57
59
  tagsFixture(testNodes) {
58
60
  const lines = testNodes.filter(node => node.tags.length).map(node => {
59
61
  // remove first parent as it is the same for all tests: root suite
60
- const key = node.titlePath.slice(1).join(TAGS_FIXTURE_TEST_KEY_SEPARATOR);
62
+ const key = `${node.titlePath.slice(1).join(TAGS_FIXTURE_TEST_KEY_SEPARATOR)} ${node.tags.join(" ")}`;
61
63
  return `${JSON.stringify(key)}: ${JSON.stringify(node.tags)},`;
62
64
  });
63
65
  return lines.length > 0 ? ['$tags: ({}, use, testInfo) => use({', ...lines.map(indent),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.6-exp.3",
3
+ "version": "0.1.6-exp.5",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {