Global replacement with modal_ready.

This commit is contained in:
Martin Edenhofer 2016-06-10 09:21:47 +02:00
parent fe54a7b37e
commit 87c7ed9d0a

View file

@ -453,7 +453,7 @@ class TestCase < Test::Unit::TestCase
=begin =begin
modal_ready( modal_ready(
browser: browser1, browser: browser1,
) )
=end =end
@ -464,13 +464,13 @@ class TestCase < Test::Unit::TestCase
instance = params[:browser] || @browser instance = params[:browser] || @browser
sleep 2 sleep 3
end end
=begin =begin
modal_disappear( modal_disappear(
browser: browser1, browser: browser1,
) )
=end =end
@ -1088,7 +1088,7 @@ class TestCase < Test::Unit::TestCase
# accept task close warning # accept task close warning
if params[:discard_changes] if params[:discard_changes]
modal_ready() modal_ready(browser: instance)
instance.find_elements(css: '.modal button.js-submit')[0].click instance.find_elements(css: '.modal button.js-submit')[0].click
modal_disappear(browser: instance) modal_disappear(browser: instance)
end end
@ -1485,7 +1485,7 @@ wait untill text in selector disabppears
css: '#content a[data-type="new"]', css: '#content a[data-type="new"]',
mute_log: true, mute_log: true,
) )
sleep 2 modal_ready(browser: instance)
if data[:name] if data[:name]
set( set(
browser: instance, browser: instance,
@ -2464,8 +2464,7 @@ wait untill text in selector disabppears
css: 'a[data-type="new"]', css: 'a[data-type="new"]',
mute_log: true, mute_log: true,
) )
modal_ready(browser: instance)
sleep 2
element = instance.find_elements(css: '.modal input[name=firstname]')[0] element = instance.find_elements(css: '.modal input[name=firstname]')[0]
element.clear element.clear
element.send_keys(data[:firstname]) element.send_keys(data[:firstname])
@ -2535,8 +2534,7 @@ wait untill text in selector disabppears
css: 'a.js-new', css: 'a.js-new',
mute_log: true, mute_log: true,
) )
modal_ready(browser: instance)
sleep 2
element = instance.find_elements(css: '.modal input[name=name]')[0] element = instance.find_elements(css: '.modal input[name=name]')[0]
element.clear element.clear
element.send_keys(data[:name]) element.send_keys(data[:name])
@ -2594,8 +2592,7 @@ wait untill text in selector disabppears
css: 'a[data-type="new"]', css: 'a[data-type="new"]',
mute_log: true, mute_log: true,
) )
modal_ready(browser: instance)
sleep 2
element = instance.find_elements(css: '.modal input[name=name]')[0] element = instance.find_elements(css: '.modal input[name=name]')[0]
element.clear element.clear
element.send_keys(data[:name]) element.send_keys(data[:name])
@ -2661,8 +2658,7 @@ wait untill text in selector disabppears
css: '#content #c-signature a[data-type="new"]', css: '#content #c-signature a[data-type="new"]',
mute_log: true, mute_log: true,
) )
modal_ready(browser: instance)
sleep 2
element = instance.find_elements(css: '.modal input[name=name]')[0] element = instance.find_elements(css: '.modal input[name=name]')[0]
element.clear element.clear
element.send_keys(data[:name]) element.send_keys(data[:name])
@ -2722,8 +2718,7 @@ wait untill text in selector disabppears
css: 'a[data-type="new"]', css: 'a[data-type="new"]',
mute_log: true, mute_log: true,
) )
modal_ready(browser: instance)
sleep 2
element = instance.find_elements(css: '.modal input[name=name]')[0] element = instance.find_elements(css: '.modal input[name=name]')[0]
element.clear element.clear
element.send_keys(data[:name]) element.send_keys(data[:name])
@ -2743,7 +2738,7 @@ wait untill text in selector disabppears
text = element.text text = element.text
if text =~ /#{Regexp.quote(data[:name])}/ if text =~ /#{Regexp.quote(data[:name])}/
assert(true, 'group created') assert(true, 'group created')
modal_ready # wait until modal has gone modal_disappear(browser: instance) # wait until modal has gone
# add member # add member
if data[:member] if data[:member]
@ -2762,7 +2757,6 @@ wait untill text in selector disabppears
#instance.find_elements(:css => 'label:contains(" ' + action[:name] + '")')[0].click #instance.find_elements(:css => 'label:contains(" ' + action[:name] + '")')[0].click
instance.execute_script('$(\'label:contains(" ' + data[:name] + '")\').first().click()') instance.execute_script('$(\'label:contains(" ' + data[:name] + '")\').first().click()')
instance.find_elements(css: '.modal button.js-submit')[0].click instance.find_elements(css: '.modal button.js-submit')[0].click
sleep 5
modal_disappear(browser: instance) modal_disappear(browser: instance)
} }
end end
@ -2894,7 +2888,7 @@ wait untill text in selector disabppears
css: '#content .js-new', css: '#content .js-new',
mute_log: true, mute_log: true,
) )
modal_ready modal_ready(browser: instance)
element = instance.find_elements(css: '.modal input[name=name]')[0] element = instance.find_elements(css: '.modal input[name=name]')[0]
element.clear element.clear
element.send_keys(data[:name]) element.send_keys(data[:name])