mojotech / pioneer

Integration Testing
MIT License
527 stars 35 forks source link

`undefined is not a function` in Widget.Form #285

Open moimikey opened 9 years ago

moimikey commented 9 years ago

holaaaaaa,

am I doing something wrong here?

  @When /^I enter incorrect values for all of the form fields$/, ->
    form = new @Widget.Form.extend
      root: 'form'

    form.submitWith
      subdomain: 'testingtesting0000'
      password: 'abc123abc123'
      email: 'testingtesting0000@mail.gov'
    When I enter incorrect values for all of the form fields
      TypeError: undefined is not a function
          at Object.<anonymous> (/Applications/wordpress-4.0-1/apps/wordpress/htdocs/wp-content/themes/dt-the7-child/js/tests/steps/signup.coffee:91:19)
          at /Applications/wordpress-4.0-1/apps/wordpress/htdocs/wp-content/themes/dt-the7-child/js/node_modules/pioneer/lib/support/index.js:65:25
          at webdriver.promise.ControlFlow.runInNewFrame_ (/Applications/wordpress-4.0-1/apps/wordpress/htdocs/wp-content/themes/dt-the7-child/js/node_modules/pioneer/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654:20)
          at webdriver.promise.ControlFlow.runEventLoop_ (/Applications/wordpress-4.0-1/apps/wordpress/htdocs/wp-content/themes/dt-the7-child/js/node_modules/pioneer/node_modules/selenium-webdriver/lib/webdriver/promise.js:1518:8)
    Then I should see errors for all of the fields
tomhicks commented 9 years ago

I suspect you're not newing the right thing.

Try

LoginForm = @Widget.Form.extend({ blah })
form = new LoginForm
samccone commented 9 years ago

@tomhicks that looks correct..

@moimikey let me know if this is still not working for you