Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Windows Loader written in Batch #234

Closed
wants to merge 2 commits into from

3 participants

@Reinboom

This provides a loader similar in function to the Ruby and Python loader, but setup for windows.

After adding phantomjs to the windows Path variable as well as casperjs/batchbin to the windows Path variable, this should work as it would on OSX. "casperjs "

Although a lot of our web engineers use OS X, the vast majority of our DevQA prefer Windows, so this is vital for enterprise inclusion.

@n1k0
Owner

Wow, thank you! I'll be merging this after some testing as soon as I'll get a windows vm running :)

@AndiDog

I can confirm this is working, should be better than my simple script because it also handles phantomjs arguments. @n1k0: Please pull this one, I will close my request.

@n1k0 n1k0 referenced this pull request from a commit
@n1k0 refs #234 - updated CHANGELOG f3fd540
@n1k0
Owner

Merged, thanks for contributing.

PS: dunno why github hasn't closed this one automatically.

@n1k0 n1k0 closed this
@n1k0
Owner

@AndiDog @Reinboom if you have 5 minutes, could you just describe basique installation (if any) & usage of this new tool? Write it here in markdown, I'll add it to the docs myself.

@Reinboom

Phantomjs installation additions

  • Windows users: Append ";C:\phantomjs" to your PATH environment variable. Modify this path appropriately if you installed PhantomJS to a different location.

Casperjs installation additions

  • Windows users: Append ";C:\casperjs\batchbin" to your PATH environment variable. Modify this path appropriately if you installed CasperJS to a different location.
@n1k0
Owner

@Reinboom: thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 22 additions and 0 deletions.
  1. +22 −0 batchbin/casperjs.bat
View
22 batchbin/casperjs.bat
@@ -0,0 +1,22 @@
+@ECHO OFF
+set CASPER_PATH=%~dp0..\
+set CASPER_BIN=%CASPER_PATH%bin\
+
+set PHANTOMJS_NATIVE_ARGS=(--cookies-file --config --debug --disk-cache --ignore-ssl-errors --load-images --load-plugins --local-storage-path --local-storage-quota --local-to-remote-url-access --max-disk-cache-size --output-encoding --proxy --proxy-auth --proxy-type --remote-debugger-port --remote-debugger-autorun --script-encoding --web-security)
+
+set PHANTOM_ARGS=
+set CASPER_ARGS=
+
+:Loop
+if "%1"=="" goto Continue
+ set IS_PHANTOM_ARG=0
+ for %%i in %PHANTOMJS_NATIVE_ARGS% do (
+ if "%%i"=="%1" set IS_PHANTOM_ARG=1
+ )
+ if %IS_PHANTOM_ARG%==0 set CASPER_ARGS=%CASPER_ARGS% %1
+ if %IS_PHANTOM_ARG%==1 set PHANTOM_ARGS=%PHANTOM_ARGS% %1
+shift
+goto Loop
+:Continue
+
+call phantomjs%PHANTOM_ARGS% %CASPER_BIN%bootstrap.js --casper-path=%CASPER_PATH% --cli%CASPER_ARGS%
Something went wrong with that request. Please try again.