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