Maintenance: Try to improve the stabilzation of the manage groups selenium test.
This commit is contained in:
parent
f9ffa3ef51
commit
2d8780c269
2 changed files with 30 additions and 4 deletions
|
@ -283,6 +283,17 @@ module CommonActions
|
||||||
move_mouse_to(element)
|
move_mouse_to(element)
|
||||||
move_mouse_by(5, 5)
|
move_mouse_by(5, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Scroll into view with javscript.
|
||||||
|
#
|
||||||
|
# @param position [Symbol] :top or :bottom, position of the scroll into view
|
||||||
|
#
|
||||||
|
# scroll_into_view('button.js-submit)
|
||||||
|
#
|
||||||
|
def scroll_into_view(css_selector, position: :top)
|
||||||
|
page.execute_script("document.querySelector('#{css_selector}').scrollIntoView(#{position == :top})")
|
||||||
|
sleep 0.3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
|
@ -30,13 +30,28 @@ RSpec.describe 'Manage > Groups', type: :system do
|
||||||
|
|
||||||
it 'is possible to reset the assignment timeout of a group' do
|
it 'is possible to reset the assignment timeout of a group' do
|
||||||
find('td', text: 'Users').click
|
find('td', text: 'Users').click
|
||||||
fill_in 'Assignment Timeout', with: '30'
|
|
||||||
find('button', text: 'Submit').click
|
within '.modal-dialog' do
|
||||||
|
fill_in 'Assignment Timeout', with: '30'
|
||||||
|
|
||||||
|
# Needed for chrome, when element is outside viewport.
|
||||||
|
scroll_into_view('button.js-submit', position: :bottom)
|
||||||
|
|
||||||
|
click_button
|
||||||
|
end
|
||||||
|
|
||||||
expect(Group.find_by(name: 'Users').assignment_timeout).to eq(30)
|
expect(Group.find_by(name: 'Users').assignment_timeout).to eq(30)
|
||||||
|
|
||||||
find('td', text: 'Users').click
|
find('td', text: 'Users').click
|
||||||
fill_in 'Assignment Timeout', with: ''
|
|
||||||
find('button', text: 'Submit').click
|
within '.modal-dialog' do
|
||||||
|
fill_in 'Assignment Timeout', with: ''
|
||||||
|
|
||||||
|
# Needed for chrome, when element is outside viewport.
|
||||||
|
scroll_into_view('button.js-submit', position: :bottom)
|
||||||
|
|
||||||
|
click_button
|
||||||
|
end
|
||||||
expect(Group.find_by(name: 'Users').assignment_timeout).to be nil
|
expect(Group.find_by(name: 'Users').assignment_timeout).to be nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue