Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access (Nightmare) helper from custom helper #418

Closed
ThePeach opened this issue Feb 13, 2017 · 1 comment
Closed

Unable to access (Nightmare) helper from custom helper #418

ThePeach opened this issue Feb 13, 2017 · 1 comment

Comments

@ThePeach
Copy link

ThePeach commented Feb 13, 2017

What are you trying to achieve?

I'm trying to access Nightmare helpers from within a custom helper I've created

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

Cannot read property '_locate' of undefined

Provide test source code if related

class DOMElements extends Helper {
  countElements (locator) {
    let value = this.helpers['Nightmare']._locate(locator).then(function (els) {
      return els.length
    })

    return value
  }
}

module.exports = DOMElements

Details

  • CodeceptJS version: 0.5.0
  • NodeJS Version: 7.4.0
  • Operating System: Linux
  • Nightmare version: 2.9.1
  • Configuration file:
{
  "tests": "./__tests__/*_test.js",
  "timeout": 10000,
  "output": "./codecept-output",
  "helpers": {
    "Nightmare": {
      "url": "http://localhost:3001"
    },
    "DOMElements": {
      "require": "./__tests__/helpers/domelements_helper.js"
    }
  },
  "include": {
    "I": "./__tests__/steps_file.js"
  },
  "bootstrap": false,
  "mocha": {},
  "name": "flickr-test"
}
@ThePeach
Copy link
Author

OK apparently this has been fixed on its own. Is it possible that something is being cached somewhere???
/cc @DavertMik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant