Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protractor-tools

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protractor-tools

Collection of helper functions for protractor e2e test

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

protractor-tools npm version MIT license

A typescript rewrite of sg-protractor-tools utility library

Build Status dependencies Status devDependencies Status Greenkeeper badge PRs Welcome Codacy Badge

This library provides a reusable and generic set of helper functions for the Protractor test framework. It includes functions that simplify things like browser resizing, scrolling and memory usage tracking as part of a test suite. The project bundles an example application that showcases the functionality.

While using Protractor for testing our Angular-based applications, we have found that we can simplify many of the common tasks done as part of part of our test suite. The Protractor API is fairly low-level in some cases, and we have seen that we can cut down the amount of code for some common tasks by externalizing functionality into a reusable library.

Installing / Getting started

npm install -D protractor-tools

Install the library as a development dependency using the node package manager of your choice.

Usage

Import the required util classes in your *.e2e-spec.ts files.

import { ResizeUtil } from 'protractor-tools';

describe('Resizing demo App', () => {
      it('should resize the browser window a little', () => {
        // ...
        resizeUtil.setWindowSize(1303, 876);
        // ...
      });
});

Features

The following utility classes are currently available

  • ConsoleUtil (retrieve console logs and convenience methods to ensure your app didn't produce console errors)
  • DomUtil (wait for dom elements to become visible or invisible)
  • MemoryUtil (execute an action multiple times and track the memory footprint of the app)
  • MouseUtil (drag and drop functionality)
  • ResizeUtil (get and set the browser window and viewport size)
  • ScrollUtil (scroll to a element, scroll to a coordinate/position or scroll by a number of pixels)

You may refer to the source code of the util classes for usage details or the forked library documentation for more information about the reason for the utility classes.

Licensing

The code in this project is licensed under MIT license.

FAQs

Package last updated on 06 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc