I'm using the protractor - cucumber framework and can't run my test. A browser is launched but doesn't navigate to my URL and then I receive the following error:
$ protractor conf.js
(node:10648) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[11:25:05] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[11:25:05] I/launcher - Running 1 instances of WebDriver
[11:25:09] E/launcher - Error: TypeError: Cannot call a class as a function
at exports.default (C:\Source\test\node_modules\babel-runtime\helpers\classCallCheck.js:7:11)
at Object.Cli (C:\Source\test\node_modules\cucumber\lib\cli\index.js:64:34)
at C:\Source\test\node_modules\protractor-cucumber-framework\index.js:31:16
at Function.promise (C:\Source\test\node_modules\q\q.js:682:9)
at C:\Source\test\node_modules\protractor-cucumber-framework\index.js:24:14
at _fulfilled (\\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (\\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (\\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at \\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (\\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
at flush (\\hermes\vhd_profiles\VDI_Home_VHD1\modisej\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[11:25:09] E/launcher - Process exited with error code 100
Conf.js
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
//// getPageTimeout: 60000,
////allScriptsTimeout: 500000,
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
'browserName': 'chrome'
},
// Spec patterns are relative to this directory.
specs: ['Features/*.feature'],
baseURL: 'http://localhost:/8080',
cucumberOpts: {
require: 'Features/step_definitions/homePage.js',
tags: false,
format: undefined,
profile: false,
'no-source': true
}
};
Feature file:
#features/test.feature
Feature: App hub home page
Scenario: First sample
Given I go to the app hub site
When the homepage has loaded
Then I expect to see title app hub
Step Definitions:
At the moment I have only put in step definitions for statement "Given I go to the app hub site"
The step_definitions are saved in a folder called 'step_definitions' within the 'Features' folder which I have referred to in my conf.js file.
module.exports = function() {
this.Given('I go to the app hub site', function (callback) {
browser.get('http://localhost:8080')
.then (callback);
});
};
Any help would be much appreciated.