0.12.2 • Published 5 years ago

protractor-cucumber-boilerplate v0.12.2

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

How to run

  • gulp test --env dev --tags "@debug"

Page Objects

##Page Map

const AbstractPageMap = require("protractor-boilerplate").AbstractPageMap;
const LoginPage = require("./page/LoginPage");

class PageMap extends AbstractPageMap {

    constructor() {
        super();

        this.definePage("Login", "^.+))$", LoginPage);

    }

}

###Methods

  • definePage
parammandatorydescription
aliasMalias of the page
regexpMregexp of URL to determine page
clazzMpage class

##Page

const Page = require("protractor-boilerplate").AbstractPage;
const CustomComponent = require("./CustomComponent");

class CustomPage extends Page {

    constructor() {
        super();

        this.defineComponent("Custom Component", new CustomComponent());
        this.defineElement("Custom Element", "h3");
        this.defineCollection("Custom Collection", "h3.button");
    }

}

###Methods

  • defineComponent
parammandatorydescription
aliasMalias of the component
componentMcomponent object
  • defineElement
parammandatorydescription
aliasMalias of the component
selectorMcss selector of element
  • defineCollection
parammandatorydescription
aliasMalias of the component
selectorMcss selector of element

##Component

const Component = require("protractor-boilerplate").Component;

class CustomComponent extends Component {

    constructor(alias = "Dashboard", selector = ".div", isCollection = false) {
        super(alias, selector, isCollection);

        this.defineComponent("Custom Component", new CustomComponent());
        this.defineElement("Custom Element", "h3");
        this.defineCollection("Custom Collection", "h3.button");
    }

}

###Methods

  • constructor
parammandatorydescription
aliasMalias of the component
selectorMcss selector of element
isCollectionMisCollection flag
  • defineComponent
parammandatorydescription
aliasMalias of the component
componentMcomponent object
  • defineElement
parammandatorydescription
aliasMalias of the component
selectorMcss selector of element
  • defineCollection
parammandatorydescription
aliasMalias of the component
selectorMcss selector of element

Memory

##Memory

const Memory = require("protractor-boilerplate").Memory;

defineSupportCode(({setDefaultTimeout, When}) => {

    When(/^I remember "(.+)" value as "(.+)"$/, (alias, key) => {
        const page = State.getPage();

        return page.getElement(alias).getText()
            .then((text) => {
                Memory.setValue(key, text);
            })
    });
}

###Methods

  • setValue
parammandatorydescription
keyMkey of stored item
valueMvalue of stored item
  • parseValue returns value by provided key, otherwise returns key
parammandatorydescription
valueMa key or simple value
0.12.2

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.6

6 years ago

0.10.5

6 years ago

0.10.4

6 years ago

0.10.3

6 years ago

0.10.2

6 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.1

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago