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

ctg

v1.0.0

Published

Common Test Generator

Downloads

7

Readme

CTG

Common Test Generator

Development

npm install
// change typescript source code
make // build

NOTE: ./typings/handlebars/handlebars.d.ts is being patch with extra registerHelper definition

export function registerHelper(name: Object): void;

Common Test Format

Test record and automation tool use array of actions to describe user actions.

Common Test Format add additonal context information and reserved field for

future use.

[
  {
    "command": "click",
    "target": "#target",
    "value": "",
    "extra": {
      "key": "this can be very complex object"
    }
  },
  {
    "command": "type",
    "target": ".target",
    "value": "hello world"
  }
]

Complete set of browser event can't be find in https://developer.mozilla.org/en-US/docs/Web/API/Event.

Currently comment test format only define subset of these event.

Command

| Command Name | Description | casperjs | nightmare | | :----------------------------: | :--------------------------------------: | :--------------------------------------: | :-------: | | open(url) | Load the page at url. | open(url) | goto(url) | | | | | | | useragent(ua) | Sets the User-Agent string | userAgent(agent) | useragent | | viewport(width, height) | Changes current viewport size. | viewport(width, height) | viewport | | back() | Go back to the previous page. | back() | back | | forward() | Go forward to the next page. | forward() | forward | | refresh() | Refresh the current page. | reload() | refresh | | click(selector) | Clicks the selector element once. | mouse.click(selector) | click | | mousedown(selector) | Mousedown the selector element once. | mouse.down(selector) | mousedown | | type(selector[, text]) | Enters the text provided into the selector element. Empty or falsey values provided for text will clear the selector's value. | sendKeys(with reset set as true) | type | | check(selector) | Toggles the selector checkbox element. | fallback | check | | select(selector, option) | Changes the selector dropdown element to the option with attribute [value=option] | fallback | select | | scrollTo(top, left) | Scrolls the page to desired position. top and left are always relative to the top left corner of the document. | scrollTo(x, y) | scrollTo | | inject(type, file) | Inject a local file onto the current page. The file type must be either js or css. | js: casper.page.injectJsfallback css:fallback | inject | | wait(ms) | Wait for ms milliseconds e.g. .wait(5000) | wait(timeout) | wait | | waitForSelector(selector) | Wait until the element selector is present e.g. .waitForSelector('#pay-button') | waitForSelector(selector) | wait | | | | | | | 暂不支持 | | | | | evaluate(fn[, arg1, arg2,...]) | Invokes fn on the page with arg1, arg2,.... All the args are optional. On completion it returns the return value of fn. Useful for extracting information from the page. | evaluate | evaluate | | .waitFor(fn[, arg1, arg2,...]) | Wait until the fn evaluated on the page with arg1, arg2,... returns true. All the args are optional. See .evaluate()for usage. | waitFor | wait |

Referrences