带有浏览器测试的标记功能(JUnit平台引擎)

带有浏览器测试的标记功能(JUnit平台引擎),junit,cucumber-jvm,cucumber-java,cucumber-junit,Junit,Cucumber Jvm,Cucumber Java,Cucumber Junit,我有几个API测试和浏览器测试。浏览器测试必须一致运行。 此文档()说明: 首先,我需要使用以下参数并行运行所有测试: 然后我需要标记资源,对这些资源的访问将是一致的(读写或只读)。例如,资源系统_属性: 但是,我如何指定我的浏览器测试而不是此资源?如果您的专用资源是浏览器,您可以在心里为它保留字符串browser。资源的名称并不重要,只是它是唯一标识浏览器的 然后决定哪个cumber标记与此资源匹配,比如说@browser。然后从标记中删除@,并将其余部分放入属性文件中: cucumber.e

我有几个API测试和浏览器测试。浏览器测试必须一致运行。 此文档()说明:

  • 首先,我需要使用以下参数并行运行所有测试:
  • 然后我需要标记资源,对这些资源的访问将是一致的(读写或只读)。例如,资源系统_属性:

  • 但是,我如何指定我的浏览器测试而不是此资源?

    如果您的专用资源是浏览器,您可以在心里为它保留字符串
    browser
    。资源的名称并不重要,只是它是唯一标识浏览器的

    然后决定哪个cumber标记与此资源匹配,比如说
    @browser
    。然后从标记中删除
    @
    ,并将其余部分放入属性文件中:

    cucumber.execution.exclusive-resources.browser.read-write=BROWSER
    
    然后用
    @browser
    标记场景:

    Feature: Exclusive resources
    
     @browser
     Scenario: first example
       Given this scenario uses the browser
    
     @browser
     Scenario: second example
       Given this scenario uses the browser
    
    您还可以通过标记功能来标记功能中的所有场景

    @browser
    Feature: Exclusive resources
    
     Scenario: first example
       Given this scenario uses the browser
    
     Scenario: second example
       Given this scenario uses the browser
    
    Feature: Exclusive resources
    
     @browser
     Scenario: first example
       Given this scenario uses the browser
    
     @browser
     Scenario: second example
       Given this scenario uses the browser
    
    @browser
    Feature: Exclusive resources
    
     Scenario: first example
       Given this scenario uses the browser
    
     Scenario: second example
       Given this scenario uses the browser