Skip to content

How do I create global functions? #3010

Discussion options

You must be logged in to vote

This format works for the helpers.js I'm requiring.

module.exports = {

  NodeCreate : function(browser, content) {
    browser
      .url('http://localhost:3000')
      .click({ selector: '#nodeCreateButton', index: 0 })
      .assert.elementPresent('#nodeCreateForm')
      .click({ selector: '#nodeCreateForm button', index: 0 })
      .click({ selector: '#nodeCreateForm ul li', index: 0 })
      .assert.containsText('#nodeCreateForm button span', 'Question')
      .sendKeys('#nodeCreateForm #nodeCreateContent div', [content])
      .click({ selector: '#nodeCreateForm #nodeCreateSubmit', index: 0 })
      .assert.containsText('#focusedPanelFrame #nodeCard #nodeContent', content)
  },

  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NorseGaud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant