1.0.39 • Published 2 months ago

angles-javascript-client v1.0.39

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

angles-javascript-client

The angles-javascript-client has all the necessary functions to store your test results in the Angles Dashboard.

Installation

To install the angles javascript client in your project simply run the following command.

# if your only using whilst running your tests (otherwise remove --save-dev)
npm install  angles-javascript-client --save-dev

Usage

You should be able to use the angles-javascript-client with any javascript execution framework to help you store your test results and do your image comparison. You make use of the client in the following ways.

// Option 1 (preferred): You can import an (singleton) instance of the anglesReporter
import anglesReporter from 'angles-javascript-client';

// And you can then point it to your instance of the Angles dashboard.
anglesReporter.setBaseUrl('http://127.0.0.1:3000/rest/api/v1.0/');
await anglesReporter.startBuild('TestRunName', 'Team', 'Environment', 'Component');

// store the versions of your system under test (so you can compare builds)
const artifact = new Artifact('angles-ui', 'anglesHQ', '1.0.0');
const artifactArray: Artifact[] = [];
artifactArray.push(artifact);
await anglesReporter.addArtifacts(artifactArray);

// Called e.g. in the "before"
anglesReporter.startTest('test1', 'suite1');

// This will group all the loging afterwards in this action
anglesReporter.addAction('My first action');

// Using the following two requests you can store your screenshots (with a view name and platform details)
const platform = new ScreenshotPlatform('Android', '10', 'Chrome', '89.0', 'Samsung Galaxy S9');
const screenshot = await anglesReporter.saveScreenshotWithPlatform(
  '/path/to/your/screenshot.png',
  'view_1',
  platform,
);

// this will add your screenshot to the info and display a thumbnail.
anglesReporter.infoWithScreenshot('Checking my view on android', screenshot._id);

// these methods don't do an assertion, but just report on the result (and change the state of the test run in Angles).
anglesReporter.pass('Assertion', 'true', 'true', 'Just doing an assertion');
anglesReporter.fail('Assertion', 'true', 'false', 'Just doing an assertion');

// Needs to be called once the test is done to send it to the Angles Dashboard.
await anglesReporter.saveTest();

If you want to create your own reporter, you can instantiate the request classes yourself.

// Option 2: you can import the invidividual TypeScript classes
import { BuildRequests, EnvironmentRequests } from 'angles-javascript-client';

// and instantiate the request classes yourself with your own axios instance.
const buildRequests = new BuildRequests(axios);
const environmentRequests = new EnvironmentRequests(axios);

To see more details about Angles Dashboard and e.g. how to set it up, have a look at our documentation on our github page.

1.0.39

2 months ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.15

2 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.3-BETA

3 years ago

1.0.4

3 years ago

1.0.0

3 years ago

1.0.0-BETA7

3 years ago

1.0.0-BETA6

3 years ago

1.0.0-BETA5

3 years ago

1.0.0-BETA4

3 years ago

1.0.0-BETA3

3 years ago

1.0.0-BETA2

3 years ago

1.0.0-BETA1

3 years ago