Demo Selenium JavaScript E2E tests (end-to-end web browser automation tests)

Overview

Demo of Selenium JavaScript E2E tests

Demonstration of Selenium JavaScript end-to-end tests, using a simple test runner script that calls test files.

Setup:

node install

Syntax:

./test.js

Example using a typical top level project directory:

./test/e2e/test.js

Environment variables:

  • PORT: the base port number for opening browsers; default is 10000

Repository organization

This repository has three essential areas:

  • test.js is the test runner that reads individual test files

  • test_*.js are the individual test files for end-to-end tests

  • support.js has helpers and utilties for launching browsers

What this script does

This script reads its directory to find test files to require; test files must have names that begin with "test_" and end with ".js".

For each test file, this script launches a new driver, in parallel, then calls the test file's function test(…) with this signature:

module.exports = async function test(index) 

Example test file:

const support = require('./support')
const assert = require('assert')
const {By, Key} = require('selenium-webdriver')

module.exports = async function test(index){

    // Launch a web browser
    let driver = await support.makeDriver()

    // Go to a web page
    await driver.get("https://example.com")

    // Verify the headline
    let headline = await driver.findElement(By.tagName("h1")).getText()
    assert.equal(headline, "Example search page")

    // Find the search box, then type "kittens", then press return.
    await driver.findElement(By.name("q")).sendKeys("kittens", Key.RETURN)

    // Is the results page title correct?
    let title = await driver.getTitle()
    assert.equal(title, "Example results for kittens")

}

Install

Install Node and NPM as usual.

If you need help with this, then see demo-selenium-javascript

Install Selenium and Google Chrome Driver

Install Selenium WebDriver:

npm install --save selenium-webdriver

Install Google Chrome driver:

npm install --save chromedriver

Install helpful Node utilities

Recursive read directory with streams:

npm install --save readdirp

Construct pipes of streams of events:

npm install --save event-stream

Run

Run:

./test.js

Or you can run with Node explicity:

node test.js

Tracking

  • Package: demo-selenium-javasript-e2-e-tests
  • Version: 2.0.0
  • Created: 2019-11-02T00:00:00Z
  • Updated: 2021-10-08T00:19:55Z
  • License: GPL-2.0-or-greater or for custom license contact us
  • Contact: Joel Parker Henderson ([email protected])
You might also like...

Delightful JavaScript Testing.

Delightful JavaScript Testing.

🃏 Delightful JavaScript Testing 👩🏻‍💻 Developer Ready: A comprehensive JavaScript testing solution. Works out of the box for most JavaScript projec

Jan 4, 2023

A demo for E2E build piplelines in Design Systems using monorepo's and automation :zap:.

A demo for E2E build piplelines in Design Systems using monorepo's and automation :zap:.

Design System Pipelines demo What is it? A working demonstration for end-to-end build piplelines in Design Systems using Primer Primitives, Primer CSS

Oct 20, 2022

Automagically bypass hcaptcha challenges with http api, with puppeteer, selenium, playwright browser automation scripts to bypass hCaptcha programmatically

Automagically bypass hcaptcha challenges with http api, with puppeteer, selenium, playwright browser automation scripts to bypass hCaptcha programmatically. For help you can message on discord server with the bellow link. You can also create an issue.

Jan 2, 2023

Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Jan 1, 2022

Metamask replacement for your E2E tests.

Headless Web3 Provider Metamask replacement for your E2E tests. Why "headless"? Because it doesn't have a visual interface, reject (or accept) transac

Dec 13, 2022

A new generation GUI automation framework for Web and Desktop Application Testing and Automation.

A new generation GUI automation framework for Web and Desktop Application Testing and Automation.

Clicknium-docs Clicknium is a new generation GUI automation framework for all types of applications. It provides easy and smooth developer experience

Dec 19, 2022

SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

Oct 24, 2022

A system for sharing tests between students. In RepoProvas anyone can look up old tests for their subjects and teachers or send old tests to help other students!

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

May 10, 2022

YouTube Playlist Downloader ▶. It is powered by loader.to with Selenium 4 and Microsoft Edge.

