Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/388.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Grunt uitest:仅测试特定功能_Javascript_Gruntjs_Jasmine_Protractor - Fatal编程技术网

Javascript Grunt uitest:仅测试特定功能

Javascript Grunt uitest:仅测试特定功能,javascript,gruntjs,jasmine,protractor,Javascript,Gruntjs,Jasmine,Protractor,我知道有一种方法可以修改localConfig.json文件,并通过在功能文件中添加类似“tag”:“name”的内容,您将能够编写@name并仅测试此功能 它是如何工作的?javascript中没有注释 您在这里有几个选项: 使用(推荐)对测试进行逻辑分组: suites: { homepage: 'tests/e2e/homepage/**/*Spec.js', search: [ 'tests/e2e/contact_search/**/*Spec.js'

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


它是如何工作的?

javascript中没有注释

您在这里有几个选项:

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

    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
    
  • 使用:

另见:


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

1:转到localConfig.json

2:写“testSuiteTags”:[“@YourName”]

3:将@YourName(标记)放在.feature文件中特定场景的正前方-


就这样

fwiw,您可以在Jasmine中使用
xdescripe
禁用套件。我处理的文件超过60个,所以根本没有效果。有一个“@Name”的东西可以让它变得更简单,只是不记得语法。对于一个文件超过60个的项目来说,这太复杂了。看答案,看得更好solution@Best_Where_Gives这实际上是一个实用的建议。我们有一个超过60个文件的项目<代码>套件是将测试组织到逻辑组中的好方法。此外,它还涉及编辑您的60多个测试。
protractor conf.js --grep='pattern to match'