Fixed language selection (new widget).

This commit is contained in:
Martin Edenhofer 2016-02-09 21:02:57 +01:00
parent 6ede7e5365
commit 66ec83c323
4 changed files with 22 additions and 7 deletions

View file

@ -46,7 +46,7 @@ class PreferencesTest < TestCase
click( css: 'a[href="#profile"]' )
click( css: 'a[href="#profile/language"]' )
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'Deutsch',
)
click( css: '.content button[type="submit"]' )
@ -159,7 +159,7 @@ class PreferencesTest < TestCase
click( css: 'a[href="#profile"]' )
click( css: 'a[href="#profile/language"]' )
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'English (United States)',
)
click( css: '.content button[type="submit"]' )
@ -275,7 +275,7 @@ class PreferencesTest < TestCase
click( css: 'a[href="#profile/language"]' )
sleep 4
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'Deutsch',
)
click( css: '.content button[type="submit"]' )

View file

@ -16,7 +16,7 @@ class SettingTest < TestCase
click( css: 'a[href="#profile"]' )
click( css: 'a[href="#profile/language"]' )
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'English (United States)',
)
click( css: '.content button[type="submit"]' )

View file

@ -15,7 +15,7 @@ class TranslationTest < TestCase
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'English (United States)',
)
click(css: '.content button[type="submit"]')
@ -37,7 +37,7 @@ class TranslationTest < TestCase
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'Deutsch',
)
click(css: '.content button[type="submit"]')
@ -180,7 +180,7 @@ class TranslationTest < TestCase
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
css: '.language_item select[name="locale"]',
css: '.language_item [name="locale"]',
value: 'English (United States)',
)
click(css: '.content button[type="submit"]')

View file

@ -514,6 +514,21 @@ class TestCase < Test::Unit::TestCase
instance = params[:browser] || @browser
# searchable select
element = instance.find_elements({ css: "#{params[:css]}.js-shadow" })[0]
if element
element = instance.find_elements({ css: "#{params[:css]}.js-shadow + .js-input" })[0]
element.click
element.clear
sleep 1
element.send_keys(params[:value])
sleep 0.5
element.send_keys(:enter)
sleep 0.5
return
end
# native select
begin
element = instance.find_elements({ css: params[:css] })[0]
dropdown = Selenium::WebDriver::Support::Select.new(element)