Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
82863faf
...
82863faf8b0ada90690d4d0e163513e7f0598ebf
authored
2013-03-10 11:39:01 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
jshint 1.0.0 compliance
1 parent
64b73b49
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
45 additions
and
44 deletions
samples/bbcshots.js
samples/cliplay.js
samples/customevents.js
samples/customlogging.js
samples/download.js
samples/dynamic.js
samples/each.js
samples/events.js
samples/extends.js
samples/googlelinks.js
samples/googlematch.js
samples/googlepagination.js
samples/googletesting.js
samples/logcolor.js
samples/metaextract.js
samples/multirun.js
samples/screenshot.js
samples/statushandlers.js
samples/steptimeout.js
samples/timeout.js
samples/translate.js
tests/run.js
tests/suites/casper/auth.js
tests/suites/casper/click.js
tests/suites/casper/evaluate.js
tests/suites/casper/formfill.js
tests/suites/casper/frames.js
tests/suites/casper/keys.js
tests/suites/casper/location.js
tests/suites/casper/logging.js
tests/suites/casper/mouseevents.js
tests/suites/casper/popup.js
tests/suites/casper/xpath.js
tests/suites/cli.js
tests/suites/pagestack.js
tests/suites/tester/assert.js
tests/suites/tester/begin-config.js
tests/suites/tester/test-order.js
tests/suites/tester/testcase.js
tests/suites/tester/testsuite.js
tests/suites/xunit.js
samples/bbcshots.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* Create a mosaic image from all headline photos on BBC homepage
...
...
samples/cliplay.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
();
var
dump
=
require
(
"utils"
).
dump
;
...
...
samples/customevents.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
();
...
...
samples/customlogging.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* A basic custom logging implementation. The idea is to (extremely) verbosely
...
...
samples/download.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* download the google logo image onto the local filesystem
...
...
samples/dynamic.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
...
...
samples/each.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
();
...
...
samples/events.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* This script will add a custom HTTP status code handler, here for 404 pages.
...
...
samples/extends.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
({
loadImages
:
false
,
...
...
samples/googlelinks.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError console phantom require*/
/*global CasperError, console, phantom, require*/
var
links
=
[];
var
casper
=
require
(
"casper"
).
create
();
...
...
samples/googlematch.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* Takes provided terms passed as arguments and query google for the number of
...
...
samples/googlepagination.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* Capture multiple pages of google search results
...
...
samples/googletesting.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
casper console phantom
require*/
/*global CasperError
, casper, console, phantom,
require*/
/**
* Google sample testing.
*
...
...
samples/logcolor.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
,
...
...
samples/metaextract.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
();
var
url
=
casper
.
cli
.
get
(
0
);
...
...
samples/multirun.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
casper
=
require
(
"casper"
).
create
({
verbose
:
true
...
...
samples/screenshot.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* This script will capture a screenshot of a twitter account page
...
...
samples/statushandlers.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* This script will add a custom HTTP status code handler, here for 404 pages.
...
...
samples/steptimeout.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
var
failed
=
[];
var
start
=
null
;
...
...
samples/timeout.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* Just a silly game.
...
...
samples/translate.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
console phantom
require*/
/*global CasperError
, console, phantom,
require*/
/**
* Translation using the Google Translate Service.
...
...
tests/run.js
View file @
82863fa
/*global phantom
CasperError patchRequir
e*/
/*global phantom
, CasperError, patchRequire, require:true, casper:tru
e*/
if
(
!
phantom
.
casperLoaded
)
{
console
.
log
(
'This script must be invoked using the casperjs executable'
);
...
...
tests/suites/casper/auth.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements:99*/
/*jshint strict:false
,
maxstatements:99*/
casper
.
test
.
begin
(
'HTTP authentication tests'
,
8
,
function
(
test
)
{
casper
.
start
(
'tests/site/index.html'
);
...
...
tests/suites/casper/click.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements: 99*/
/*jshint strict:false
,
maxstatements: 99*/
var
utils
=
require
(
'utils'
);
casper
.
test
.
begin
(
'click() tests'
,
2
,
function
(
test
)
{
...
...
tests/suites/casper/evaluate.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxparams:99*/
/*jshint strict:false
,
maxparams:99*/
casper
.
test
.
begin
(
'mapping argument context'
,
1
,
function
(
test
)
{
casper
.
start
();
var
context
=
{
...
...
tests/suites/casper/formfill.js
View file @
82863fa
/*global casper __utils__*/
/*global casper
,
__utils__*/
/*jshint strict:false*/
var
fs
=
require
(
'fs'
);
...
...
tests/suites/casper/frames.js
View file @
82863fa
/*global casper __utils__*/
/*global casper
,
__utils__*/
/*jshint strict:false*/
casper
.
test
.
begin
(
'handling frames'
,
16
,
function
(
test
)
{
casper
.
start
(
'tests/site/frames.html'
);
...
...
tests/suites/casper/keys.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
casper console phantom
require*/
/*global CasperError
, casper, console, phantom,
require*/
casper
.
test
.
begin
(
'sendKeys() tests'
,
2
,
function
(
test
)
{
casper
.
start
(
'tests/site/form.html'
,
function
()
{
this
.
sendKeys
(
'input[name="email"]'
,
'duke@nuk.em'
);
...
...
tests/suites/casper/location.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
casper console phantom
require*/
/*global CasperError
, casper, console, phantom,
require*/
var
utils
=
require
(
'utils'
)
if
(
utils
.
ltVersion
(
phantom
.
version
,
'1.8.0'
))
{
...
...
tests/suites/casper/logging.js
View file @
82863fa
/*jshint strict:false*/
/*global casper __utils__*/
/*global casper
,
__utils__*/
casper
.
test
.
begin
(
'logging tests'
,
4
,
function
(
test
)
{
casper
.
start
(
'tests/site/index.html'
);
...
...
tests/suites/casper/mouseevents.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements:99*/
/*jshint strict:false
,
maxstatements:99*/
casper
.
test
.
begin
(
'mouseEvent() tests'
,
16
,
function
(
test
)
{
casper
.
start
(
'tests/site/mouse-events.html'
,
function
()
{
test
.
assert
(
this
.
mouseEvent
(
'mousedown'
,
'#test1'
),
'Casper.mouseEvent() can dispatch a mousedown event'
);
...
...
tests/suites/casper/popup.js
View file @
82863fa
/*jshint strict:false maxstatements:99*/
/*global CasperError
casper console phantom
require*/
/*jshint strict:false
,
maxstatements:99*/
/*global CasperError
, casper, console, phantom,
require*/
var
utils
=
require
(
'utils'
);
var
x
=
require
(
'casper'
).
selectXPath
;
...
...
tests/suites/casper/xpath.js
View file @
82863fa
/*global casper __utils__*/
/*global casper
,
__utils__*/
/*jshint strict:false*/
var
x
=
require
(
'casper'
).
selectXPath
;
...
...
tests/suites/cli.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements:99*/
/*jshint strict:false
,
maxstatements:99*/
var
cli
=
require
(
'cli'
);
casper
.
test
.
begin
(
'parsing an empty argument list'
,
12
,
function
(
test
)
{
...
...
tests/suites/pagestack.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements:99*/
/*jshint strict:false
,
maxstatements:99*/
var
pagestack
=
require
(
'pagestack'
);
var
utils
=
require
(
'utils'
);
var
webpage
=
require
(
'webpage'
);
...
...
tests/suites/tester/assert.js
View file @
82863fa
/*global casper*/
/*jshint strict:false maxstatements:99*/
/*jshint strict:false
,
maxstatements:99*/
var
fs
=
require
(
'fs'
);
casper
.
test
.
begin
(
'Common assertions tests'
,
43
,
function
(
test
)
{
...
...
tests/suites/tester/begin-config.js
View file @
82863fa
/*jshint strict:false eqeqeq:false*/
/*global CasperError
casper console phantom
require*/
/*jshint strict:false
,
eqeqeq:false*/
/*global CasperError
, casper, console, phantom,
require*/
var
steps
=
[];
casper
.
test
.
begin
(
'Tester.begin() configuration'
,
10
,
{
...
...
tests/suites/tester/test-order.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
casper console phantom
require*/
/*global CasperError
, casper, console, phantom,
require*/
var
fs
=
require
(
'fs'
);
casper
.
test
.
begin
(
'Tester.sortFiles()'
,
1
,
function
suite
(
test
)
{
...
...
tests/suites/tester/testcase.js
View file @
82863fa
/*jshint strict:false
maxstatements:99 maxcomplexity:99
*/
/*global CasperError
casper console phantom
require*/
/*jshint strict:false
, maxstatements:99, maxcomplexity:99
*/
/*global CasperError
, casper, console, phantom,
require*/
var
TestCaseResult
=
require
(
'tester'
).
TestCaseResult
;
...
...
tests/suites/tester/testsuite.js
View file @
82863fa
/*jshint strict:false*/
/*global CasperError
casper console phantom
require*/
/*global CasperError
, casper, console, phantom,
require*/
var
TestCaseResult
=
require
(
'tester'
).
TestCaseResult
,
TestSuiteResult
=
require
(
'tester'
).
TestSuiteResult
;
...
...
tests/suites/xunit.js
View file @
82863fa
/*global casper __utils__*/
/*global casper
,
__utils__*/
/*jshint strict:false*/
var
tester
=
require
(
'tester'
);
var
testpage
=
require
(
'webpage'
).
create
();
...
...
Please
register
or
sign in
to post a comment