appmodel-protractor

1.1.0-rc3 • Public • Published

appmodel-protractor

appmodel-protractor provides application modeling support for Selenium based test frameworks. This will benefit in smaller pageObjects with more scalability.

Benefits

  1. Reduce footprint of pageObjects.
  2. Promote scalability of pageObjects across different test frameworks (e.g. programming languages).
  3. Separate data from functions.
  4. Easily add requirements while defining pageObjects vs. managing (coding) assertions at the test-script level.
  5. No impacts to existing test frameworks - an alternative/optional/hybrid test library for Selenium/WebDriverJs based frameworks.
  6. Minimize the time to delivery by using simple, yet powerful, commands vs. having to learn the inner details of protractor.

Development

Install

npm install

Build

npm run build

Unit Tests

npm test

Commands

Type into Element

  1. type() Returns true/false.
  2. asyncType() Returns the value of the element after the sendKeys().
  3. Working with Alerts
                describe('Verify Alert', () => {
    
                  let expectedAlert;
    
                  beforeAll(() => {
                    expectedAlert = cmdMgr.getAlert();
                  });
    
                  it('should display alert', () => {
                    expect(expectedAlert.exists()).to.be.true;
                  })
    
                  it('should ',  (done) => {
    
                      expectedAlert.getText().then((s) => {
                          console.log("Alert text: " + s);
                          done();
                      })
                  });
    
                })
    

How to use appmodel-protractor in your existing Protractor tests.

  1. npm install --save-dev appmodel-protractor
  2. Create model files (using JSON format).
  3. Test (or spec) file a. Add dependency:
let AppModelMgr = require('appmodel-protractor');

a. Create an instance of AppModelMgr and load your model files.

let appMgr = AppModelMgr.createMgr("My Auto Tests");
appMgr.load('./myModelFiles/login.page.json');
appMgr.load('/project/Elvis/graceland.json');

Modeling

visible_when

Package Sidebar

Install

npm i appmodel-protractor

Weekly Downloads

2

Version

1.1.0-rc3

License

ISC

Last publish

Collaborators

  • h20dragon