Test stabilization: Updated overview push via the Scheduler to the frontend might take a bit longer.

This commit is contained in:
Thorsten Eckel 2018-07-24 17:32:32 +02:00
parent 6b50097f95
commit 364f74f558

View file

@ -94,24 +94,11 @@ class AdminOverviewTest < TestCase
} }
) )
click( overview_open(
browser: instance, name: name
css: 'a[href="#ticket/view"]',
mute_log: true,
)
click(
browser: instance,
css: "div.overview-header a[href='#ticket/view/#{name}']",
mute_log: true,
) )
# Sort the tickets according to their onscreen Y location assert_equal(ticket_titles.reverse, ordered_ticket_titles(ticket_titles))
tickets_low_to_high = ticket_titles.map do |title|
[title,
get_location( css: "td[title='#{title}']").y]
end
tickets_low_to_high = tickets_low_to_high.sort_by { |x| -x[1] }.map { |x| x[0] }
assert_equal(ticket_titles, tickets_low_to_high)
# Update overview to sort groups from low to high # Update overview to sort groups from low to high
overview_update( overview_update(
@ -121,23 +108,21 @@ class AdminOverviewTest < TestCase
} }
) )
click( overview_open(
browser: instance, name: name
css: 'a[href="#ticket/view"]',
mute_log: true,
)
click(
browser: instance,
css: "div.overview-header a[href='#ticket/view/#{name}']",
mute_log: true,
) )
# Sort the tickets according to their onscreen Y location # wait till the scheduler pushed
tickets_high_to_low = ticket_titles.map do |title| # the changes to the FE
sleep 5
assert_equal(ticket_titles, ordered_ticket_titles(ticket_titles))
end
def ordered_ticket_titles(ticket_titles)
ticket_titles.map do |title|
[title, [title,
get_location( css: "td[title='#{title}']").y] get_location( css: "td[title='#{title}']").y]
end end.sort_by { |x| x[1] }.map { |x| x[0] }
tickets_high_to_low = tickets_high_to_low.sort_by { |x| x[1] }.map { |x| x[0] }
assert_equal(ticket_titles, tickets_high_to_low)
end end
end end