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

appmodel

v1.0.3-rc.2

Published

Application Modeling Framework

Downloads

14

Readme

Welcome to AppModel

appmodeljs provides application modeling support specific modeling your application components (including pages) for UI testing.

appmodel

Installation

npm install --save-dev appmodel

Basics

Create an application model with JSON format files

TBD

Leverage appmodel in your existing Protractor (Selenium-WebDriverJS) tests.

Selenium WebDriverJS, Protractor

appmodeljs provides support to Protractor - to generate By objects.

Constructor() and loading model files (JSON).


var AppModelMgr = require('appmodel');

/* Specify that we are using Protractor.
 * This will ensure that By.* objects are Protractor compliant.
 */
var mgr = AppModelMgr('Elvis App', true);  

// Load a series of our models (e.g. page objects) defined in JSON format files.
mgr.add('/mydata/login.json');
mgr.add('/mydata/main_nav.json');
mgr.add('/mydata/sidenav.json');

var protractor_locator = **mgr.locator('page(Login).get(userid)')**;

element(protractor_locator).sendKeys('Elvis');
..
..

highlight(locator)

    it('should highlight', (done) => {
          let appModel = AppModelMgr.createMgr("Test");
          appModel.load(dut);

          appModel.highlight('page(login).get(locale)', 'Red').then( (rc) => {
              expect(rc).toBe(true);
              done();
          })
    })

load

Load a modeling file (JSON) which includes generating their respective page objects.

```
const dut = process.cwd() + '/test/data/page.json';
let appModel = AppModelMgr.createMgr("Test");
appModel.load(dut);

```

selectBy - will be deprecated - use select()

  describe('AppModel - selection', () => {

    const dut = process.cwd() + '/test/data/page.json';

    it('should switch to polski', (done) => {
      let appModel = AppModelMgr.createMgr("Test");
       appModel.load(dut);

       appModel.selectBy('page(login).get(locale)', 
                         { by: 'value', 
                           description: '#selectLang>option[value="ja"]', 
                           from: '#selectLang>option[value="ja"]', 
                           value: 'ja'}).
          then( (rc) => { 
              expect(rc).toBe(true);
              done();
         });
    })
    
    ...

select

Selection from a select (or Dropdown) component by providing a locator, of the select/dropdown element, and the target select item.

  1. Select by text (String) ``` it('should select using text', (done) => { let appModel = AppModelMgr.createMgr("Test"); appModel.load(dut);

    appModel.select('page(login).get(locale)', 'Korean'). then( (rc) => { expect(rc).toBe(true); return rc; }).then(() => { setTimeout(function() { console.log("SLEEP"); done(); }, 5000); }); })
    ```

  2. Select by Value ``` it('should select with value', (done) => { let appModel = AppModelMgr.createMgr("Test"); appModel.load(dut);

         appModel.select('page(login).get(locale)', { by: 'value', value: 'VI' }).
         then( (rc) => {
             expect(rc).toBe(true);
             return rc;
         }).then(() => {
             setTimeout(function() { done(); }, 5000);
         });

    }) ```

  3. Select by Index

        it('should select with index', (done) => {
              let appModel = AppModelMgr.createMgr("Test");
              appModel.load(dut);
       
              appModel.select('page(login).get(locale)', { by: 'index', index: 10 }).
              then( (rc) => {
                  expect(rc).toBe(true);
                  return rc;
              }).then(() => {
                  setTimeout(function() { console.log("SLEEP"); done(); }, 5000);
              });
        })

For more details see GitHub Flavored Markdown.

Jekyll Themes

Your Pages site will use the layout and styles from the Jekyll theme you have selected in your repository settings. The name of this theme is saved in the Jekyll _config.yml configuration file.

Support or Contact for markup

Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.