Permalink
Browse files

Use new with-driver in tests to clean up Firefox tests

  • Loading branch information...
1 parent e3037c0 commit eed8d73c3d048c10dc68bffdd602dd50e85c128f @semperos semperos committed Jan 5, 2012
Showing with 9 additions and 14 deletions.
  1. +9 −14 test/clj_webdriver/test/core.clj
@@ -685,27 +685,22 @@
;; Firefox-specific Functionality
-(def tmp-firefox-driver (atom nil))
(deftest firefox-should-support-custom-profiles
(is (if (travis?)
true
- (do
+ (with-browser [tmp-dr (to (new-driver {:browser :firefox
+ :profile (ff/new-profile)})
+ test-base-url)]
(log/info "[x] Starting Firefox with custom profile.")
- (reset! tmp-firefox-driver (to (new-driver {:browser :firefox
- :profile (ff/new-profile)})
- test-base-url))
- (driver? @tmp-firefox-driver))))
- (quit @tmp-firefox-driver))
+ (driver? tmp-dr)))))
(deftest firefox-should-support-extensions
(is (if (travis?)
true
- (do
+ (with-browser [tmp-dr (to (new-driver {:browser :firefox
+ :profile (doto (ff/new-profile)
+ (ff/enable-extension :firebug))})
+ test-base-url)]
(log/info "[x] Starting Firefox with extensions.")
- (reset! tmp-firefox-driver (to (new-driver {:browser :firefox
- :profile (doto (ff/new-profile)
- (ff/enable-extension :firebug))})
- test-base-url))
- (driver? @tmp-firefox-driver))))
- (quit @tmp-firefox-driver))
+ (driver? tmp-dr)))))

0 comments on commit eed8d73

Please sign in to comment.