-2

由于场景太多,当出现故障或错误时,我很难跳转到有问题的场景。

有没有办法给每个场景一个唯一的编号,以便于映射并且也可以用于日志记录。

我正在使用带有黄瓜 jvm 和页面对象的 selenium webdriver。

例如功能文件:

    #1
    @regression @CPM_PI @visibility
    Scenario Outline: To check if CPMPI panel is visible
    Given Go to Nerd
    And set Team="CTM"
    And set Client="PQR"
    And set Broker="ABC"
    And select Product="CPM"
    And set Revenue"1000000"
    And set Revenue(CY)="500000"
    And tick Coverages="CPM/PI"
    And select Main Activity="<MainActivity>"
    Then check CPMPI visible


    #2
    @regression @CPM_PI @visibility
    Scenario: To check visiblity of all CPMPI panels
    Given Go to Nerd
    And set Team="CTM"
    And tick Cyber 
    Then check panel Cyber visible
4

1 回答 1

1

您可以简单地“标记”您的场景名称,例如:

Scenario Outline: Scenario 1: To check if CPMPI panel is visible
Given Go to Nerd
And set Team="CTM"
And set Client="PQR"
And set Broker="ABC"
And select Product="CPM"
And set Revenue"1000000"
And set Revenue(CY)="500000"
And tick Coverages="CPM/PI"
And select Main Activity="<MainActivity>"
Then check CPMPI visible


#2
@regression @CPM_PI @visibility
Scenario: Scenario2: To check visiblity of all CPMPI panels
Given Go to Nerd
And set Team="CTM"
And tick Cyber 
Then check panel Cyber visible

养成给场景标记名称的习惯

于 2015-04-07T10:16:05.017 回答