{"library":"mocha-nightwatch","title":"Mocha Adapter for Nightwatch.js","description":"The `mocha-nightwatch` package serves as an adapter, enabling the use of Mocha's familiar BDD/TDD syntax, such as `describe` and `it`, within the Nightwatch.js end-to-end testing framework. This allows developers to structure their Nightwatch tests using Mocha's expressive assertion style and test organization patterns. The package is currently at version 3.2.2. However, it is important to note that this adapter has not been updated in over five years, with its last publication in October 2019. It relies on significantly older versions of its core dependencies, specifically Mocha (~3.2.0) and Nightwatch.js (~0.9.12). Consequently, its release cadence is non-existent, and it is incompatible with modern versions of Node.js, Nightwatch.js (v1.x, v2.x, v3.x+), and Mocha (v4.x+). Key differentiators, at the time of its relevance, included bridging two popular testing paradigms for browser automation, but its abandonment makes it unsuitable for current development.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install mocha-nightwatch"],"cli":null},"imports":["/* Used globally or implicitly by Mocha test runner */","/* Used globally or implicitly by Mocha test runner */","/* Injected as a parameter into test functions */"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// nightwatch.conf.js\nconst chromedriver = require('chromedriver');\n\nmodule.exports = {\n  src_folders: [\"test\"],\n  output_folder: \"reports\",\n  globals_path: \"globals.js\",\n\n  test_runner: {\n    type: \"mocha\",\n    options: {\n      ui: \"bdd\",\n      reporter: \"spec\",\n      timeout: \"60000\"\n    }\n  },\n\n  webdriver: {\n    start_process: true,\n    port: 9515,\n    server_path: chromedriver.path, // Requires 'chromedriver' package\n    cli_args: [\n      \"--verbose\"\n    ]\n  },\n\n  test_settings: {\n    default: {\n      launch_url: \"http://localhost\",\n      desiredCapabilities: {\n        browserName: \"chrome\",\n        javascriptEnabled: true,\n        acceptSslCerts: true,\n        chromeOptions: {\n          args: [\"--headless\"]\n        }\n      }\n    }\n  }\n};\n\n// test/example.spec.js\n\ndescribe('Google Homepage Test', function() {\n  it('should have a title', function(browser) {\n    browser\n      .url('https://www.google.com')\n      .waitForElementVisible('body', 1000)\n      .assert.titleContains('Google')\n      .end();\n  });\n\n  it('should find the search input', function(browser) {\n    browser\n      .url('https://www.google.com')\n      .waitForElementVisible('input[name=\"q\"]', 1000)\n      .assert.elementPresent('input[name=\"q\"]')\n      .end();\n  });\n});\n","lang":"javascript","description":"Demonstrates how to configure Nightwatch.js to use Mocha as its test runner and write a basic end-to-end test. Ensure 'chromedriver' and 'nightwatch@~0.9.12' are installed.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}