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

web-automation-xml

v1.0.5

Published

A XML based Automation Tessting tool for Web

Downloads

4

Readme

Web-Automation

A XML based Web Autoamtion Testing Framework.

Installation

npm i web-automation-xml --save

Usage

index.js

const execute = require('web-automation-xml')
const join = require('path').join;
const _path = join(__dirname, 'testing.xml');

execute({
    headless: false,
    viewport: { width: 1200, height: 800 },
    filePath: _path
});

testing.xml

<TestSuite> 
    <TestCases>
        <TestCase id='testcase1' description="Google Search Testcase"">
            <Operations>
                <Operation operationType="goto" link="https://www.google.com/"/>
                <Operation operationType="type" selector="body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > input" value="web-automation-xml npm"/>
                <Operation operationType="click" selector="body > div.L3eUgb > div.o3j99.ikrT4e.om7nvf > form > div:nth-child(1) > div.A8SBwf > div.FPdoLc.lJ9FBc > center > input.gNO89b"/>
                <Operation operationType="capture" fileName="googleSampleSearch" waitFor="5000"/>
            </Operations>
        </TestCase>
    </TestCases>
</TestSuite>

Options

| Field | Usage | Values | | ------ | ------ | ------ | | headless | To open browser headless or not | Boolean | | viewport | Viewport Configuration when opening the broswer | Object | | viewport.width | Width of the screen that is opened | Number | | viewport.height | Height of the screen that is opened | Number | | filePath | Path to the XML file that contains the Test suite. | String | | payload | Object containing Dynamic keys that is used in Operations | Object |

XML Tags & Attributes

TestSuite

This is a single Test Suite that contains the Test cases to be executed.

TestCases

This contains the list of Test cases available under the Test Suite.

TestCase

This is single unit of Test case. This has the list of Operations that needs to be executed when runing the testcase.

| Arrtibute | Usage | Values | | ------ | ------ | ------ | | id | Unique Identifier for each Test cases | String or Number | | description | Description of the Test case. | String | | retry | Number of times the test case should be tried when failed in between. | Number |

Operations

This contains the list of Operation available under the TestCase.

Operation

This specify the single opeartion that needs to be perforemd.

| Arrtibute | Usage | Values | | ------ | ------ | ------ | | operationType | This specify the tyoe of the Operation | ENUM (type, goto, scroll, capture, click) | | link | Link of the webpage. Used when operationType is goto | String | | delay | Delay in typing Characters if operationType is type. Default value is 10. Unit is millisecond | Number | | selector | The Selector of the HTML Element in which operation needs to be performed. | String | | waitFor | Time till which the script waits before executing the current operation. Can be millisecond or a Selector | Selector or Number | | timeout | Maximim time till which we wait for a Selector. This is used when waitFor is provided as Selector. Default value is set to 10000(10s)| Number | | fileName | File name with which the captured Screen must be saved. Used in case operationType is capture | String | | target | For operationType - click, the window may opens in a new Tab. When we need to focus on newly opened window we need to have target="newWindow" | String | | distance | Distance in px that needs to be scrolled along. Used when operationType is scroll. Unit is px | Number | | value | Text that needs to be typed when operationType is type | String | | evalue | This must be the key from payload(From Options that discussed above). Dynamic values will be picked from the payload object. | String | | ignoreError | If there is a operation that breaks and we do not want to stop the Test case Execution , we set ignoreError="true" | Boolean |

Support

Features are still in Development. For any Suggestion or Queries, contact [email protected]