From b466fa78781c2107e98257bfb6574629db3c1a74 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 30 Sep 2021 13:37:40 +0000 Subject: [PATCH] spec: ensure checkbox is visible before clicking it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's a random failure in this spec, where the CI triggers this error: > Failure/Error: check('checkbox') > > Selenium::WebDriver::Error::ElementClickInterceptedError: > element click intercepted: Element is not clickable at point (205, 892). Other element would receive the click:
...
That's because the checkbox is partially overlapped by the sticky action bar at the bottom of the screen – but only _some of the time_. This commit attempts to fix the issue by manually scrolling the checkbox at the center of the screen before clicking it. --- spec/features/users/brouillon_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/features/users/brouillon_spec.rb b/spec/features/users/brouillon_spec.rb index 0b460aecc..8abfe3ccd 100644 --- a/spec/features/users/brouillon_spec.rb +++ b/spec/features/users/brouillon_spec.rb @@ -16,6 +16,7 @@ feature 'The user' do fill_in('date', with: '12-12-2012') select_date_and_time(Time.zone.parse('06/01/2030 7h05'), form_id_for_datetime('datetime')) fill_in('number', with: '42') + find_field('checkbox').scroll_to(:center) check('checkbox') choose('Madame') fill_in('email', with: 'loulou@yopmail.com')