Simplify test code
Change-Id: I65c3edc85ee8619c7e77cca7622e7025799bdcad
This commit is contained in:
@@ -12,7 +12,6 @@ Feature: Font selection
|
||||
Background:
|
||||
Given I am logged in
|
||||
And I set "German" as the interface language
|
||||
And the content language is "English"
|
||||
And I inspect current fonts
|
||||
|
||||
Scenario: Font selector appears
|
||||
|
||||
@@ -33,15 +33,15 @@ When(/^I open "(.*?)" panel of language settings$/) do |panel|
|
||||
end
|
||||
end
|
||||
|
||||
When(/^I select "(.*?)" font for the (.*?) language for the live preview$/) do |font,type|
|
||||
if type == 'interface'
|
||||
type = 'ui'
|
||||
When(/^I select "(.*?)" font for the interface language for the live preview$/) do |font|
|
||||
on(ULSPage).select_font_for_interface = font
|
||||
end
|
||||
Selenium::WebDriver::Support::Select.new(
|
||||
@browser.driver.find_element(:id, "#{type}-font-selector")
|
||||
).select_by(:text, font)
|
||||
|
||||
When(/^I select "(.*?)" font for the content language for the live preview$/) do |font|
|
||||
on(ULSPage).select_font_for_content = font
|
||||
end
|
||||
|
||||
|
||||
When(/^I close the panel to discard the changes$/) do
|
||||
on(ULSPage) do |page|
|
||||
page.panel_button_close_element.click
|
||||
|
||||
@@ -31,4 +31,5 @@ class ULSPage
|
||||
a(:trigger_personal, class: 'uls-trigger')
|
||||
|
||||
select(:select_font_for_interface, id: 'ui-font-selector')
|
||||
select(:select_font_for_content, id: 'content-font-selector')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user