Grunt uitest:仅测试特定功能

Grunt uitest: Test only specific feature

我知道有一种方法可以修改 localConfig.json 文件,通过添加类似 "tag":"name" 的内容,您可以在功能文件中编写 @name 和仅测试此功能。

它是如何工作的?

javascript中没有注释。

这里有几个选项:

  • 使用 suites(推荐)对测试进行逻辑分组:

    suites: {
        homepage: 'tests/e2e/homepage/**/*Spec.js',
        search: [
            'tests/e2e/contact_search/**/*Spec.js',
            'tests/e2e/venue_search/**/*Spec.js']
        },
    

    然后运行,例如:

    protractor protractor.conf.js --suite homepage
    
  • 使用grep option:

    protractor conf.js --grep='pattern to match'
    

另请参阅:

好吧,显然没有人知道我现在自己发现的这个(简单)解决方案:

1:转到 localConfig.json

2: 写 "testSuiteTags": ["@YourName"]

3:将@YourName(标签)放在.feature 文件中特定场景之前-

就是这样