Cucumber:多个场景大纲未在 Cucumber 中执行 5.x.x:一个可能的错误?
Cucumber: Multiple Scenario Outlines are not getting executed in Cucumber 5.x.x: A possible bug?
在我的功能文件中,我有两个场景大纲,它们有自己的示例部分。我对这些场景大纲中的每一个都做了不同的标记(@test1
,@test2
)。
当我尝试使用 Cucumber 5.6.0 运行 两个场景大纲时,出现以下错误:-
0 Scenarios
0 Steps
0m0.001s
Cucumber 5.6.0 一次只能成功执行一个场景大纲。
我用 Cucumber 5.0.0
得到了相同的结果
但是,当我降级到 Cucumber 4.8.1 时,两个场景大纲都已成功执行。
然而,当我使用 Cucumber 4.8.1 和 JUnit Test Runner v 4.13运行 时,场景大纲不起作用
请看下面我正在使用的功能文件和 JUnit Test Runner class
正在测试的功能文件:-
@GoogleMapPageObjectFactory
Feature: GoogleMapPageObjectFactory
Background: setUpGoogleMapPageObjectFactoryTest
Given ChromeDriver is available for GoogleMap Page
And GoogleMap Page is opened
And all GoogleMap page elements are initialised
@test1
Scenario Outline: captureScreenShotatStartGoogleMap
When I capture screenshot on GoogleMap page to be stored at "<screenshotFilePathStart>"
Then an image should be stored in local drive path "<screenshotFilePathStart>"
Examples:
| screenshotFilePathStart |
| F:\Users\User\eclipse-workspace\maven-demo\screenshots\GoogleMapPageObjectFactoryTest-start.jpg |
@test2
Scenario Outline: typeAndVerifyAddressGoogleMap
When I type the "<searchAddress>" on GoogleMap Page
Then I verify the section header contains "<searchAddress>" on GoogleMap Page
Examples:
| searchAddress |
| Harvard Business School, Boston, MA 02163, United States |
@test3
Scenario: phnuminlinePopUpGoogleMap
When I type the "+91 998877223" on GoogleMap Page
Then I verify the inline popup window contains "+91 998877223" on GoogleMap Page
JUnit 测试运行器Class:-
package com.selenium.cucumber.junit.testrunner;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(tags={"@test1","@test2"},
features= {"src/main/resources/com/selenium/cucumber/features/GoogleMapPageObjectFactory.feature"},
glue= {"com.selenium.cucumber.stepdef"}
)
public class GoogleMapPageObjectFactoryTestRunner {
}
听起来像是 v5 中引入了一个错误。
但请尝试改用单个标记表达式。例如 @test1 or @tes2
.
在我的功能文件中,我有两个场景大纲,它们有自己的示例部分。我对这些场景大纲中的每一个都做了不同的标记(@test1
,@test2
)。
当我尝试使用 Cucumber 5.6.0 运行 两个场景大纲时,出现以下错误:-
0 Scenarios
0 Steps
0m0.001s
Cucumber 5.6.0 一次只能成功执行一个场景大纲。 我用 Cucumber 5.0.0
得到了相同的结果但是,当我降级到 Cucumber 4.8.1 时,两个场景大纲都已成功执行。 然而,当我使用 Cucumber 4.8.1 和 JUnit Test Runner v 4.13运行 时,场景大纲不起作用
请看下面我正在使用的功能文件和 JUnit Test Runner class
正在测试的功能文件:-
@GoogleMapPageObjectFactory
Feature: GoogleMapPageObjectFactory
Background: setUpGoogleMapPageObjectFactoryTest
Given ChromeDriver is available for GoogleMap Page
And GoogleMap Page is opened
And all GoogleMap page elements are initialised
@test1
Scenario Outline: captureScreenShotatStartGoogleMap
When I capture screenshot on GoogleMap page to be stored at "<screenshotFilePathStart>"
Then an image should be stored in local drive path "<screenshotFilePathStart>"
Examples:
| screenshotFilePathStart |
| F:\Users\User\eclipse-workspace\maven-demo\screenshots\GoogleMapPageObjectFactoryTest-start.jpg |
@test2
Scenario Outline: typeAndVerifyAddressGoogleMap
When I type the "<searchAddress>" on GoogleMap Page
Then I verify the section header contains "<searchAddress>" on GoogleMap Page
Examples:
| searchAddress |
| Harvard Business School, Boston, MA 02163, United States |
@test3
Scenario: phnuminlinePopUpGoogleMap
When I type the "+91 998877223" on GoogleMap Page
Then I verify the inline popup window contains "+91 998877223" on GoogleMap Page
JUnit 测试运行器Class:-
package com.selenium.cucumber.junit.testrunner;
import org.junit.runner.RunWith;
import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(tags={"@test1","@test2"},
features= {"src/main/resources/com/selenium/cucumber/features/GoogleMapPageObjectFactory.feature"},
glue= {"com.selenium.cucumber.stepdef"}
)
public class GoogleMapPageObjectFactoryTestRunner {
}
听起来像是 v5 中引入了一个错误。
但请尝试改用单个标记表达式。例如 @test1 or @tes2
.