Coder Social home page Coder Social logo

nightwatch-coverage's Introduction

Hi there, great to see you!

I'm Dom. Check out my resume to find out more about me.

nightwatch-coverage's People

Contributors

aberonni avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

cactusbone

nightwatch-coverage's Issues

error while running "execute" command

Nightwatch conf.js :

var browserstack = require('browserstack-local');

nightwatch_config = {
  src_folders : [ "tests/local" ],

  selenium : {
    "start_process" : false,
    "host" : "hub-cloud.browserstack.com",
    "port" : 80
  },
  custom_commands_path: [
    'node_modules/nightwatch-coverage/commands',
  ],
  globals_path: "globals.js",
  test_settings: {
    default: {
      desiredCapabilities: {
        'build': 'nightwatch-browserstack',
        'browserstack.user': process.env.BROWSERSTACK_USERNAME || 'BROWSERSTACK_USERNAME',
        'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY || 'BROWSERSTACK_ACCESS_KEY',
        'browserstack.debug': true,
        'browserstack.local': true,
        'browser': 'chrome'
      }
    }
  }
};

// Code to copy seleniumhost/port into test settings
for(var i in nightwatch_config.test_settings){
  var config = nightwatch_config.test_settings[i];
  config['selenium_host'] = nightwatch_config.selenium.host;
  config['selenium_port'] = nightwatch_config.selenium.port;
}

module.exports = nightwatch_config;

Test local

module.exports = {
  'BrowserStack Local Testing' : function (browser) {
    browser
      .url('http://bs-local.com:45691/check')
      .waitForElementVisible('body', 1000)
      .assert.containsText('body', 'Up and running')
      .collectCoverage()
      //.end();
  }
};

image

coverageMap is not an instance when using multiple test suites

Using nightwatch '1.5.1' or '1.7.13', I was getting timeouts errors due to crash in afterEach (browser.globals.coverageReporter.coverageMap.merge undefined)

It seemed that coverageMap was a POJO when calling browser.collectCoverage (either during tests or during global afterEach).

to work around that, I set persist_globals to true, which did nothing, and ended up using a global beforeEach to restore the instance

        beforeEach(browser, done) {
            // fixes coverageMap not being the expected class instance
            browser.globals.coverageReporter.coverageMap = coverageReporter.coverageMap;
            done();
        },

I'm not too sure if that was expected to work out of the box, or is broken by some context, or if some version of nightwatch broke it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.