YouTube Playlist Downloader ▶. It is powered by loader.to with Selenium 4 and Microsoft Edge.

Mar 4, 2022

No-code test automation solution for end-to-end testing

No-code test automation solution for end-to-end testing

No-code test automation tool for end-to-end testing Table of Contents About Features Installation Usage Creating tests Running tests Roadmap Our Team

Oct 18, 2022

E2E test framework for Angular apps

Protractor Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor is a Node.js program built on top of WebDrive

Jan 2, 2023

React.js todo app with authorization, Testing: Cypress(e2e), UI (Chakra UI), Eslint, prettier, git hooks

React TypeScript template with Vite This is a React + TypeScript boilerplate built with Vite. What's inside? ReactJS Vite TypeScript Jest Testing Libr

Jan 28, 2022

Next.js website for E2E

Prérequis git (obviously) node = 14 avec npm Sur MacOS ou Linux, je suggère fortement d'utiliser Node.js Version Manager afin de simplifier l'install

Feb 15, 2022

A small utility server to exchange data and messages between clients. Comes complete with E2E public key encryption

Zenotta Intercom A small utility server to exchange arbitrary data between clients. Comes complete with E2E public key encryption Official documentati

Oct 2, 2022

A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Oct 31, 2022

Nftix-demo-ui - Demo UI used in my NFT course on Egghead.io

NFTix Demo UI This repository contains the UI used for my Egghead course on building a NFT ticketing system 🥚 🤓 If you're watching the videos, use t

Dec 17, 2022

Access the internals of React components from Cypress end-to-end tests

cypress-react-app-actions Access the internals of React components from Cypress end-to-end tests Read Access React Components From Cypress E2E Tests a

May 12, 2022
Owner
Joel Parker Henderson
Software developer and technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.
Joel Parker Henderson
E2E test framework for Angular apps

Protractor Protractor is an end-to-end test framework for Angular and AngularJS applications. Protractor is a Node.js program built on top of WebDrive

Angular 8.8k Jan 2, 2023
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

?? Playwright Documentation | API reference Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit w

Microsoft 46.3k Jan 9, 2023
A Node.js tool to automate end-to-end web testing.

A Node.js tool to automate end-to-end web testing. Write tests in JS or TypeScript, run them and view results. Homepage • Documentation • FAQ • Suppor

Developer Express Inc. 9.5k Jan 9, 2023
Generate a big amount of tests

Generate a big amount of tests This repo was created for jest learning purposes. It aims to generate a big amount of tests (based in a template) to ve

Ricardo Montuan 2 Feb 17, 2022
A single tab web browser built with puppeteer. Also, no client-side JS. Viewport is streamed with MJPEG. For realz.

:tophat: A single tab web browser built with puppeteer. Also, no client-side JS. Viewport is streamed with MJPEG. For realz.

Cris 23 Dec 23, 2022
blanket.js is a simple code coverage library for javascript. Designed to be easy to install and use, for both browser and nodejs.

Blanket.js A seamless JavaScript code coverage library. FYI: Please note that this repo is not actively maintained If you're looking for a more active

Alex Seville 1.4k Dec 16, 2022
☕️ simple, flexible, fun javascript test framework for node.js & the browser

☕️ Simple, flexible, fun JavaScript test framework for Node.js & The Browser ☕️ Links Documentation Release Notes / History / Changes Code of Conduct

Mocha 21.8k Dec 30, 2022
JSCover is a JavaScript Code Coverage Tool that measures line, branch and function coverage

JSCover - A JavaScript code coverage measurement tool. JSCover is an easy-to-use JavaScript code coverage measuring tool. It is an enhanced version of

null 392 Nov 20, 2022
Simple JavaScript testing framework for browsers and node.js

A JavaScript Testing Framework Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any Ja

Jasmine 15.5k Jan 2, 2023
🔮 An easy-to-use JavaScript unit testing framework.

QUnit - A JavaScript Unit Testing Framework. QUnit is a powerful, easy-to-use, JavaScript unit testing framework. It's used by the jQuery project to t

QUnit 4k Jan 2, 2023