Skip to content

Instantly share code, notes, and snippets.

@asciidisco
Created May 7, 2013 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asciidisco/5532065 to your computer and use it in GitHub Desktop.
Save asciidisco/5532065 to your computer and use it in GitHub Desktop.
Test of the denkwerk homepage & the denkwerk blog overview
module.exports = {
'denkwerk blog is reachable': function (test) {
'use strict';
test.expect(12)
.open('http://denkwerk.com')
.assert.chain()
.title('denkwerk GmbH', 'Title of the page is as expected')
.url('http://www.denkwerk.com/', 'Denkwerk url is as expected')
.exists('#menu-item-3133 a', 'Blog anchor element exists')
.visible('#menu-item-3133 a', 'Blog anchor element is visible')
.doesntHaveText('#menu-item-3133 a', 'Projekte', 'Text of "Blog" anchor is not "Projekte"')
.attr('.replaced.top', 'href', '#top', 'Top anchor is set')
.text('.replaced.top', 'nach oben', 'Text of top anchor is correct')
.end()
.click('#menu-item-3133 a')
.waitForElement('#foobar', 500)
.assert.chain()
.url('http://www.denkwerk.com/category/de/allgemein/', 'Blog overview url is as expected')
.numberOfElements('.sub-article', 4, '4 sub articles are shown on the blog overview page')
.doesntExist('#foobar', 'Foobar element is not present on the page')
.end()
.back()
.screenshot('test_1.png')
.assert.url('http://www.denkwerk.com/', 'Back button works')
.forward()
.screenshot('test_2.png')
.assert.url('http://www.denkwerk.com/category/de/allgemein/', 'Forward button works')
.done();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment