Skip to content

bezzad/WebUITestSample

Repository files navigation

Web UI Test Sample

A test for web UI by js libraries

This UI Test based on protractor and puppeteer.

How to use Protractor

  1. install Node.js
  2. install Python 2.7 on the PATH
  3. install Java Development Kit (JDK) on the PATH to run the standalone Selenium Server
  4. run $ npm install -g protractor
  5. run $ webdriver-manager update
  6. run $ webdriver-manager start - to run server on port 4444
  7. Now create the configuration file. Copy the following into conf.js:
// conf.js
exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['spec.js']
}

This configuration tells Protractor where your test files (specs) are, and where to talk to your Selenium Server (seleniumAddress). It specifies that we will be using Jasmine for the test framework. It will use the defaults for all other configuration. Chrome is the default browser.

Now run the test with:

$ cd protractor-example
$ protractor conf.js

For more information use this helpful link.

How to use Puppeteer

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.

  1. install Node.js
  2. run $ npm install or $ npm i puppeteer

Now run the test with:

  1. run $ cd puppeteer-example
  2. run $ node example.js

Releases

No releases published

Packages

No packages published