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

testingui

v0.0.8

Published

UI Automation testing without writing code

Downloads

4

Readme

CodeSpecJS

Welcome to the CodeSpecJS. A Protractor and Cucumber.JS based framework that allow users to write UI Automation Tests without writing a single line of code.

Gherkin grammar is very popular among many BDD frameworks. CodeSpecJS is targeting to take it to the next level by eliminating the need to write code associated with the Gherkin grammar.

Key Feature

Getting Started

Step 1: Setting up the development environment

  1. You need to install NodeJs with NPM . You'll also need to install and configure Git .
  2. Latest version of Chrome

Step 2: Clone the project

git clone https://github.com/99xt/CodeSpecJS.git

Step 3: Install node packages

Step inside the project root folder and issue the following command to install node dependencies.

npm install

Step 4: Let's start writing our first UI Automation test

Under the "features" folder create a new file called "sample.feature". copy and paste the specification given below

Feature: As a user I want to test http://automationpractice.com so that I can search for t-shirts and blouses
    Scenario: Search for t-shirt
        Given Navigate to "http://automationpractice.com"
        And Wait for "Main search bar" with the "id" of "search_query_top" to appear
        Then I enter "t-shirt" to the "Main search bar"
        And Click on "Search Button" with the "xpath" of "id('searchbox')/button"
        And Wait for "First Result Element" with the "xpath" of "id('center_column')/ul/li/div/div[2]/h5/a" to contain text "Faded Short Sleeve T-shirts"
         
    Scenario: Search for blouse
        Given Navigate to "http://automationpractice.com"
        And Wait for "Main search bar" to appear
        Then I enter "Blouse" to the "Main search bar"
        And Click on "Search Button"
        And Wait for "First Result Element" to contain text "Blouse"
  • The first scenario "Search for t-shirt" is using what we call the CodeSpecJS Detailed Grammar (Ex: And Wait for "Main search bar" with the "id" of "search_query_top" to appear). Here, we are instructing CodeSpecJS to look for an UI element in the DOM model with an "id" value of "search_query_top" and to add it to the system object repository with a unique identifier "Search for t-shirt".
  • Once we specify a page object using the detailed grammar, we can refer to it directly using the element key (or the unique identifier) for all the future tests.
  • Note that detailed grammar is only necessary if you don't specify the page objects using an object repository. Click here to know more about how to create object repositories.
  • This is a standard Cucumber feature specification file.
  • We are using CodeSpecJS pre-defined grammar to write the test above. A full set of Supported grammar with detail description can be found here

Thats it, you are now ready to run the test. Note that we haven't written any code We just used a set of well defined Gherkin grammar to specify what we want to do. Please refer to Supported Grammar to a full set of grammar you can use in your tests.

Step 5: Running the test

Inside the project root folder, issue the following command

npm run test

Note that first time execution may take few minutes since system need to download browser drivers and configure them You should see your test executed in Chrome browser, Results will be shown in your console log. A detailed HTML report is generated under <project_root>/results/reports. Open the html report and see the detailed results.

Where to go from here?

  1. Improve the tests you wrote here by learning how to integrate an Object Repository
  2. See what are the other pre-defined CodeSpecJS grammar you can use in your tests and experiment with them
  3. Learn how to integrate your test project with Jenkins (a proven Continuos Integration environment )
  4. Improve your productivity even more by configuring your IDE to auto complete CodeSpecJs Grammar