瀏覽代碼

Check for session id and autoclose before binary quitting

Daniel Gempesaw 10 年之前
父節點
當前提交
7e8bcbc56b
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/Selenium/CanStartBinary.pm

+ 3 - 2
lib/Selenium/CanStartBinary.pm

@@ -209,8 +209,9 @@ sub _build_binary_mode {
 sub shutdown_binary {
     my ($self) = @_;
 
-    # TODO: Allow user to keep browser open after test
-    $self->quit;
+    if ( $self->auto_close && defined $self->session_id ) {
+        $self->quit();
+    }
 
     if ($self->has_binary_mode && $self->binary_mode) {
         my $port = $self->port;