npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dibellag-automation-framework

v1.2.1

Published

Protractor Cucumber framework using latest package versions

Downloads

8

Readme

dibellag-automation-framework

A protractor cucumber automation framework built using the latest versions of each. The goal is to display an automation framework with working examples of how to use these latest packages.

Awesome Commitizen friendly semantic-release Build Status

Dependencies

NOTE: This framework maybe usable on lower versions of node and npm. However, these are the versions this project was built and test with.

npm  ->  5.3.0
node ->  v8.4.0
java -> 8

Supported Browsers

| Browser | Description | Direct Connect | | ------- |:-----------:| --------------:| | Chrome | Works with most latest versions | Yes | | Chrome Headless | Latest couple versions | Yes | | Firefox | 56+ | Yes | | Safari | Needs latest version. Setup required: It can be turned on by opening Safari preferences (Safari > Preferences in the menu bar), going to the Advanced tab, and ensuring that the Show Develop menu in menu bar checkbox is checked. Enable Remote Automation in the Develop menu. This is toggled via Develop > Allow Remote Automation in the menu bar. | No |

Try it now

NOTES: This will run a set of example scenarios that are setup to outline the latest features of cucumber and how to work it.

npm install
npm test

Available npm scripts

| npm script | description | defaults | | ------------- |:-------------:| --------:| | npm test | runs report cleanup as pretest, and runs protractor config | | npm run test:ci | runs tests on grid | --seleniumAddress=http://127.0.0.1:4444/wd/hub | | npm run test:elementExplorer | opens protractors elementExplorer, needs to be run after webdriver-manager has been started in a different tab | | npm run test:dry-run | runs cucumber dry run | --browserName chrome | | npm run test:unit | run framework unit tests | | npm run test:scripts:parallel | bash example of parallel | | npm run test:scripts:synchronous | bash example of synchronous | | npm run test:scripts:ignore-failure | bash example that ignore the firs task failure and runs second task | | npm run report:cleanup | deletes and recreates test/output directory | | npm run report:generate | runs and opens local html report | | npm run webdriver-manager:update | updates browser drivers | | npm run webdriver-manager:start | starts local webdriver server, to be run in a separate tab before running elementExplorer command | | npm run webdriver-manager:setup | will update and start webdriver server | | npm run lint | runs gherkin and eslint rules(including protractor) | | npm run lint:fix | fixes the lint rules that are able to be fixed automatically | | npm run lint:gherkin | runs just gherkin lint rules | | npm run lint:es | runs just eslint rules | | npm run commit | runs git cz to help format commits to follow semantic release |

Available cli flags

| cli flag | description | defaults | | ------------- |:-------------:| --------:| | --parallel-features | runs each feature with a new browser | | --parallel-scenarios | runs each scenarios with a new browser | | --maxSessions | controls how many browsers run at the same time. To be used with -p flag.| 1 | | --browserName | which browser to run the tests in, currently supports (chrome, chrome-headless, firefox, safari) | | --cucumberOpts.tags | supports a string tag expression | | --features | supports passing in a glob of features to run |

Linters

Resources

JSDOC ESLint Google

Lint rules have been setup based on eslint and google recommendations, along with gherkin and protractor lint rules.

The following lint tasks are available:

"lint": "(npm run lint:gherkin; npm run lint:es)",
"lint:fix": "eslint test/** --fix",
"lint:gherkin": "gherkin-lint",
"lint:es": "eslint test/**"

These are the protractor lint rules that will be turned on. Investigating why it throws error when there isnt a case for it.

TODO: Try adding back: "plugin:protractor/recommended" in the extends, and find out why each rule needs protractor/ in front of it to work.

Settings for protractor rules:

2 - error
1 - warning
0 - off

How to use protractor's elementExplorer

  1. Run the below command in one terminal tab
npm run webdriver-manager:setup

This will update webdriver-manager and start it

  1. Run the below command in a second terminal tab
npm run test:elementExplorer
  1. Testing selectors
You can now navigate to any url and run protractor 
commands to test your selectors and functions.

Bash cli differences

  1. How to run a task one after the other regardless if the first one passes
npm run test:scripts:ignore-failure
  1. How to run tasks synchronously
npm run test:scripts:synchronous
  1. How to run tasks in parallel
npm run test:scripts:parallel

See example of parallel execution in ./test/scripts/parallel.sh

Add a script to the scripts directory

After adding a script to the scripts directory you needs to run the following command to make it executable:

chmod +x fileName

Running tests in parallel

In order to run each feature file with a new browser

npm test -- --parallel-features --browserName chrome

In order to run multiple features in parallel

npm test -- --parallel-features --browserName chrome --maxSessions 2

In order to run each scenario in a new brower

npm test -- --parallel-scenarios --browserName chrome

In order to run each scenario in parallel

npm test -- --parallel-scenarios --browserName chome --maxSessions 2

Pass the maxSessions flag with the number of features/scenarios you want to run in parallel.

Contributing

This project uses Commitizen to enforce Semantic Releases

TODOs

  1. Mock setup
  2. Fuctions for executing requests
  3. Custom reporter
  4. Cross browser support
  5. How to best handle non-angular websites
  6. Create test app to provide examples for the following test cases: 6.1. Angular app 6.2. Non Angular page 6.3. Modals 6.4. Iframes 6.5. New tabs

FAQ

The world instance isn't available in my hooks or step definitions.

This has frequently been caused by the use of ES6 arrow functions. You cannot use ES6 arrow functions for step definitions or hooks because they bind this to the current context which prevents the world instance from being injected.

Why do my definition patterns need to be globally unique instead of unique only within Given, When, Then?

To encourage a ubiquitous, non-ambiguous domain language. Using the same language to mean different things is basically the definition of ambiguous. If you have similar Given and Then patterns, try adding the work "should" to your Then pattern