selenium-test-core

Make easy and simple a application selenium tests

Usage no npm install needed!

<script type="module">
  import seleniumTestCore from 'https://cdn.skypack.dev/selenium-test-core';
</script>

README

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