mediawiki-skins-MinervaNeue/tests/browser/features/step_definitions/language_steps.rb
jdlrobson d5a60fdd43 Browser tests: Use generic toast step
Introduces a new generic
"I should see a toast with message ".*""
step reducing toast steps to two generic ones.

Change-Id: Ic8b91c78f6df088244f15223ee4ed658847a05b5
2017-07-27 13:41:54 -07:00

32 lines
1 KiB
Ruby

When(/^I click the language overlay close button$/) do
on(ArticlePage).overlay_languages_element.when_present.button_element(class: 'cancel').click
end
When(/^I see the language overlay$/) do
on(ArticlePage).overlay_languages_element.when_present
end
When /^I click on a language from the list of all languages$/ do
on(ArticlePage).non_suggested_language_link_element.when_present.click
end
Then(/^I should not see the languages overlay$/) do
expect(on(ArticlePage).overlay_languages_element).not_to be_visible
end
Then(/^I should see the language overlay$/) do
expect(on(ArticlePage).overlay_languages_element.when_present).to be_visible
end
Then(/^I should see a non-suggested language link$/) do
expect(on(ArticlePage).non_suggested_language_link_element).to be_visible
end
Then(/^I should not see a suggested language link$/) do
expect(on(ArticlePage).suggested_language_link_element).not_to be_visible
end
Then(/^I should see a suggested language link$/) do
expect(on(ArticlePage).suggested_language_link_element).to be_visible
end