1.1.8 • Published 5 years ago

protractor-components v1.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

protractor-components

Simple component builder for protractor projects

Installing

npm i protractor-components

API

Component

simple class that can get only the common things like getText, getAttribute, getCssValue, etc.

As protractor, all these common types return Promise

Component.prototype.root - root element that find when you call constructor(new keyword).

Collection

Collection like ElementArrayFinder, but you can use for await ... of syntax

Example

// reason.component.ts
import { Component } from 'protractor-components';
import { $ } from 'protractor';

export class Reason extends Component {
    constructor() {
        super($('.row.first .span4'));
    }
    getHeader() {
        return this.$('.text-display-1').getText();
    }

    getBody() {
        return this.$('.text-body').getText();
    }
}


// e2e.ts
import { $ } from 'protractor';
import { Reason } from './reason.component';

describe('...', () =>{
    it('...', async ()=>{
        const reason = new Reason();
        const header = awaitreason.getHeader();
        expect(typeof header).toBe('string';
    })
})

collection example

import { $$ } from 'protractor';
import { Collection } from 'protractor-components';

import { Reason } from './reason.component';

export class ReasonCollection extends Collection<Reason>{
    constructor(){
        super($$('.row.first .span4'), Reason);
    }
}

TODO

  • JSDoc from protractor for Component and Collection
  • more comprehensive types
  • more common components(Form, Selector, MultipleSelector, Checkbox, RadioButton, Input(color picker, range, date, upload) , Table)
  • add module protractor-components/common
  • [] add API for angular(window.ng.probe function) and react(resq library) components
1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago