如何使用包含元数据数组的 CLI 运行 TestCafe 测试
How to run a TestCafe test with CLI that contains a metadata array
我对以下元数据进行了测试:
test.meta({ type: 'smoke', testcase: ['tc01', 'tc02'] });
testcase
元数据包含一个 id 数组,我想将它们用作 运行 使用 command line interface 的任何值进行测试的过滤器:
testcafe --test-meta testcase=tc01
testcafe --test-meta testcase=tc02
这两个命令行应该运行 相同的测试,但是它们不起作用。有没有其他方法可以解决这个问题?
阅读 TestCafe 的 github 页面上的讨论,似乎元数据只能是单值字符串:https://github.com/DevExpress/testcafe/issues/3267 然后关闭问题,最后的解释是这样的功能请求是不是很清楚,因为:
In addition, the particular case you are addressing is a bit tricky, what will be the user expected behaviour?, To match only when the array has all the passed values? or when the array is equal to that values (ie: don't have any extra one)?.
官方文档中也没有提到这样的选项:https://devexpress.github.io/testcafe/documentation/guides/basic-guides/organize-tests.html#specify-test-metadata
这让我相信,到 2020 年 6 月,您无法真正实现您的要求。
我对以下元数据进行了测试:
test.meta({ type: 'smoke', testcase: ['tc01', 'tc02'] });
testcase
元数据包含一个 id 数组,我想将它们用作 运行 使用 command line interface 的任何值进行测试的过滤器:
testcafe --test-meta testcase=tc01
testcafe --test-meta testcase=tc02
这两个命令行应该运行 相同的测试,但是它们不起作用。有没有其他方法可以解决这个问题?
阅读 TestCafe 的 github 页面上的讨论,似乎元数据只能是单值字符串:https://github.com/DevExpress/testcafe/issues/3267 然后关闭问题,最后的解释是这样的功能请求是不是很清楚,因为:
In addition, the particular case you are addressing is a bit tricky, what will be the user expected behaviour?, To match only when the array has all the passed values? or when the array is equal to that values (ie: don't have any extra one)?.
官方文档中也没有提到这样的选项:https://devexpress.github.io/testcafe/documentation/guides/basic-guides/organize-tests.html#specify-test-metadata
这让我相信,到 2020 年 6 月,您无法真正实现您的要求。