1.0.8 • Published 6 years ago

orange-peel v1.0.8

Weekly downloads
10
License
ISC
Repository
-
Last release
6 years ago

orange-peel

UNIFNISHED -- this package and the following instructions are still WIP.

An end-to-end testing framework utilizing Selenium Webdriver

A demo of this package can be found here

Setup

npm run setup will generate a minimal default config file (does nothing at the moment...)

Running locally

For each browser you intend to test with, be sure to download the appropriate webdriver.

If testing with IE, follow the instructions listed here.

Make sure each webdriver is in your PATH.

Running remotely

Make sure the remote server running your tests has the appropriate webdrivers on its PATH per the instructions above.

Download the Selenium Standalone Server here and run the jar: java -jar selenium-server-standalone-x.x.x.jar

Other 3rd party browser drivers can be found here under the heading "Third Party Drivers, Bindings, and Plugins."

Installing orange-peel

In your project, simply npm i orange-peel --save-dev

Usage

Simple test in Jasmine to ensure the app is running:

import { Browser, BrowserType } from 'orange-peel';

describe('Orange Peel demo', () => {

    let driver: Browser;

    beforeAll(() => {
        driver = new Browser(BrowserType.CHROME);               // create a browser instance for the given type
    });

    afterAll(() => {
        driver.quit();                                          // close the browser once tests are finished
    });


    it('should get the title from the home page', done => {
        driver.get('http://localhost:4200')                     // navigate to the given URL
            .then(() => {
                expect(true).toBeTruthy()
                done();
            });
    }, 60000);                                                  // ensure long timeout since tests might
                                                                // give up before the browser loads

});

Configuration

TBD...