Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

selenium-page-object-generator

rickypc6.1kAGPL-3.01.3.1

A nimble and flexible Selenium Page Object Model generator to improve agile testing process velocity.

Selenium, PageObject, Model, Page, Object, POM, Generator, Agile, Testing, Velocity, Flexible, Nimble, Java, C#, RobotFramework, Robot, Framework, PageFactory, Factory

readme

Install from Chrome Web Store Install from Opera Addons Catalog

Selenium Page Object Generator

A nimble and flexible Selenium Page Object Model generator to improve agile testing process velocity.

Selenium Page Object Generator is an essential tool to improve your workflow. It will generate Page Object Model on active Chrome or Opera tab with a single click, provided that all of the options and template are configured. The generated Page Object Model will be saved to pre-configured Chrome or Opera download folder.

Selenium Page Object Generator is also available in command line by installing Node.JS package from NPM Registry.

The template is using Handlebars.js expression, a clean logic-less semantic templating language.

This is an early BETA release, it expected to have rough edges, and limited functionality. It currently support 3 different targets: Java, C#, and Robot Framework.

For more information on how to use the generated Page Object file:

Java: https://code.google.com/p/selenium/wiki/PageFactory#The

C#: http://relevantcodes.com/pageobjects-and-pagefactory-design-patterns-in-selenium/#post-5229

Robot Framework: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#taking-resource-files-into-use

(You need to use Chrome 40+ or Opera 15+ or Node.JS 5.x to try this out)

Installation -

  • To install the newest released version on Chrome browser, please download it from Chrome web store.
  • To install the newest released version on Opera browser, please download it from Opera addons catalog.
  • To install the newest released version on command line, please install Node.js and run command below:
$ npm install selenium-page-object-generator

Command Line Usage - Selenium Page Object Generator accepts the following command line arguments:

selenium-page-object-generator [options]

  -h, --help                                 Show this help message and exit.
  -v, --version                              Show program's version number and exit.
  -t, --target {cs,java,robot}               Generator target
  -n, --name [PageName]                      Page name (no-spaces)
  -d, --destination [DestinationPageName]    Destination page name (no-spaces) (optional)
  -s, --source [source.html]                 Source file

Examples - To generate Java page object:

$ node_modules/.bin/selenium-page-object-generator -t java -n MySite -s source.html

Development Dependencies - You will need to install Node.js as a local development dependency. The npm package manager comes bundled with all recent releases of Node.js.

npm install will attempt to resolve any npm module dependencies that have been declared in the project’s package.json file, installing them into the node_modules folder.

$ npm install

Development - To build the sources into corresponding packages, run:

$ gulp

The /build folder and /dist folder are created. All built files are placed in the build folder, and the distribution ready packages are placed in dist folder.

Distribution - Once the changes are in-place and ready for distribution, update package.json with new version, and run:

$ gulp

The /dist folder will contain distribution ready packages.

Contributing - If you would like to contribute code to Selenium Page Object Generator project you can do so through GitHub by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. Please also include appropriate test cases.

Before your code can be accepted into the project you must also sign the Selenium Page Object Generator CLA (Individual Contributor License Agreement).

That's it! Thank you for your contribution!

License - Copyright (c) 2015, 2016 Richard Huang.

This browser extension is free software, licensed under: GNU Affero General Public License (AGPL-3.0).

Documentation and other similar content are provided under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Licenses and Acknowledgements for Incorporated Software -

Screenshot - screenshot

changelog

1.3.1 (2018.04.07)

  • Uses latest jQuery and Handlebars library
  • Uses jsdom old API

1.3.0 (2018.04.07)

  • Replaces deprecated GLOBAL to global in the specs
  • Adjust the spy call counting in the specs
  • Bugfixes on textContent is not a valid string Thanks to @jeshan
  • Bugfixes on default gulp task is not build anything Thanks to @jeshan
  • Add gitlab-ci config Thanks to @jeshan
  • Bugfixes on invalid C# / Java variable name literals Thanks to @jeshan
  • Bugfixes on trim whitespaces on value Thanks to @jeshan and @bartonhammond
  • Fixes potential security vulnerabilities by using latest version of dependencies
  • Bugfixes on invalid selector
  • Uses Chrome API for download and adjust permissions requirement
  • Display current extension version on the popup

1.2.10 (2016.12.28)

  • Bugfixes on issue #14. Thanks to @jpvantuyl

1.2.9 (2016.03.06)

  • Bugfixes on issue #7

1.2.8 (2016.01.31)

  • Bugfixes on issue #6

1.2.7 (2016.01.19)

  • Update copyright year
  • Cleanups

1.2.6 (2016.01.19)

  • Bugfixes
  • Add executable for offline support via Node.JS
  • Restructure the files between common and browser specific functionalities
  • Update dependencies
  • Adjust the tests
  • Add DOM tree walker polyfill

1.2.5 (2015.09.22)

  • Bugfixes on issue #3

1.2.4 (2015.08.28)

  • Bugfixes
  • Update readme file

1.2.3 (2015.08.25)

  • Bugfixes
  • Add Opera support
  • Update unit tests

1.2.2 (2015.08.15)

  • Employ more strategies to get label text
  • Remove redundant equal sign in Robot Framework template
  • Bug fixes and follow static analysis results
  • Add more unit tests

1.2.1 (2015.07.30)

  • Add rating link in share section
  • Popup will open in the middle of the screen
  • Generate button stay disabled on hover
  • Bug fixes and follow static analysis results
  • Add initial unit tests

1.2.0 (2015.07.19)

  • Consider node attribute as a possible element selector
  • HTML decode attribute value
  • Add message listener once
  • Allow longer text in the documentation
  • Add radio button value in attribute collection
  • Remove radio button argument from operation
  • Templates adjustment
  • Add fallback mechanism for Options button
  • Code restructure

1.1.2 (2015.07.16)

  • Employ better and broader mechanism to get label text

1.1.1 (2015.07.14)

  • Cancel default action on Options button click
  • Rearrange object deep copy to die gracefully
  • Use more specific CSS selector base on siblings and element type
  • Consider element value for input button and submit for label text
  • Adjust wording for root selector

1.1.0 (2015.07.04)

  • Change default visibility to all (visible and hidden elements)
  • Add textarea support
  • Add support for email, number, search, tel, and url input type
  • Add different approach to get element text more reliably
  • Add support for label without identifier
  • Add support for prefixed element type
  • Add restore to factory settings
  • Add AngularJS locators option for test framework that has support for it
  • Add option to limit the page area that one would like to generate from
  • Fix page object namespace that get dropped off from file name and generated page object
  • Robot Framework template adjustments
  • Add more documentation on generated page object for class instance return
  • Fix C# XML documentation format

1.0.5 (2015.06.29)

  • Fixed page name initial validation
  • Faster popup load

1.0.4 (2015.06.28)

  • Responsive layout adjustment
  • Swapped "Options" and "Settings" wording
  • Page name validation will be run on popup load, this will make Page Name more obvious as a required field
  • Mail sharer now support both native mail client and web-based client

1.0.3 (2015.06.25)

  • Changed wording for "Model Name" to "Page Name"
  • Changed wording for "Target Name" to "Destination Page Name"
  • Changed wording for "More Options" link to "Settings" button
  • Added share via email

1.0.2 (2015.06.24)

  • Validate text visibility with viewport consideration
  • Remove redundant information from generated CSS selector
  • Removed all special characters from variable and method name
  • Cleanups
  • Bug fixes

1.0.1 (2015.06.23)

  • Initial product launch