Created
April 23, 2014 16:49
-
-
Save sulmanen/11223172 to your computer and use it in GitHub Desktop.
Example Acceptance Test for protractor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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