Skip to content

Instantly share code, notes, and snippets.

@ebrehault
Created June 10, 2013 08:14
Show Gist options
  • Save ebrehault/5747228 to your computer and use it in GitHub Desktop.
Save ebrehault/5747228 to your computer and use it in GitHub Desktop.
Resurrectio on http://wetter.orf.at/
//==============================================================================
// Casper generated Mon Jun 10 2013 10:09:49 GMT+0200 (CEST)
//==============================================================================
var x = require('casper').selectXPath;
var casper = require('casper').create();
casper.options.viewportSize = {width: 1615, height: 928};
casper.start('http://wetter.orf.at/oes/');
casper.waitForSelector(".mapNavigation li:nth-child(2) div",
function success() {
this.test.assertExists(".mapNavigation li:nth-child(2) div");
this.click(".mapNavigation li:nth-child(2) div");
},
function fail() {
this.test.assertExists(".mapNavigation li:nth-child(2) div");
});
casper.waitForSelector(".fulltextWrapper h2:nth-child(1)",
function success() {
this.test.assertExists(".fulltextWrapper h2:nth-child(1)");
this.click(".fulltextWrapper h2:nth-child(1)");
},
function fail() {
this.test.assertExists(".fulltextWrapper h2:nth-child(1)");
});
casper.waitForSelector(x("//*[contains(text(), 'Heute, Montag')]"),
function success() {
this.test.assertExists(x("//*[contains(text(), 'Heute, Montag')]"));
},
function fail() {
this.test.assertExists(x("//*[contains(text(), 'Heute, Montag')]"));
});
casper.run(function() {this.test.renderResults(true);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment