Skip to content

Instantly share code, notes, and snippets.

@nickL
Forked from robertwalsh0/help.coffee
Last active August 29, 2015 14:06
Show Gist options
  • Save nickL/816e15138c9f691faf61 to your computer and use it in GitHub Desktop.
Save nickL/816e15138c9f691faf61 to your computer and use it in GitHub Desktop.
#Trying to figure out how to get protractor working
# My first test is simple. Visit the page and see if this thing is on the page
# That test works fine.
# The second test is clicking a button and waiting to see if errors appear
# No matter what I try that I find on the net I can't get it to work. Help?
beforeEach ->
# the following command allows us to
# use protractor with our non-angular application
browser.ignoreSynchronization = true
describe "visit homepage", ->
it "should have a enter your info form ", ->
browser.get 'http://localhost:3000'
form = $('form#request-form')
expect(form.isPresent()).toBe(true)
describe "email validation", ->
it "should trigger errors if you don't fill out an email", ->
# 1. Navigation to page
browser.get 'http://localhost:3000'
# 2. Then search the dom and create vars for the elements..
button = $('input#submit-pdf-form')
errorMsg = $('ul.server-side-errors.animated.fadeInDown')
button.click()
# wait a second for errors to appear
browser.wait ->
expect(errorMsg.isPresent()).toBe(true)
, 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment