Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How can I create a Custom Helper and use other Helpers inside then? #818

@BrunoExterckotter

Description

@BrunoExterckotter

I would like to use and be able to customize more than one helper in custom_helper. It is possible?

When WebDriverIO is the first one in codecept.json, only the chrome render the url, and if the Nightmare is the first one, the url is rendered only in Electron.

I am create a custom helper and I using something like this:

testCustomHelperWithNightmare(var1, var2) {
this.helpers['Nightmare'].fillField(var1, var2);
}
testCustomHelperWithProtractor(var1, var2) {
this.helpers['Protractor'].fillField(var1, var2);
}

My codecept.json:

{
"output": "./output",
"helpers": {
"WebDriverIO": {
"url": "http://www.google.com.br",
"smartWait": 5000,
"browser": "chrome",
"keepCookies": true,
"keepBrowserState": true,
"restart": false,
"windowSize": "maximize",
"desiredCapabilities": {
"acceptSslCerts": true,
"javascriptEnabled": true,
"acceptInsecureCerts": true,
"chrome": {
"browserName": "chrome",
"name": "TEST_CHROME",
"platform": "ANY",
"version": "55.0"
}
}
},
"Nightmare": {
},
"Protractor": {
},
"TestCustomHelper": {
"require": "./testcustomhelper_helper.js"
}
....
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions