A test for web UI by js libraries
This UI Test based on protractor and puppeteer.
How to use Protractor
- install Node.js
- install Python 2.7 on the PATH
- install Java Development Kit (JDK) on the PATH to run the standalone Selenium Server
- run
$ npm install -g protractor
- run
$ webdriver-manager update
- run
$ webdriver-manager start
- to run server on port 4444 - 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.
- install Node.js
- run
$ npm install
or$ npm i puppeteer
Now run the test with:
- run
$ cd puppeteer-example
- run
$ node example.js