Code Monkey home page Code Monkey logo

pageobject-generator's People

Contributors

akosbordas avatar sawo avatar szmeti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pageobject-generator's Issues

by.options locator is used incorrectly

We have an NgOptionsLocatorStrategy that matches on ng-options. At the moment we use this to generate a selector for the select, but Protractor returns the nested options if by.options is used. Because of this all of the generated methods are incorrect (our methods assume they work with the select tag).

For now, I have removed this locator strategy from the config. We need to test the generated methods with a Protractor test and adjust if necessary.

Global configuration of settings

Currently you can only change the settings for the currently selected element. It would be nice to change the settings of alle elements globally at once. So I don't have to walk through my 3, 40, 100?! elements and dis-/enable the settings.

Support both in PO assertions and out of PO assertions via helper methods

Hi,

You should not be doing expectations in a page object. That's defeating the purpose of a page object and somewhat bad practice. I saw the generation of the simple example on the website here:

var UnnamedPageObject = function() {

    this.get = function() {
        browser.get('');
    };

    this.a0 = element(by.css('a.a'));

    this.clickA0 = function() {
        this.a0.click();
    };

    this.a0ShouldBeVisible = function() {
        expect(this.a0.isDisplayed()).toBeTruthy();
    };

    this.a0ShouldNotBeVisible = function() {
        expect(this.a0.isDisplayed()).toBeFalsy();
    };

    this.a0ShouldHaveClass = function(className) {
        this.a0.getAttribute('class').then(function(classes) {
            expect(classes.split(' ').indexOf(className) !== -1).toBeTruthy();
        });
    };

    this.a0ShouldNotHaveClass = function(className) {
        this.a0.getAttribute('class').then(function(classes) {
            expect(classes.split(' ').indexOf(className) === -1).toBeTruthy();
        });
    };

};
module.exports = new UnnamedPageObject();

The expectations are typically something you should do in your test file. Not in a helper class. This beats the purpose of seperation of concern.

All that aside, very nice project! :)
Please keep on updating/improving!

Grtz!

Locator strings are not escaped

When the locator is generated by an expression which contains string, the single quotes doesn't get escaped. eg.:

                                <label class="control-label">
                                    <i class="fa fa-calendar"></i>
                                    {{'messages.createdFrom' | translate}}
                                </label>

This will generate the following property:

this.messagesCreatedFrom = element(by.exactBinding(''messages.createdFrom' | translate'));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.