Skip to content

Instantly share code, notes, and snippets.

@garlandkr
Created January 26, 2014 16:47
Show Gist options
  • Save garlandkr/8635512 to your computer and use it in GitHub Desktop.
Save garlandkr/8635512 to your computer and use it in GitHub Desktop.
//==============================================================================
// Casper generated Sun Jan 26 2014 10:54:09 GMT-0500 (EST)
//======================c========================================================
var x = require('casper').selectXPath;
ERROR: the recorded sequence does not start with a url openning.
casper.waitForSelector(".main-nav a:nth-child(2) .nav-in",
function success() {
test.assertExists(".main-nav a:nth-child(2) .nav-in");
this.click(".main-nav a:nth-child(2) .nav-in");
},
function fail() {
test.assertExists(".main-nav a:nth-child(2) .nav-in");
});
casper.waitForSelector(".main-nav a:nth-child(3) li",
function success() {
test.assertExists(".main-nav a:nth-child(3) li");
this.click(".main-nav a:nth-child(3) li");
},
function fail() {
test.assertExists(".main-nav a:nth-child(3) li");
});
casper.waitForSelector(".main-nav a:nth-child(4) li",
function success() {
test.assertExists(".main-nav a:nth-child(4) li");
this.click(".main-nav a:nth-child(4) li");
},
function fail() {
test.assertExists(".main-nav a:nth-child(4) li");
});
casper.waitForSelector("a:nth-child(6) .nav-in",
function success() {
test.assertExists("a:nth-child(6) .nav-in");
this.click("a:nth-child(6) .nav-in");
},
function fail() {
test.assertExists("a:nth-child(6) .nav-in");
});
casper.waitForSelector("a:nth-child(7) .nav-in",
function success() {
test.assertExists("a:nth-child(7) .nav-in");
this.click("a:nth-child(7) .nav-in");
},
function fail() {
test.assertExists("a:nth-child(7) .nav-in");
});
casper.run(function() {test.done();});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment