gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Filter browsers for tests

Open vvscode opened this issue 7 years ago • 1 comments

When reporting a bug, make sure you provide all required info below. Reports without this information may be closed.

Output of gemini --version: "gemini": "5.0.0-alpha.12"

Contents of .gemini.yml file:

module.exports = {
  rootUrl: 'http://app.local.collectriumdev.com:5000',
  gridUrl: 'http://127.0.0.1:4444/wd/hub',
  tolerance: 30,
  windowSize: '1900x1440',

  screenshotsDir: './gemini/screens',
  compositeImage: true,
  screenshotMode: 'fullpage',

  retry: 1,

  browsers: {
    headless: {
      desiredCapabilities: {
        browserName: 'headless',
        chromeOptions: {
          args: ['disable-gpu', 'headless', 'no-sandbox'],
        },
      },
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        chromeOptions: {
          args: ['disable-gpu', 'no-sandbox'],
        },
      },
    },
  },

  sets: {
    apollo: {
      files: ['gemini/tests'],
    },
  },
};

Test source code:

 const gemini = new Gemini('.gemini.js');

  return gemini
    .readTests()
    .then(collection => {
      collection.disableAll();
      const list = collection.allSuites();

      const newList = [list[0]];
      const newCollection = new gemini.SuiteCollection([list[0]]);

      newList.forEach(suite =>
        newCollection.enable(suite, { browser: 'headless' })
      );

     // next one also doesn't work
     // return gemini.test(newCollection, {
     //     browsers: ['headless']
     // });

      return gemini.test(newCollection);
    })
    .then(data => console.log('Result', data))
    .catch(e => console.error('Error', e))
    .finally(() => chromedriver.stop());

Command used to run the test:

node runner.js

Result: I got chrome session in new window

Expected behaviour: Test runned only in headless mode

vvscode avatar Nov 15 '17 12:11 vvscode

And looks like part with partial suites also doesn't work - in example above I got all tests instead of only single one

vvscode avatar Nov 15 '17 12:11 vvscode