Skip to content

Instantly share code, notes, and snippets.

@ciwolsey
Last active August 29, 2015 14:23
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 ciwolsey/5f9addcfdd240638e7e1 to your computer and use it in GitHub Desktop.
Save ciwolsey/5f9addcfdd240638e7e1 to your computer and use it in GitHub Desktop.
Feature: Routing
As a user
I want to see accurate titles for various pages
So that I know where I am and what the page does
Background:
Given I am a new user
@dev
Scenario: Visiting a page that doesn't exist
When I navigate to "/idontexist"
Then I should see the not found page
@dev
Scenario: Visiting login should work
When I navigate to "/login"
Then I should see the login page
RuntimeError: RuntimeError
(ScriptTimeout:28) A script did not complete before its timeout expired.
Problem: Timed out waiting for asyncrhonous script result after 5000 ms
(function () {
'use strict';
// You can include npm dependencies for support files in tests/cucumber/package.json
var _ = require('underscore');
module.exports = function () {
var url = require('url');
this.Given(/^I am a new user$/, function () {
return this.server.call('reset');
});
this.When(/^I navigate to "([^"]*)"$/, function (relativePath, callback) {
this.client.
url(url.resolve(process.env.ROOT_URL, relativePath)).
call(callback);
});
this.Then(/^I should see the not found page$/, function (callback) {
this.client.
waitForVisible('#not-found-container', 10000).
getText('#not-found-container').should.become("Page not found").and.notify(callback);
});
this.Then(/^I should see the login page$/, function (callback) {
this.client.
waitForVisible('#at-forgotPwd', 10000).
getText('#at-forgotPwd').should.become('Forgot your password?').and.notify(callback);
});
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment