Replace "execute_script" for triggering hovercards
In addition to getting rid of an "execute_script" instance, this approach is slightly higher fidelity, as it renders the hovercard at the correct place on the page and doesn't reach into jQuery to trigger the hovercard.
This commit is contained in:
parent
688245c0de
commit
ef7a5f8d6e
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
When(/^I activate the first hovercard$/) do
|
When(/^I activate the first hovercard$/) do
|
||||||
page.execute_script("$('.hovercardable').first().trigger('mouseenter');")
|
first(".hovercardable").hover
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^I should see a hovercard$/) do
|
Then(/^I should see a hovercard$/) do
|
||||||
|
|
@ -14,7 +14,7 @@ Then(/^I should see "([^"]*)" hashtag in the hovercard$/) do |tag|
|
||||||
end
|
end
|
||||||
|
|
||||||
When(/^I deactivate the first hovercard$/) do
|
When(/^I deactivate the first hovercard$/) do
|
||||||
page.execute_script("$('.hovercardable').first().trigger('mouseleave');")
|
find("input#q").click # Click something else instead — e.g., search — to deactive it
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^I should not see a hovercard$/) do
|
Then(/^I should not see a hovercard$/) do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue