Skip to content

Commit

Permalink
[rb] update safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Nov 26, 2022
1 parent 71657e9 commit 59763fc
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def initialize

@driver = ENV.fetch('WD_SPEC_DRIVER', :chrome).to_sym
@driver_instance = nil
@remote_server = nil
end

def print_env
Expand Down Expand Up @@ -61,9 +62,7 @@ def reset_driver!(time = 0)
end

def quit_driver
return unless @driver_instance

@driver_instance.quit
@driver_instance&.quit
ensure
@driver_instance = nil
end
Expand All @@ -83,7 +82,7 @@ def remote_server
end

def reset_remote_server
@remote_server.stop if defined? @remote_server
@remote_server&.stop
@remote_server = nil
remote_server
end
Expand All @@ -110,7 +109,7 @@ def remote_server_jar
def quit
app_server.stop

@remote_server.stop if defined? @remote_server
@remote_server&.stop

@driver_instance = @app_server = @remote_server = nil
end
Expand Down

0 comments on commit 59763fc

Please sign in to comment.