nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.79k stars 1.31k forks source link

I am not able to run nighwatch using phantom js. Can any one help me in that . Please find nightwatch json file. #1701

Closed Akshaya2312 closed 6 years ago

Akshaya2312 commented 6 years ago

Thanks in advance for your contribution. Please follow the below steps in submitting an issue, as it will help us with addressing it quicker.

Before submitting a new issue, try searching for a similar one here: https://github.com/nightwatchjs/nightwatch/search?state=open&type=Issues.

Akshaya2312 commented 6 years ago

const seleniumServer = require('selenium-server'); const phantomjs = require('phantomjs-prebuilt'); const chromedriver = require('chromedriver'); const geckodriver = require('geckodriver'); console.log(phantomjs.path);

require('nightwatch-cucumber')({ cucumberArgs: ['--require', 'test/EndtoEnd/step_definitions', '--format', 'json:reports/cucumber.json', 'test/EndtoEnd/features'] });

module.exports = { output_folder: 'reports', custom_assertions_path: '', page_objects_path : 'test/EndtoEnd/page_objects', live_output: false, disable_colors: false, selenium: { start_process: false , server_path: seleniumServer.path, log_path: '', host: '127.0.0.1', port: 6666 }, test_settings: { default: { launch_url: 'http://localhost:8087', selenium_port: 4444, selenium_host: '127.0.0.1' }, chrome: { desiredCapabilities: { browserName: 'chrome', javascriptEnabled: true, acceptSslCerts: true,

    chromeOptions: {
      args: ['use-fake-ui-for-media-stream', '--load-extension=test/EndtoEnd/Plugins/1.2.2_0',
        '--auto-select-desktop-capture-source=Screen 2'],
    }

  },
  selenium: {
    cli_args: {
      'webdriver.chrome.driver': chromedriver.path
    }
  }
},
phantom: {
  desiredCapabilities: {
    browserName: 'phantomjs',
    javascriptEnabled: true,
    acceptSslCerts: true,
    'phantomjs.cli.args': ['use-fake-ui-for-media-stream', '--load-extension=test/EndtoEnd/Plugins/1.2.2_0',
      '--auto-select-desktop-capture-source=Screen 2', '--ignore-ssl-errors=true'],
    'phantomjs.page.settings.userAgent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36',
    'phantomjs.binary.path': phantomjs.path

  }
},
firefox: {
  desiredCapabilities: {
    browserName: 'firefox',
    javascriptEnabled: true,
    marionette: true
  },
  selenium: {
    cli_args: {
      'webdriver.gecko.driver': geckodriver.path
    }
  }
},

} };

Akshaya2312 commented 6 years ago

Packaje Json - "test:phantom": "better-npm-run test-phantom",

"test-phantom": { "command": "nightwatch --env phantom", "env": { "URL": "" } },

Akshaya2312 commented 6 years ago

@beatfactor can you please help me with this?

straris commented 6 years ago

phantomjs is deprecated, please use chrome/firefox headless

spnraju commented 6 years ago

@straris what do you mean when you say deprecated? nightwatch will not support phantomjs anymore?

straris commented 6 years ago

@spnraju phantomjs itself is not maintained anymore. I won't be surprised if the frameworks stop supporting it in their turns. @Akshaya2312 I would gladly help you if you create a question on stackoverflow, this space is for nightwatch issues only.