Improved timings in tests.

This commit is contained in:
Martin Edenhofer 2015-11-30 13:13:27 +01:00
parent 7710c1232e
commit dd704194bc
3 changed files with 48 additions and 47 deletions

View file

@ -35,9 +35,9 @@ returns if user has no permissions to search
search user
result = User.search(
:query => 'some search term'
:limit => 15,
:current_user => user_model,
query: 'some search term'
limit: 15,
current_user: user_model,
)
returns
@ -71,11 +71,11 @@ returns
query.delete! '*'
if params[:role_ids]
users = User.joins(:roles).where( 'roles.id' => params[:role_ids] ).where(
'(users.firstname LIKE ? or users.lastname LIKE ? or users.email LIKE ?) AND users.id != 1', "%#{query}%", "%#{query}%", "%#{query}%",
'(users.firstname LIKE ? OR users.lastname LIKE ? OR users.email LIKE ? OR users.login LIKE ?) AND users.id != 1', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%"
).order('firstname').limit(limit)
else
users = User.where(
'(firstname LIKE ? or lastname LIKE ? or email LIKE ?) AND id != 1', "%#{query}%", "%#{query}%", "%#{query}%",
'(firstname LIKE ? OR lastname LIKE ? OR email LIKE ? OR login LIKE ?) AND id != 1', "%#{query}%", "%#{query}%", "%#{query}%", "%#{query}%"
).order('firstname').limit(limit)
end
users

View file

@ -273,7 +273,7 @@ class PreferencesTest < TestCase
click( css: 'a[href="#current_user"]' )
click( css: 'a[href="#profile"]' )
click( css: 'a[href="#profile/language"]' )
sleep 10
sleep 4
select(
css: '.language_item select[name="locale"]',
value: 'Deutsch',
@ -284,11 +284,11 @@ class PreferencesTest < TestCase
css: 'body',
value: 'Sprache',
)
sleep 16
sleep 6
# check if language is still used after reload
reload()
sleep 4
sleep 2
watch_for(
css: 'body',

View file

@ -1939,7 +1939,7 @@ wait untill text in selector disabppears
data = params[:data]
instance.find_elements({ css: 'a[href="#manage"]' })[0].click
sleep 1
sleep 0.5
instance.find_elements({ css: 'a[href="#manage/groups"]' })[0].click
sleep 2
instance.find_elements({ css: 'a[data-type="new"]' })[0].click
@ -1967,15 +1967,16 @@ wait untill text in selector disabppears
if data[:member]
data[:member].each {|login|
instance.find_elements({ css: 'a[href="#manage"]' })[0].click
sleep 0.5
instance.find_elements({ css: 'a[href="#manage/users"]' })[0].click
sleep 2
sleep 3
element = instance.find_elements({ css: '#content [name="search"]' })[0]
element.clear
element.send_keys(login)
sleep 2
sleep 3
#instance.find_elements({ :css => '#content table [data-id]' })[0].click
instance.execute_script('$("#content table [data-id] td").first().click()')
sleep 2
sleep 3
#instance.find_elements({ :css => 'label:contains(" ' + action[:name] + '")' })[0].click
instance.execute_script('$(\'label:contains(" ' + data[:name] + '")\').first().click()')
instance.find_elements({ css: '.modal button.js-submit' })[0].click