如何在功能和 GUI 详细信息中描述默认状态

Posted

技术标签:

【中文标题】如何在功能和 GUI 详细信息中描述默认状态【英文标题】:How to describe default state in features and GUI details 【发布时间】: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 细节?

【问题讨论】:

【参考方案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

【讨论】:

以上是关于如何在功能和 GUI 详细信息中描述默认状态的主要内容,如果未能解决你的问题,请参考以下文章