Skip to content

Instantly share code, notes, and snippets.

@sulmanen
Created April 23, 2014 16:49
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 sulmanen/11223172 to your computer and use it in GitHub Desktop.
Save sulmanen/11223172 to your computer and use it in GitHub Desktop.
Example Acceptance Test for protractor
describe('Shorty', function () {
'use strict';
var shorty = require('../po/shortyMain.js');
var mainPage;
browser.ignoreSynchronization = true;
beforeEach(function () {
browser.get(baseUrl);
mainPage = new shorty();
});
it('can shorten url', function () {
expect(mainPage.title()).toBe('Get Shorty');
mainPage.enterUrl('http://www.rovio.com');
mainPage.shorten();
expect(mainPage.linkText()).toMatch(/go/);
});
it('shows error message for trash url', function() {
mainPage.enterUrl('qwerty');
mainPage.shorten();
expect(mainPage.linkText()).toBe('');
expect(mainPage.error()).toMatch(/no protocol:/);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment