1.0.5 • Published 3 years ago

web-automation-xml v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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

FieldUsageValues
headlessTo open browser headless or notBoolean
viewportViewport Configuration when opening the broswerObject
viewport.widthWidth of the screen that is openedNumber
viewport.heightHeight of the screen that is openedNumber
filePathPath to the XML file that contains the Test suite.String
payloadObject containing Dynamic keys that is used in OperationsObject

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.

ArrtibuteUsageValues
idUnique Identifier for each Test casesString or Number
descriptionDescription of the Test case.String
retryNumber 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.

ArrtibuteUsageValues
operationTypeThis specify the tyoe of the OperationENUM (type, goto, scroll, capture, click)
linkLink of the webpage. Used when operationType is gotoString
delayDelay in typing Characters if operationType is type. Default value is 10. Unit is millisecondNumber
selectorThe Selector of the HTML Element in which operation needs to be performed.String
waitForTime till which the script waits before executing the current operation. Can be millisecond or a SelectorSelector or Number
timeoutMaximim 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
fileNameFile name with which the captured Screen must be saved. Used in case operationType is captureString
targetFor 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
distanceDistance in px that needs to be scrolled along. Used when operationType is scroll. Unit is pxNumber
valueText that needs to be typed when operationType is typeString
evalueThis must be the key from payload(From Options that discussed above). Dynamic values will be picked from the payload object.String
ignoreErrorIf 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 suganth2610@gmail.com

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago