mediawiki-extensions-Popups/tests/browser/features/support/step_definitions/previews.rb
Sam Smith 4db0043ee7 Hygiene: Tidy up "core" acceptance tests
Changes:
* Rename the somewhat awkwardly named "popups_core" Cucumber feature and
  its accompanying step definitions to "previews".
* Remove as many references to Popups and HoverCards as possible.
* Use language consistent with the QUnit unit and integration tests and
  documentation, e.g. the user dwells on a link.
* Remove settings-related step definitions from the previews step
  definitions.

Change-Id: Ibc0d07e8394aeb640f9efaabfe10be5317bf4b8c
2016-12-13 14:14:08 +00:00

21 lines
507 B
Ruby

When(/^I dwell on the first valid link$/) do
on(ArticlePage).first_valid_link_element.hover
end
When(/^I abandon the link$/) do
on(ArticlePage).page_header_element.hover
end
Then(/^I should see a preview$/) do
expect(on(ArticlePage).hovercard_element.when_present(5)).to be_visible
end
Then(/^I should not see a preview$/) do
# Requesting a preview hits the API so wait some time before asserting it did
# not show.
sleep 5
expect(on(ArticlePage).hovercard_element).not_to be_visible
end