【问题标题】:How to describe default state in features and GUI details如何在功能和 GUI 详细信息中描述默认状态
【发布时间】:2013-05-08 10:26:11
【问题描述】:

我有一个按钮可以在悬停时更改其标题。我有点不知所措如何措辞测试该默认状态的功能。

目前正在使用

    Scenario: show caption on hover
    Given I should not see an "Add Website" caption on the add new button
    When I hover over the add new button
    Then I should see an "Add Website" caption on the add new button

但是在 Given 句子中断言默认状态感觉有点奇怪。我需要将其分为两种情况吗?

我是否应该对此进行测试?如果不是,我该如何测试这个 GUI 细节?

【问题讨论】:

    标签: cucumber acceptance-testing gherkin


    【解决方案1】:

    我会写两个场景。

    Scenario: default caption when opening page
      When I open the XYZ page
      Then I should see the "My default" caption on the add new button
    
    Scenario: change caption on hover
      Given I am on the XYZ page
      When I hover over the add new button
      Then I should see the "Add Website" caption on the add new button
    

    【讨论】:

      猜你喜欢
      • 2021-07-12
      • 1970-01-01
      • 1970-01-01
      • 2021-06-28
      • 1970-01-01
      • 2021-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多