1.0.25 • Published 4 years ago

@tyler8812/sideex-api v1.0.25

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

SideeX-API

This is SideeX JavaScript API for recording and playing web browsing behavior. The API can be embeded in a webpage without installing a browser web extension.

Installation

npm i sideex-api

Import

var {SideeX} = require('@tyler8812/sideex-api')
var sideex = new SideeX();
import {SideeX} from "@tyler8812/sideex-api"
var sideex = new SideeX();

API Docs

SideeX-API document

Usage Example

Record and playback

import {SideeX} from "@tyler8812/sideex-api"
var sideex = new SideeX();

sideex.recorder.start();//start recording
/* 
  Record a command
  For example: click at anywhere on the window,
  then you get a ClickAt command  
*/
sideex.recorder.stop();//stop recording
console.log(sideex.file.command.get(0));//get the first recorded command
sideex.playback.start();//replay the recorded commands

Change a recorded command to a user-defined action

import {SideeX} from "@tyler8812/sideex-api"
var sideex = new SideeX();

sideex.recorder.start();//start recording
/* 
  Record a command
  For example: click at anywhere on the window,
  then you get a ClickAt command  
*/
sideex.recorder.stop();//stop recording
console.log(sideex.file.command.get(0));//get the first recorded command
let command = sideex.file.command.get(0);
command.name = "myAction";//rename the command name to "myAction"
console.log(sideex.file.command.get(0));//see the change of the command name
//add a user-defined function for executing "myAction"
sideex.playback.addCustomCommand("myAction", true, (target, value) => {
    console.log(target, value);
    //define the action here
    }
);
sideex.playback.start();//replay the modified recorded commands

Save the file and load it

import {SideeX} from "@tyler8812/sideex-api"
var sideex = new SideeX();

sideex.recorder.start();//start recording
/* 
  Record a command
  For example: click at anywhere on the window,
  then you get a ClickAt command  
*/
sideex.recorder.stop();//stop recording
console.log(sideex.file.command.get(0));//get the record that you recorded
let jsonString = sideex.file.testSuite.save();//serialize the recorded commands to a JSON string

//save the jsonString on your own

sideex.file.testSuite.load(jsonString);//load the jsonString
sideex.playback.start();//replay the recorded commands
1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.8

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.12

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago