CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

multiCapabilities ignored !

Open xeonarno opened this issue 8 years ago • 1 comments

What are you trying to achieve?

Play multiple browsers runs but fails ! The main problem is that simple run can't play multiCapabilities property. It must have the capabilities properties. but both can't exist together.

I try the "run-multiple" command but it also ignore the "multiCapabilities" properties.

What do you get instead?

Errors

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

$(npm bin)/codeceptjs run -c ./test/config/codecept.conf.js --reporter mocha-multi
Could not load helper Protractor from module './helper/Protractor':
Cannot set property 'browserName' of undefined

Details

I delete the line "capabilities: {}" in https://github.com/Codeception/CodeceptJS/blob/6bdc2ef557723449b9f4cdfcdaae3bb1441de0f7/lib/helper/Protractor.js#L141

  • CodeceptJS version: CodeceptJS v1.4.2
  • NodeJS Version:v10.11.0
  • Operating System: osx 10.14 Mojave
  • Protractor
  • Configuration file:
{
  "tests": "./../ui/**/!(_)*_test.ts",
  "timeout": 60000,
  "output": "./../test-reports/screenshots/",
  "helpers": {
    "CrossBT": {
      "require": "./helpers/CrossBT_helper.js",
      "defaultHost": "https://data-staging.xxxxx-xxxxx.io"
    },
    "Protractor": {
      "browser": "Chrome",
      "url": "https://data-staging.xxxxx-xxxxx.io",
      "defaultHost": "https://data-staging.xxxxx-xxxxx.io",
      "baseUrl": "https://data-staging.xxxxx-xxxxx.io",
      "driver": "hosted",
      "rootElement": "body",
      "allScriptsTimeout": 60000,
      "smartWait": 5000,
      "useAllAngular2AppRoots": true,
      "restart": false,
      "manualStart": false,
      "seleniumAddress": "http://[email protected]:[email protected]:80/wd/hub",
      "multiCapabilities": [
        {
          "build": "v3.0.0 alpha",
          "record_video": "true",
          "record_network": "true",
          "record_snapshot": "true",
          "username": "[email protected]",
          "password": "xxxxx",
          "chromeOptions": {
            "prefs": {
              "download": {
                "prompt_for_download": false,
                "directory_upgrade": true,
                "default_directory": "/Users/xxxxx/Dev/nodejs/xxxxx/front/test/data"
              }
            }
          },
          "browserName": "Chrome",
          "version": "68",
          "platform": "Windows 10",
          "screenResolution": "1366x768",
          "name": "Oct-08 11:37 > Chrome -- "
        },
        {
          "build": "v3.0.0 alpha",
          "record_video": "true",
          "record_network": "true",
          "record_snapshot": "true",
          "username": "[email protected]",
          "password": "xxxxx",
          "chromeOptions": {
            "prefs": {
              "download": {
                "prompt_for_download": false,
                "directory_upgrade": true,
                "default_directory": "/Users/xxxxx/Dev/nodejs/xxxxx/front/test/data"
              }
            }
          },
          "browserName": "Chrome",
          "version": "63",
          "platform": "Windows 8",
          "screenResolution": "1920x1080",
          "name": "Oct-08 11:37 > Chrome -- "
        },
        {
          "build": "v3.0.0 alpha",
          "record_video": "true",
          "record_network": "true",
          "record_snapshot": "true",
          "username": "[email protected]",
          "password": "xxxxx",
          "browserName": "Internet Explorer",
          "version": "10",
          "platform": "Windows 8",
          "screenResolution": "1366x768",
          "name": "Oct-08 11:37 > Internet Explorer -- "
        },
        {
          "build": "v3.0.0 alpha",
          "record_video": "true",
          "record_network": "true",
          "record_snapshot": "true",
          "username": "[email protected]",
          "password": "xxxxx",
          "browserName": "Safari",
          "version": "11",
          "platform": "Mac OSX 10.13",
          "screenResolution": "1366x768",
          "name": "Oct-08 11:37 > Safari -- "
        }
      ]
    },
    "Mochawesome": {
      "uniqueScreenshotNames": "true"
    },
    "FileSystem": {}
  },
  "noGlobals": false,
  "angular": true,
  "mocha": {
    "reporterOptions": {
      "codeceptjs-cli-reporter": {
        "stdout": "-",
        "options": {
          "verbose": false,
          "steps": true
        }
      },
      "mochawesome": {
        "stdout": "-",
        "options": {
          "reportDir": "./test/test-reports/html/",
          "reportFilename": "index"
        }
      },
      "xunit": {
        "stdout": "-",
        "options": {
          "output": "./test/test-reports/results.xml"
        }
      }
    }
  },
  "multiple": {
    "basic": {
      "chunks": 2,
      "browsers": [
        "Chrome",
        "Firefox"
      ]
    }
  },
  "include": {
    "I": "./helpers/customActor.js"
  },
  "bootstrap": "./helpers/PreProcess.js"
}

xeonarno avatar Oct 08 '18 09:10 xeonarno

@xeonarno, run-multiple does not use multiCapabilities section in helpers.Protractor It uses multple section. https://codecept.io/advanced/#multiple-browsers-execution

Protractor's multiCapabilties are not processed. You can try to use multiCapabilities with codeceptjs run. Maybe, it will work.

elukoyanov avatar Oct 29 '18 15:10 elukoyanov