W
W
whowho2019-04-30 23:24:38
Node.js
whowho, 2019-04-30 23:24:38

How to enable emulation of a mobile device using nightwatchjs for the firefox browser?

How to enable emulation of a mobile device using nightwatchjs for the firefox browser?
The nightwatch.json file looks like this:

{
  "webdriver": {
    "start_process" : true,
    "server_path": "./node_modules/.bin/geckodriver",
    "cli_args": [
      "--log", "debug"
    ],
    "port": 4444
  },

  "test_settings" : {
    "default" : {
      "desiredCapabilities": {
        "browserName" : "firefox",
        "acceptInsecureCerts": true,
        "nativeEvents": true,
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "firefoxOptions": {
          "mobileEmulation": {
            "deviceMetrics": {
              "width": 360,
              "height": 640,
              "pixelRatio": 3
            },
            "userAgent": "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Mobile Safari/537.36"
          }
        }
      }
    }
  }
}

What can I replace firefoxOptions with or how can I make the emulation of a mobile device work differently?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question