Skip to content

Commit

Permalink
Issue #162 - exception in fixture code is causing other test failures…
Browse files Browse the repository at this point in the history
… to be hidden. Problem occurs when delete-session is called by with-driver after the session is already gone (in this case, close-window). (#214)
  • Loading branch information
CodeFarmer authored and igrishaev committed Oct 31, 2019
1 parent a140992 commit fc33e11
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/etaoin/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2786,10 +2786,16 @@
(defn disconnect-driver
"Disconnects from a running Webdriver server.
Closes the current session that is stored in the driver. Removes the
session from the driver instance. Returns modified driver."
Closes the current session that is stored in the driver if it still exists.
Removes the session from the driver instance. Returns modified driver."
[driver]
(delete-session driver)

(try (delete-session driver)
(catch Exception e
(if (not (= 404 (:status (ex-data e))))
;; the exception was caused by something other than "session not found"
(throw e))))

(swap! driver dissoc
:session :capabilities)
driver)
Expand Down

0 comments on commit fc33e11

Please sign in to comment.