TheBrainFamily / chimpy

Develop acceptance tests & end-to-end tests with realtime feedback.
https://thebrainfamily.github.io/chimpy
MIT License
52 stars 28 forks source link

Chrome is being tested even though browser=firefox #98

Open samhatoum opened 6 years ago

samhatoum commented 6 years ago

Issue by rsshilli Wednesday Sep 20, 2017 at 17:20 GMT Originally opened as https://github.com/xolvio/chimp/issues/651


Expected behaviour

In my chimp.js config file, when I set browser=firefox, I expect my tests to run using Firefox.

Actual behaviour

If you set a few Chrome options in the webdriverio section, even though browser=firefox, your tests will run on Chrome instead.

Exact steps to reproduce / repository that demonstrates the problem

Here's my chimp.js that runs the tests using Chrome:

module.exports = {
  path: "build/test/features",
  watchSource: "build/main/webapp/*.js,build/main/nodejs",
  showXolvioMessages: false,
  screenshotsOnError: true,
  screenshotsPath: "build/test/report/screenshots",
  captureAllStepScreenshots: true,
  jsonOutput: "build/test/report/testReport.json",
  browser: "firefox",
  webdriverio: {
    waitforTimeout: 30000,
    desiredCapabilities: {
      chromeOptions: {
        args: ["--window-size=1024,768", "--window-position=600,0"],
        prefs: {
          "credentials_enable_service": false,
          "profile": {
            "password_manager_enabled": false
          }
        }
      }
    }
  },
  seleniumStandaloneOptions: {
    // check for more recent versions of selenium here:
    // http://selenium-release.storage.googleapis.com/index.html
    version: '3.5.3',
    baseURL: 'https://selenium-release.storage.googleapis.com',
    drivers: {
      chrome: {
        // check for more recent versions of chrome driver here:
        // http://chromedriver.storage.googleapis.com/index.html
        version: '2.32',
        arch: process.arch,
        baseURL: 'https://chromedriver.storage.googleapis.com'
      },
      ie: {
        // check for more recent versions of internet explorer driver here:
        // http://selenium-release.storage.googleapis.com/index.html
        version: '2.50.0',
        arch: 'ia32',
        baseURL: 'https://selenium-release.storage.googleapis.com'
      },
      firefox: {
        // check for more recent versions of gecko  driver here:
        // https://github.com/mozilla/geckodriver/releases
        version: '0.19.0',
        arch: process.arch,
        baseURL: 'https://github.com/mozilla/geckodriver/releases/download'
      }
    }
  },
};
Version & tools:

Also try adding debug=true and things go really crazy. You'll get multiple windows running tests in parallel. Everything goes crazy with debug=true.

samhatoum commented 6 years ago

Comment by wuthiago Thursday Sep 21, 2017 at 14:36 GMT


Instead of using chimp.js config file to change the browser, you need to pass the tag --browser=firefox in your package.json file. Example: "e2e-firefox": "./node_modules/chimp/bin/chimp.js --browser=firefox --saveScreenshotsToDisk=false --saveScreenshotsToReport=true --screenshotsOnError=true -f pretty -f json:e2e/e2e.json",

samhatoum commented 6 years ago

Comment by rsshilli Thursday Sep 21, 2017 at 15:05 GMT


Yeah, that would work, but with the number of options we have set, it would become unmaintainable pretty quickly.

The solution I came up with was to have a chimp-base.js file along with a chimp-chrome.js and chimp-firefox.js files that inherit the base properties and add their own. I was really hoping to have one chimp.js file and pass --browser=firefox only when I wanted to run my tests on Firefox. Oh well.