0

I have a button that changes its caption on hover. Im kinda at a loss how to phrase the features to test for that default state.

At the moment Im using

    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

But it feels a bit weird to assert the default state in a Given sentence. Do I need to split this into two scenarios?

Should I even test for that? If not how do I test this GUI details?

user1703761
  • 1,086
  • 3
  • 11
  • 23

1 Answers1

1

I would write 2 scenarios.

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
Tz_
  • 2,949
  • 18
  • 13