Skip to content

Commit 321a4f7

Browse files
authored
Merge pull request #6 from webmate-io/testmgmt
Major JavaScript/TypeScript SDK upgrade
2 parents 81f467f + a797399 commit 321a4f7

File tree

88 files changed

+4803
-401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4803
-401
lines changed

.eslintrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": [
5+
"@typescript-eslint"
6+
],
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended"
11+
],
12+
"parserOptions": {
13+
"ecmaVersion": 2017
14+
},
15+
"rules": {
16+
"semi": ["warn", "always"]
17+
}
18+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2021 Testfabrik Consulting + Solutions AG
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# webmate Javascript SDK
1+
# webmate JavaScript and TypeScript SDK
22

33
The webmate SaaS test automation platform provides testing services for testers and developers of web applications.
4-
This SDK contains wrapper code used to call the webmate API from Java applications.
4+
This SDK contains wrapper code used to call the webmate API from JavaScript and TypeScript applications.
55

6-
There is no official version of the webmate Javascript SDK, yet. This is a preview release, which provides wrappers for the following tasks:
6+
The webmate JavaScript SDK is still under development and maintained regularly.
7+
This release provides wrappers for the following tasks:
78

89
* Perform state extraction in an existing browser session, e.g. one that has been created via Selenium.
910
* Execute a new JobRun in the webmate Job service, e.g. to start a Job comparing the layout of web pages in multiple browsers.
@@ -12,12 +13,13 @@ There is no official version of the webmate Javascript SDK, yet. This is a previ
1213

1314
This SDK pre-release gives access to a small subset of the features available in the API. The SDK will be completed over time.
1415

15-
For a list of recent change refer to the [changelog](CHANGES.md)
16+
For a complete list of recent changes, please refer to the [changelog](CHANGES.md).
17+
1618

1719
## Using the SDK in your Project
1820

1921
This release is also distributed via npm under the package name webmate-sdk-js.
20-
To use the SDK we recommed to install it via npm:
22+
To use the SDK we recommend to install it via npm:
2123

2224
```bash
2325
$ npm install webmate-sdk-js --save
@@ -29,13 +31,13 @@ To use the SDK afterwards, import it into your test files as follows:
2931
var webmate = require("webmate-sdk-js");
3032
```
3133

32-
If you're using typescript:
34+
If you're using TypeScript:
3335

3436
```ts
3537
import * as Webmate from "webmate-sdk-js";
3638
```
3739

38-
In typescript, you can also import the necessary type-definitions or classes directly:
40+
In TypeScript, you can also import the necessary type-definitions or classes directly:
3941

4042
```ts
4143
import {
@@ -48,29 +50,23 @@ import {
4850
```
4951

5052

51-
## Usage
53+
## Sample Code
5254

