npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

esquadro

v1.5.9

Published

Protractor Helper

Downloads

3

Readme

Esquadro

This library is a Helper for Protractor Tests.

Usage


Esquadro is easy to use and is divided in two parts:

  • Page
  • Select

To install, execute the command:

 npm install esquadro --save-dev

PAGE

First part is the page, where methods to interact with browser are. See examples of how to use: First, import the module into your PageObject :

const page = require('esquadro/page');

After import, you can use page helpers. See this helpers bellow:

  • setValue
page.setValue(element, value, timeout)

This method receives an element, a value to set and a timeout (optional, default is 5000)

  • clickOn
page.clickOn(element, timeout)

The above method receives an element to click and a timeout (optional, default is 5000)

  • waitForElementPresenceInDOM
page.waitForElementPresenceInDOM(element, timeout)

The method above waits for an element to be present in them DOM and a timeout to wait (optional, default is 5000)

  • waitForElementNotPresenceInDOM
page.waitForElementNotPresenceInDOM(element, timeout)

The above method waits until element is NOT attached in them DOM and receives two parameters, the first is the element and second is a timeout to wait (optional, default is 5000)

  • waitForElementToBeClickable
page.waitForElementToBeClickable(element, timeout)

The above method waits for an element to click on and receives two parameters, the first is the element to click and second is a timeout to wait (optional, default is 5000)

  • waitForElementToBeVisible
page.waitForElementToBeVisible(element, timeout)

The above method waits for an element to be visible on and receives two parameters, the first is the element to click and second is a timeout to wait (optional, default is 5000)

  • waitForElementToBeInvisible
  page.waitForElementToBeInvisible(element, timeout)

The above method waits until the element is invisible and receives two parameters, the first is the element and second is a timeout to wait (optional, default is 5000)

  • waitAlterUrl
  page.waitAlterUrl(url, timeout)

The above method waits until the browser url is altered and receives two parameters, the first is the url and second is a timeout to wait (optional, default is 5000)

  • swicthDriverToOpenTab
  page.switchDriverToOpenTab(urlNewTab)

The above method switches webdriver to a new opened tab and receives the url for this new tab

page.returnDriverToMainTab()

The above method switches webdriver to then main tab

page.scrollPageTo(valuePixels)

The above method scrolls the page to a specified position

page.scrollTop()

The above method scrolls the page to the top

page.getScreenshot(nomeArquivo, pathScreenShot)

The above method takes a screenshot and save the file into a specified path


Select

The second part is the helper to interact with selected elements and choose options.

How to use: First, import the select module into your PageObject Class:

const Select = require('esquadro/select');

After import, create instance this module:

const selectType = new Select(element);

The constructor receives which element to manipulate

This helper has these methods bellow:

  • getOptions()

It returns all options in Select element

E.g.:

selectType.getOptions().then(function(options){
  options[1].getText().then(function(value){
    console.log(value);
  });
});

In this case, it returns text from the first element of the options in a selected element and prints this value

  • getOptionSelected()

It returns the option selected in the select element

E.g.:

  selectType.getOptionSelected().getText().then(function(value) {
    console.log(value);
  });

In this case, it returns text from the option selected in select element

  • selectByValue

The above method selects the option by the value of the select element

E.g.:

  selectType.selectByValue('fire');

In this case, it selects the option where value equals 'fire'

  • selectByVisibleText

The above method selects the option by visible text of the select element

E.g.:

  selectType.selectByVisibleText('FIRE');

In this case, it selects the option where your text equals 'FIRE'

  • selectByIndex

The above method selects the option by index in a list of options of the select element

E.g.:

  selectType.selectByIndex(2);

In this case, it selects the option where your index is 2, starting the count at 0