Code layout improvements.

This commit is contained in:
Martin Edenhofer 2016-03-23 08:24:25 +01:00
parent 4d837d7bd4
commit 984bb9c4f5
5 changed files with 46 additions and 38 deletions

View file

@ -13,12 +13,12 @@ class AaaGettingStartedTest < TestCase
mailbox_password = ENV['MAILBOX_INIT'].split(':')[1]
@browser = browser_instance
location( url: browser_url )
location(url: browser_url)
watch_for(
css: '.setup.wizard',
value: 'setup new system',
)
click( css: '.js-start .btn--primary' )
click(css: '.js-start .btn--primary')
watch_for(
css: '.setup.wizard',
value: 'admin',
@ -47,7 +47,7 @@ class AaaGettingStartedTest < TestCase
css: '.js-admin input[name="password_confirm"]',
value: 'test1234äöüß',
)
click( css: '.js-admin .btn--success' )
click(css: '.js-admin .btn--success')
# getting started - base
watch_for(
@ -197,7 +197,7 @@ class AaaGettingStartedTest < TestCase
accounts.each {|account|
# getting started - auto mail
location( url: browser_url + '/#getting_started/channel' )
location(url: browser_url + '/#getting_started/channel')
click(
css: '.js-channel .email .provider_name',
)
@ -269,7 +269,7 @@ class AaaGettingStartedTest < TestCase
accounts.each {|account|
# getting started - manual mail
location( url: browser_url + '/#getting_started/channel' )
location(url: browser_url + '/#getting_started/channel')
click(
css: '.js-channel .email .provider_name',

View file

@ -37,20 +37,14 @@ class AgentTicketActionLevel0Test < TestCase
tasks_close_all()
# invite agent (with one group)
click(
css: '#navigation a[href="#dashboard"]',
)
click(
css: '.active.content .tab[data-area="first-steps-widgets"]',
)
click(css: '#navigation a[href="#dashboard"]')
click(css: '.active.content .tab[data-area="first-steps-widgets"]')
watch_for(
css: '.active.content',
value: 'Configuration',
)
click(
css: '.active.content .js-inviteAgent',
)
sleep 4
click(css: '.active.content .js-inviteAgent')
modal_ready()
set(
css: '.modal [name="firstname"]',
value: 'Bob',
@ -94,12 +88,9 @@ class AgentTicketActionLevel0Test < TestCase
# customer ticket create
click(css: 'a[href="#new"]')
click(css: 'a[href="#customer_ticket_new"]')
sleep 2
click(css: 'a[href="#customer_ticket_new"]', wait: 2)
exists_not(
css: '.newTicket select[name="group_id"]',
)
exists_not(css: '.newTicket select[name="group_id"]')
set(
css: '.newTicket input[name="title"]',
@ -109,8 +100,7 @@ class AgentTicketActionLevel0Test < TestCase
css: '.newTicket [data-name="body"]',
value: 'one group body',
)
click(css: '.newTicket button.js-submit')
sleep 5
click(css: '.newTicket button.js-submit', wait: 5)
# check if ticket is shown
location_check(url: '#ticket/zoom/')

View file

@ -25,7 +25,7 @@ class AdminChannelEmailTest < TestCase
click(css: '#content .js-channelNew')
sleep 2
modal_ready()
set(
css: '.modal input[name="realname"]',
@ -65,7 +65,7 @@ class AdminChannelEmailTest < TestCase
# re-create
click(css: '#content .js-channelNew')
sleep 2
modal_ready()
set(
css: '.modal input[name="realname"]',
@ -99,7 +99,8 @@ class AdminChannelEmailTest < TestCase
# set invalid folder
click(css: '#content .js-editInbound')
sleep 2
modal_ready()
set(
css: '.modal input[name="options::folder"]',

View file

@ -12,8 +12,8 @@ class TaskbarTaskTest < TestCase
tasks_close_all()
# persistant task
click( css: 'a[href="#new"]' )
click( css: 'a[href="#ticket/create"]' )
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]', wait: 0.8)
set(
css: '.active .newTicket input[name="title"]',
value: 'some test AAA',
@ -31,7 +31,7 @@ class TaskbarTaskTest < TestCase
sleep 3
# check if task still exists
click( css: '.task' )
click(css: '.task', wait: 0.8)
match(
css: '.active .newTicket input[name="title"]',
@ -40,7 +40,7 @@ class TaskbarTaskTest < TestCase
tasks_close_all()
exists_not( css: '.active .newTicket input[name="title"]' )
exists_not(css: '.active .newTicket input[name="title"]')
end
def test_persistant_task_with_relogin
@ -52,8 +52,8 @@ class TaskbarTaskTest < TestCase
)
tasks_close_all()
click( css: 'a[href="#new"]' )
click( css: 'a[href="#ticket/create"]' )
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]')
set(
css: '.active .newTicket input[name="title"]',
value: 'INBOUND TEST#1',
@ -63,8 +63,8 @@ class TaskbarTaskTest < TestCase
value: 'INBOUND BODY TEST#1',
)
click( css: 'a[href="#new"]' )
click( css: 'a[href="#ticket/create"]' )
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]', wait: 0.8)
set(
css: '.active .newTicket input[name="title"]',
value: 'OUTBOUND TEST#1',

View file

@ -264,7 +264,7 @@ class TestCase < Test::Unit::TestCase
return if !clues
instance.execute_script("$('.js-modal--clue .js-close').click()")
assert(true, 'clues closed')
sleep 4
sleep 2
end
=begin
@ -416,6 +416,23 @@ class TestCase < Test::Unit::TestCase
sleep 0.3
end
=begin
modal_ready(
browser: browser1,
)
=end
def modal_ready(params)
switch_window_focus(params)
log('modal_ready', params)
instance = params[:browser] || @browser
sleep 2
end
=begin
execute(
@ -544,7 +561,7 @@ class TestCase < Test::Unit::TestCase
element = instance.find_elements(css: "#{params[:css]}.js-shadow + .js-input")[0]
element.click
element.clear
sleep 0.5
sleep 0.4
element.send_keys(params[:value])
sleep 0.2
element.send_keys(:enter)
@ -562,7 +579,7 @@ class TestCase < Test::Unit::TestCase
dropdown.select_by(:text, params[:value])
#puts "select - #{params.inspect}"
rescue
sleep 0.5
sleep 0.4
# just try again
log('select', { rescure: true })
@ -574,7 +591,7 @@ class TestCase < Test::Unit::TestCase
dropdown.select_by(:text, params[:value])
#puts "select2 - #{params.inspect}"
end
sleep 0.5
sleep 0.4
end
=begin
@ -1014,7 +1031,7 @@ class TestCase < Test::Unit::TestCase
# accept task close warning
if params[:discard_changes]
sleep 1
modal_ready()
instance.find_elements(css: '.modal button.js-submit')[0].click
end