1.2.0 • Published 5 months ago

@openfin/automation-helpers v1.2.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
5 months ago

Automation Helpers

This package contains helper methods which can be use in automation testing to interact with the OpenFin ecosystem.

They should be used in a test runner that has webdriver capabilities e.g. @openfin/automation-cli

Installation

Run npm i @openfin/automation-helpers.

Code examples

These examples use chai as the testing framework, but you can choose any framework you like.

Access the OpenFin system runtime

import { expect } from "chai";
import { OpenFinProxy, WebDriver } from "@openfin/automation-helpers";

describe('Test Suite', () => {
    it('The runtime version should be set', async () => {
        const fin = await OpenFinProxy.fin();
        const runtimeVersion = await fin.System.getVersion();

        expect(runtimeVersion).to.equal('26.102.70.16');
    });
});

Search for a value in the Home component

import { expect } from "chai";
import { OpenFinHome } from "@openfin/automation-helpers";

describe('Test Suite', () => {
    it('Can search in the Home component', async () => {
        await OpenFinHome.search("basic");
        await WebDriver.sleep(1000);

        const ids = await OpenFinHome.searchResultIds();

        expect(ids.length).equal(2);
        expect(ids[0]).equal("basic-interop-view");
        expect(ids[1]).equal("basic-fdc3-view");
    });
});

Use WebDriver command to interact with a window

import { expect } from "chai";
import { WebDriver } from "@openfin/automation-helpers";

describe('Test Suite', () => {
    it('Can perform operation in the interop window', async () => {
        await WebDriver.switchToWindow("title", "Interop Instrument Selection");

        const elem = await WebDriver.findElementByPath("//h1");
        await elem.setHTML("My New Title");

        const elem2 = await WebDriver.findElementByPath("//h1");
        const value = await elem2.getHTML();
        expect(value).eq("My New Title");

        await WebDriver.sleep(2000);
    });
});

OpenFin Debugging

For more information on debugging in OpenFin see https://developers.openfin.co/of-docs/docs/debugging

Related Packages

1.2.0

5 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.1.9

6 months ago

1.1.8

7 months ago

1.1.7

8 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.11

6 months ago

1.1.10

6 months ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.2

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.3.10

1 year ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago