mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
yet another attempt at fixing the timing bug
This commit is contained in:
parent
575a38fbeb
commit
faa738d6c1
1 changed files with 11 additions and 10 deletions
|
@ -7,18 +7,19 @@ end
|
|||
describe 'signup' do
|
||||
include Capybara::DSL
|
||||
|
||||
def wait_for_ajax
|
||||
Timeout.timeout(Capybara.default_wait_time) do
|
||||
loop until page.evaluate_script('jQuery.active').zero?
|
||||
end
|
||||
end
|
||||
|
||||
def fill_in_valid
|
||||
@site = Fabricate.attributes_for(:site)
|
||||
wait_for_ajax
|
||||
fill_in 'username', with: @site[:username]
|
||||
fill_in 'password', with: @site[:password]
|
||||
fill_in 'email', with: @site[:email]
|
||||
|
||||
time = Time.now
|
||||
begin
|
||||
fill_in 'username', with: @site[:username]
|
||||
fill_in 'password', with: @site[:password]
|
||||
fill_in 'email', with: @site[:email]
|
||||
rescue Capybara::ElementNotFound
|
||||
raise if Time.now - time > 30
|
||||
sleep 0.5
|
||||
retry
|
||||
end
|
||||
end
|
||||
|
||||
def click_signup_button
|
||||
|
|
Loading…
Add table
Reference in a new issue