-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Rembold
committed
Feb 13, 2016
0 parents
commit cf3f46d
Showing
6 changed files
with
93 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
node_modules |
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,13 @@ | ||
language: node_js | ||
node_js: | ||
- "0.8" | ||
before_install: | ||
- npm install -g grunt-cli | ||
- git clone git://github.com/n1k0/casperjs.git ~/casperjs | ||
- cd ~/casperjs | ||
- git checkout tags/1.0.2 | ||
- export PATH=$PATH:`pwd`/bin | ||
- cd - | ||
before_script: | ||
- phantomjs --version | ||
- casperjs --version |
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,19 @@ | ||
var spawn = require('child_process').spawn, | ||
gulp = require('gulp'), | ||
gutil = require('gulp-util'); | ||
|
||
gulp.task('test', function () { | ||
var tests = ['myTests.js']; | ||
|
||
var casperChild = spawn('casperjs', ['test'].concat(tests)); | ||
|
||
casperChild.stdout.on('data', function (data) { | ||
gutil.log('CasperJS:', data.toString().slice(0, -1)); // Remove \n | ||
}); | ||
|
||
casperChild.on('close', function (code) { | ||
var success = code === 0; // Will be 1 in the event of failure | ||
|
||
// Do something with success here | ||
}); | ||
}); |
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,15 @@ | ||
casper.test.begin('testing.html contains stuff', 3, function (test) { | ||
casper.start('testing.html', function () { | ||
test.assertTitle('Test Page'); | ||
test.assertSelectorHasText('h1', 'Test!'); | ||
}); | ||
|
||
casper.then(function () { | ||
this.click('button'); | ||
test.assertSelectorHasText('h1', 'New title'); | ||
}); | ||
|
||
casper.run(function() { | ||
test.done(); | ||
}); | ||
}); |
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,26 @@ | ||
{ | ||
"name": "testsuite", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "gulp test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/janrembold/testsuite.git" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/janrembold/testsuite/issues" | ||
}, | ||
"homepage": "https://github.com/janrembold/testsuite#readme", | ||
"devDependencies": { | ||
"gulp": "^3.9.1", | ||
"gulp-util": "^3.0.7" | ||
} | ||
} |
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,18 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Test Page</title> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<h1>Test!</h1> | ||
|
||
<button>Change title</button> | ||
|
||
<script> | ||
document.querySelector('button').addEventListener('click', function () { | ||
document.querySelector('h1').innerHTML = 'New title'; | ||
}); | ||
</script> | ||
</body> | ||
</html> |