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

elementor

v2.1.0

Published

Elementor allows you test locators against a live Protractor session by entering them directly into Chrome or your IDE.

Downloads

273

Readme

Protractor logo elementor

Elementor lets you test Protractor selectors from your browser and IDE. You can enter a protractor locator or expression and elementor will test it against a live protractor instance.

Video tutorial

Elementor video

Get elementor

Elementor is a Node.js application. Install it through npm:

$ npm install elementor -g

How to launch

Elementor needs chromedriver and a running selenium server. To download the dependencies and start the selenium server you need to use protractor's webdriver manager. Open your terminal and run the following commands:

# Get protractor
$ npm install protractor -g

# Download chromedriver and the selenium server
$ webdriver-manager update

# Start the server
$ webdriver-manager start

In another terminal run elementor with an optional url:

$ elementor https://angularjs.org

If you need to pass flags to chrome use the --chrome flag. Use spaces to separate the flags.

$ elementor https://angularjs.org --chrome="--disable-web-security --some-other-flag=123"

For applications not using Angular, just add the --nonAngular flag:

$ elementor https://google.com --nonAngular

How it works

Elementor extends protractor's elementexplorer in two ways:

  • It opens a server on port 13000 that listens for commands.
  • It launches chrome with a custom extension that lets you test on the browser.

Elementor architecture

The extension includes two components:

  • A popup to enter protractor locators and expressions.
  • A developer tools window to suggest locators for the selected element.

Using the popup

The popup is located next to the omnibox. Open it, enter a locator or an expression, and hit ENTER. The input will be evaluated by elementor and the results will be displayed on the popup menu.

When you enter a locator starting with by.<strategy> (e.g. by.css, by.model, by.binding, etc.) then it will be executed as a count expression element.all(<your locator>).count(). For example:

by.css('div') will be evaluated as element(by.css('div')).count()

You can also enter commands:

  • browser.get('http://protractortest.org')
  • element(by.css('.some-class')).getText()
  • element(by.binding('someBinding')).sendKeys('hello')

elementor popup

Using the developer tools

The developer tools extension tries to find protractor locators for the currently selected item. Go to Developer tools > Elements and then on the side pane (Styles, Computed, etc.) choose protractor.

open developer tools

The DevTools extension is limited because you cannot use it in the same browser tab launched by the elementor. To use the extension you need to duplicate the first tab of the browser (right click on tab > duplicate). Once the dev tools in the second tab is open then it will provide locator suggestions every time you change the selected element in the elements tab.

dev tools

When you open the DevTools window, ChromeDriver is automatically disconnected. When ChromeDriver receives a command, if disconnected, it will attempt to close the DevTools window and reconnect. source.

Using the Webstorm / IntelliJ plugin

You can use elementor from your IDE with Webstorm or IntelliJ. Follow the installation instructions here.

idea plugin

Using the Sublime plugin

A sublime plugin is available. Follow the installation here.

sublime plugin

Using the Emacs plugin

There is also an emacs plugin available here. Installation instructions are in the plugin's README.

emacs plugin