From f90225ace55cbed3319889a5db7b11379813eb52 Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Tue, 19 Oct 2021 09:30:36 +0200 Subject: [PATCH] Maintenance: Try to improve the stabilzation of the form channel selenium test. --- spec/system/form_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/system/form_spec.rb b/spec/system/form_spec.rb index f98732249..97485fdbf 100644 --- a/spec/system/form_spec.rb +++ b/spec/system/form_spec.rb @@ -50,7 +50,10 @@ RSpec.describe 'Form', type: :system, authenticated_as: true do fill_in 'Name', with: 'some sender' fill_in 'Message', with: 'message here' fill_in 'Email', with: 'somebody@notexistinginanydomainspacealsonothere.nowhere' + + # We need to wait 10 seconds, because otherwise we are detected as a robot. sleep 10 + click_on 'Submit' expect(page).to have_selector('.has-error [name=email]').and have_no_selector('button[type="submit"][disabled]') @@ -130,6 +133,7 @@ RSpec.describe 'Form', type: :system, authenticated_as: true do before do visit 'channels/form' check 'form_ticket_create', { allow_label_click: true } + wait(10).until { Setting.get('form_ticket_create') == true } end context 'when form is inline' do @@ -164,6 +168,7 @@ RSpec.describe 'Form', type: :system, authenticated_as: true do before do visit 'channels/form' uncheck 'form_ticket_create', { allow_label_click: true } + wait(10).until { Setting.get('form_ticket_create') == false } visit path end