53-
With this SDK, you can automate Selenium testing, as well as CrossBrowser and Regression testing via webmate.
54-
Use
55-
```js
56-
var webmateSession = Webmate.startSession(MY_WEBMATE_USER, MY_WEBMATE_APIKEY, WEBMATE_API_URL);
57-
```
58-
to connect to the webmate API.
59-
60-
During tests, you can create states using
61-
Use
62-
```js
63-
webmateSession.browserSession.createState(sessionId, state_name, [timeout], [STATE_EXTRACTION_CONFIG])
64-
```
55+
See the following sample projects:
56+
* [Java Samples](https://github.com/webmate-io/webmate-sdk-samples)
57+
* [JavaScript And TypeScript Samples](https://github.com/webmate-io/webmate-sdk-js-samples)
6558

66-
After executing the tests, you can create a CrossBrowser or Regression job based on your selenium sessions like this:
67-
```js
68-
webmateSession.jobEngine.startKnownJob(test_name, new webmate.CrossbrowserJobInput(firstSession, sessionIds), MY_WEBMATE_PROJECTID)
69-
```
59+
In order to use these samples, you need to have an account at webmate SaaS or a commercial on-premise installation.
60+
Please contact Testfabrik ([email protected]) if you are interested in evaluating webmate.
7061

71-
Information about how to build a ```StateExtractionConfig``` can be found at https://github.com/webmate-io/webmate-sdk-java/wiki/BrowserSessionStateExtractionConfig
7262

63+
## Usage
7364

7465
In order to use this SDK, you need to have an account at webmate SaaS or a commercial on-premise installation.
7566
Please contact Testfabrik ([email protected]) if you are interested in evaluating webmate.
7667

68+
69+
## webmate API
70+
71+
Although, the SDK provides a number of features and convenience wrappers it doesn't exhaust the full potential of the webmate API.
72+
See the REST API [Swagger documentation](https://app.webmate.io/api/swagger) for a comprehensive summary of the webmate functionalities.

index.ts

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,98 @@
11
import {WebmateAPISession} from "./src/webmate-api-session";
22
import {WebmateEnvironment} from "./src/webmate-environment";
33
import {WebmateAuthInfo} from "./src/webmate-auth-info";
4+
import {ProjectId} from "./src/types";
45

6+
// Add entries in lexical order!
7+
8+
// root
9+
export * from './src/browser';
10+
export * from './src/browser-type';
11+
export * from './src/platform';
12+
export * from './src/platform-type';
13+
export * from './src/tag';
514
export * from './src/types';
15+
export * from './src/webmate-api-session';
16+
export * from './src/webmate-auth-info';
17+
export * from './src/webmate-capability-type';
18+
export * from './src/webmate-environment';
19+
// artifacts
20+
export * from './src/artifacts/artifact-client';
21+
export * from './src/artifacts/artifact-types';
22+
// blobs
23+
export * from './src/blobs/blob-client';
24+
// browsersession
625
export * from './src/browsersession/browser-session-client';
26+
export * from './src/browsersession/browser-session-ref';
27+
export * from './src/browsersession/browser-session-screenshot-extraction-config';
728
export * from './src/browsersession/browser-session-state-extraction-config';
8-
export * from './src/jobs/job-engine';
9-
export * from './src/jobs/well-known-job-input';
29+
export * from './src/browsersession/browser-session-warm-up-config';
30+
export * from './src/browsersession/browser-specification';
31+
export * from './src/browsersession/driver-specification';
32+
export * from './src/browsersession/expedition-spec';
33+
export * from './src/browsersession/expedition-spec-factory';
34+
export * from './src/browsersession/finish-story-action-add-artifact-data';
35+
export * from './src/browsersession/live-expedition-spec';
36+
export * from './src/browsersession/start-story-action-add-artifact-data';
37+
export * from './src/browsersession/url-list-driver-specification';
38+
export * from './src/browsersession/vehicle-specification';
39+
// commonutils
40+
export * from './src/commonutils/Dimension';
41+
// device
42+
export * from './src/device/device-client';
43+
export * from './src/device/device-dto';
44+
export * from './src/device/device-properties';
45+
export * from './src/device/device-request';
46+
// jobs
1047
export * from './src/jobs/jobconfigs/crossbrowser-job-input';
1148
export * from './src/jobs/jobconfigs/regression-job-input';
12-
export * from './src/webmate-api-session';
13-
export * from './src/webmate-environment';
14-
export * from './src/webmate-auth-info';
49+
export * from './src/jobs/job-engine';
50+
export * from './src/jobs/job-run-summary';
51+
export * from './src/jobs/well-known-job-input';
52+
export * from './src/jobs/wm-data-type';
53+
export * from './src/jobs/wm-value';
54+
export * from './src/jobs/wm-value-factory';
55+
// mailTest
56+
export * from './src/mailTest/mail-test-client';
57+
export * from './src/mailTest/mail-test-types';
58+
// packagemgmt
59+
export * from './src/packagemgmt/package';
60+
export * from './src/packagemgmt/packagemgmt-client';
61+
// selenium
62+
export * from './src/selenium/selenium-capability';
63+
export * from './src/selenium/selenium-service-client';
64+
export * from './src/selenium/selenium-session';
65+
export * from './src/selenium/selenium-session-proxy';
66+
export * from './src/selenium/webmate-selenium-session';
67+
export * from './src/selenium/webmate-selenium-session';
68+
// testmgmt
69+
export * from './src/testmgmt/spec/expedition-comparison-spec';
70+
export * from './src/testmgmt/spec/story-check-spec';
71+
export * from './src/testmgmt/spec/test-execution-spec';
72+
export * from './src/testmgmt/testtypes/standard-test-types';
73+
export * from './src/testmgmt/testtypes/test-type';
74+
export * from './src/testmgmt/create-test-execution-response';
75+
export * from './src/testmgmt/test';
76+
export * from './src/testmgmt/test-execution-evaluation-status';
77+
export * from './src/testmgmt/test-execution-execution-status';
78+
export * from './src/testmgmt/test-execution-spec-builder';
79+
export * from './src/testmgmt/test-execution-summary';
80+
export * from './src/testmgmt/test-info';
81+
export * from './src/testmgmt/test-mgmt-client';
82+
export * from './src/testmgmt/test-parameter';
83+
export * from './src/testmgmt/test-result';
84+
export * from './src/testmgmt/test-run';
85+
export * from './src/testmgmt/test-run-evaluation-status';
86+
export * from './src/testmgmt/test-run-execution-status';
87+
export * from './src/testmgmt/test-run-finish-data';
88+
export * from './src/testmgmt/test-run-info';
89+
export * from './src/testmgmt/test-run-summary';
90+
export * from './src/testmgmt/test-session';
91+
export * from './src/testmgmt/test-template';
92+
export * from './src/testmgmt/test-template-info';
1593

16-
export function startSession(emailAddress: string, apiKey: string, baseUri?: string): WebmateAPISession {
94+
export function startSession(emailAddress: string, apiKey: string, baseUri?: string, projectId?: ProjectId): WebmateAPISession {
1795
let env = new WebmateEnvironment(baseUri);
1896
let auth = new WebmateAuthInfo(emailAddress, apiKey);
19-
return new WebmateAPISession(auth, env);
97+
return new WebmateAPISession(auth, env, projectId);
2098
}

0 commit comments

Comments
 (0)