This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves webdriver launch code into it's own namesspace
- Loading branch information
justin taft
committed
Oct 18, 2015
1 parent
40a3b0c
commit 88b649b
Showing
7 changed files
with
177 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
environment: | ||
global: | ||
CYG_ROOT: C:\cygwin | ||
CYG_MIRROR: http://cygwin.mirror.constant.com | ||
CYG_CACHE: C:\cygwin\var\cache\setup | ||
CYG_BASH: C:\cygwin\bin\bash | ||
|
||
cache: | ||
- '%CYG_CACHE%' | ||
|
||
init: | ||
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) | ||
|
||
install: | ||
- 'echo Setting up Cygwin dependencies' | ||
- '%CYG_ROOT%\setup-x86.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl -P unzip -P psmisc> NUL' | ||
|
||
|
||
#DEBUG BEGIN | ||
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) | ||
#- ps: throw "Failing tests" | ||
#DBEUG END | ||
|
||
- 'echo Check Cygwin setup' | ||
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"' | ||
- 'echo Done setting up Cygwin' | ||
- ps: | | ||
$base = "https://raw.githubusercontent.com/technomancy/leiningen/" | ||
$lein = $base + "stable/bin/lein.bat" | ||
(new-object net.webclient).DownloadFile($lein, "c:/projects/lighttable/lein.bat") | ||
- cmd: dir | ||
- lein self-install | ||
- 'echo Done installing lein' | ||
- cmd: dir | ||
#Add random location, this prevents qutation mark being added to | ||
#the current directory's path | ||
- cmd: 'set PATH="%PATH%;%cd%;c:\windows\system32"' | ||
- cmd: 'echo %PATH%' | ||
|
||
|
||
|
||
|
||
build_script: | ||
- cmd: 'echo Cygwin root is: %CYG_ROOT%' | ||
- cmd: 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%' | ||
- cmd: 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%' | ||
- cmd: 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%' | ||
- '%CYG_ROOT%/bin/bash -lc "echo path is $PATH"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; pwd"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; echo \"#!/bin/bash\" > lein.sh"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; echo \"./lein.bat \$@\" >> lein.sh"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; chmod a+x lein.sh"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; cat lein.sh"' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ln -s /cygdrive/c/projects/lighttable/lein.sh lein; ls -la"' | ||
|
||
|
||
|
||
- cmd: 'echo Running build.sh' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./script/build.sh"' | ||
- cmd: 'echo Runnig tests' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./script/run-tests.sh"' | ||
|
||
- cmd: 'echo run-tests.sh finished' | ||
- '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER; ls /tmp/"' | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
|
||
#!/bin/sh | ||
./script/light.sh &> /tmp/lt-debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
(ns lt.webdriver-helper | ||
(:import | ||
(java.net URL) | ||
(org.openqa.selenium.remote DesiredCapabilities) | ||
(org.openqa.selenium.remote RemoteWebDriver) | ||
(org.openqa.selenium.chrome ChromeOptions)) | ||
(:require | ||
[clj-webdriver.taxi :as taxi] | ||
[clojure.java.shell :only [sh] :as shell] | ||
[clj-webdriver.driver :as driver])) | ||
|
||
|
||
(def chromeOptions { | ||
"debuggerAddress" "127.0.0.1:8315" | ||
}) | ||
|
||
(def capabilities (DesiredCapabilities/chrome)) | ||
(.setCapability capabilities ChromeOptions/CAPABILITY chromeOptions) | ||
(.setCapability capabilities "browserName" "electron") | ||
|
||
|
||
(defn log [msg] | ||
(println msg)) | ||
|
||
|
||
(defn get-project-directory [] | ||
(System/getProperty "user.dir")) | ||
|
||
|
||
(defn get-lt-test-launch-script-location [os-name] | ||
"Returns script that launches light table for tests." | ||
(str (get-project-directory) "/script/light-test" | ||
(if (re-matches #"^(?i)windows" os-name) | ||
".bat" | ||
".sh"))) | ||
|
||
(defn start-lighttable-async [] | ||
(-> (Thread. (fn[] | ||
(Thread/sleep 5000) | ||
(shell/sh (get-lt-test-launch-script-location (System/getProperty "os.name"))))) | ||
(.start))) | ||
|
||
(defn connect-to-light-table! [] | ||
"Connects to light table" | ||
;TODO check if we are already connected to light-table to avoid re-connecting? | ||
(start-lighttable-async) | ||
(-> (RemoteWebDriver. (URL. "http://127.0.0.1:9515") capabilities) | ||
(driver/init-driver) | ||
(taxi/set-driver!))) | ||
|
||
(defn get-webdriver [] | ||
taxi/*driver*) | ||
|
||
|
||
|