Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.1 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.1 KB

selenium-test-core

NPM version Build Status

Test your application with selenium easily, without too much cofiguration and without having to install any drivers.

Installation

# Using npm
npm install --save selenium-test-core

Supported browsers

  • firefox
  • firefox:headless
  • chrome
  • chrome:headless
  • ie

Example

const {chooseUrlAndBrowser, takeScreenshot} = require('selenium-test-core');

(async() => {
    try {
        await chooseUrlAndBrowser(runTests);
    } catch (err) {
        process.exitCode = 1;
        console.log(err);
    }
})();

async function runTests(helpers) {
  await helpers.start();
  await takeScreenshot('welcome_page', helpers);

  // 2000 is the time to wait for closing the browser
  await helpers.close(2000);
}
# Using npm
npm start NAVIGATOR URL
# In headless
npm start NAVIGATOR:headless URL