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 <input required="required" type="checkbox" value="on" name="dossier[champs_attributes][7][value]" id="dossier_champs_attributes_7_value"> is not clickable at point (205, 892). Other element would receive the click: <div class="send-dossier-actions-bar">...</div>
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.
By default, Devise will look for views:
1. First in `views/resource/passwords/…`,
2. Then in `views/devise/passwords/…` if not found.
By moving the views to `views/devise`, we avoid having a partial in
`views/shared` that we need to include manually, and instead let Devise
do the job automatically.
Providing a query param ("locale") will enable localization. A language picker will be shown once
localization is activated. Locale is stored in a cookie "locale".
There are two cases where the draft auto-save might fail because the
user is no longer authenticated:
- The user signed-out in another tab,
- The brower quit and re-opened, so the Session cookie expired.
In both cases, the auto-save will never succeed until the user
authenticates again, so displaying a "Retry" button is cruel.
Moreover, in plus of all auto-save requests failing with a small error,
the actual hard failure only occurs after filling all the form and
trying to submit it. Then the user is redirected to the sign-in page –
but all their changes are lost.
Instead, we now redirect to the sign-in page on the first 401 error
during the auto-save, let the user sign-in, and then redirect back to
the form.
In this test, two Avis are created for each expert:
- one for the original dossier,
- one for the dossier linked to the original dossier.
When we check for a sign-up link, we should do so using the
Avis for the original dossier explicitely.