Skip to content

Commit

Permalink
added test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Rembold committed Feb 13, 2016
1 parent 81cc3ac commit b23c23e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ before_install:
- npm install -g gulp
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
- cd ~/casperjs
# - git checkout tags/1.0.2
- export PATH=$PATH:`pwd`/bin
- cd -
# - cd -
before_script:
- phantomjs --version
- casperjs --version
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ var spawn = require('child_process').spawn,
gutil = require('gulp-util');

gulp.task('test', function () {
var tests = ['myTests.js'];

var tests = ['test/'];
var casperChild = spawn('casperjs', ['test'].concat(tests));

casperChild.stdout.on('data', function (data) {
Expand All @@ -15,5 +14,8 @@ gulp.task('test', function () {
var success = code === 0; // Will be 1 in the event of failure

// Do something with success here
if (!success) {
process.exit(1);
}
});
});
File renamed without changes.
17 changes: 17 additions & 0 deletions test/test2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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();
});

});

0 comments on commit b23c23e

Please sign in to comment.