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

ngpo-ui-select

v2.0.0

Published

AngularJS Protractor page object for angular-ui ui-select widget using ngpo template

Downloads

16

Readme

ngpo-ui-select

Create page objects with helper functions for AngularJs Protractor tests for angular-ui ui-select using ngpo.

  • makeUiSelectPo returns a protractor element that has these methods (all other Protractor methods are available and not impacted)
    • enterValue
    • getValue
    • clear
    • isVisible - true if both isPresent and isDisplayed
  • makeUiSelectMultiPo returns a protractor element that has these methods (all other Protractor methods are available and not impacted)
    • enterValue
    • getValue - Gets string with all values; suggest expect(...).toContain();
    • clear
    • isVisible - true if both isPresent and isDisplayed
  • makePos passthrough for ngpo makePos function

ngpo-ui-select v2.x: requires nodejs 6.x or greater (no breaking api changes from ngpo-ui-select v1.x). Tested with angularJs 1.5.0, angular-ui-select 0.19, Protractor 5.1.2, chromedriver 2.31.

ngpo-ui-select v1.x: Tested with Protractor versions 2.5 and 5.1.

Examples

Page Object file using ngpo template

// person.po.js
var ngpoUis = require('ngpo-ui-select'); 

var els = {
  personInput: {
    locator: by.model('person.selected'),
    po: ngpoUiSelect.makeUiSelectPo},
  colorsInput: {
    locator: by.model('multipleDemo.colors'),
    po: ngpoUiSelect.makeUiSelectMultiPo}    
};

var pos = ngpoUis.makePos(els); 

module.exports = pos; 

Protractor test:

var personPo = require('person.po.js');

describe('person', function() {

    it('should allow name to be selected and cleared', function() {
      browser.get('/');

      testPo.personInput.enterValue('Amalie'); 
      expect(testPo.personInput.getValue()).toBe('Amalie'); 

      testPo.personInput.clear(); 
      expect(testPo.personInput.getValue()).toBe(''); 

    });

    it('should colors (multiple) to be selected and cleared', function() {

      testPo.colorsInput.enterValue('Red');
      // getValue() on makeUiSelectMultiPo returns a string with all values
      expect(testPo.colorsInput.getValue()).toContain('Red'); 

      testPo.colorsInput.enterValue('Green'); 
      expect(testPo.colorsInput.getValue()).toContain('Red'); 
      expect(testPo.colorsInput.getValue()).toContain('Green'); 

      testPo.colorsInput.clear(); 
      expect(testPo.colorsInput.getValue()).toBe(''); 

    });

});

See test\test.js and test\test.po.js for more examples.