Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/webmate-sdk-js-samples.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 21 additions & 4 deletions src/credentials.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import {ProjectId} from "webmate-sdk-js";

/**
* Simply fill in the username, api key and project ID
* Details on how to get your API Key and Project ID can be found in the official webmate documentation.
* https://docs.webmate.io/reference/generate-api-key/?searchTerm=api
* There is no need to change the Selenium HOST or the webmate API URL
*/
export const MY_WEBMATE_USER: string = "xxxx@xxxxxxxxx.com";
export const MY_WEBMATE_APIKEY: string = "xxxxxx-xxxxx-xxxx-ba43-da86b97734eb";
export const MY_WEBMATE_PROJECTID: ProjectId = "xxxxxx-1b49-4eb0-bb3a-xxxxxxxxx";

export const WEBMATE_SELENIUM_PORT: number = 44444;
export const WEBMATE_SELENIUM_PORT: number = 443;
/**
These are the credentials with which you can use the SDK with with app.webmate.io (https://app.webmate.io)
*/
export const WEBMATE_SELENIUM_HOST: string = "app.webmate.io";
export const WEBMATE_SELENIUM_PROTOCOL: string = "https";

export const WEBMATE_API_URL: string = "https://app.webmate.io/api/v1";

/**
These are the credentials with which you can use the SDK with the demo instance of webmate (https://demo.webmate.io).
*/
//export const WEBMATE_SELENIUM_HOST: string = "selenium-demo.webmate.io";
//export const WEBMATE_API_URL: string = "https://demo.webmate.io/api/v1";

export const WEBMATE_SELENIUM_PROTOCOL: string = "https";
export const WEBMATE_SELENIUM_ADDRESS: string = WEBMATE_SELENIUM_PROTOCOL + "://" + WEBMATE_SELENIUM_HOST + ":" + WEBMATE_SELENIUM_PORT + "/wd/hub";



2 changes: 0 additions & 2 deletions src/cucumber/example-page.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
MY_WEBMATE_USER,
WEBMATE_API_URL,
WEBMATE_SELENIUM_HOST,
WEBMATE_SELENIUM_PORT,
WEBMATE_SELENIUM_PROTOCOL
} from "../credentials";
import {ExamplePageFormInteraction} from "../pages/example-page-form-interaction";
Expand Down Expand Up @@ -52,7 +51,6 @@ function getOptions(browser: Browser): WebdriverIO.RemoteOptions {
},
hostname: WEBMATE_SELENIUM_HOST,
protocol: WEBMATE_SELENIUM_PROTOCOL,
port: WEBMATE_SELENIUM_PORT,
connectionRetryTimeout: 240000,
connectionRetryCount: 1,
logLevel: 'debug'
Expand Down
8 changes: 4 additions & 4 deletions src/device-interaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Device Interaction Test', function () {

it('should deploy an Android device and release it afterwards', async() => {
log.info('Deploy an Android device')
let platform = new Platform(PlatformType.ANDROID, "9");
let platform = new Platform(PlatformType.ANDROID, "11");
let deviceRequest = new DeviceRequest("Sample Device", new Map([['machine.platform', platform.toString()]]));
await webmateSession.device.requestDeviceByRequirements(MY_WEBMATE_PROJECTID, deviceRequest).pipe(
tap(device => {
Expand Down Expand Up @@ -107,7 +107,7 @@ describe('Device Interaction Test', function () {
log.info(`App ${pkgInfo.id} has been uploaded`);
}),
mergeMap((pkgInfo: Package) => {
let platform = new Platform(PlatformType.ANDROID, "10");
let platform = new Platform(PlatformType.ANDROID, "11");
let deviceRequirements = new Map([['machine.platform', platform.toString()]]);
let deviceRequest = new DeviceRequest("Test Device", deviceRequirements);
return webmateSession.device.requestDeviceByRequirements(MY_WEBMATE_PROJECTID, deviceRequest).pipe(
Expand Down Expand Up @@ -137,8 +137,8 @@ describe('Device Interaction Test', function () {
});

it('should upload an image and use it for camera simulation', async() => {
// Deploy new device with Platform Android 10
let platform = new Platform(PlatformType.ANDROID, "10");
// Deploy new device with Platform Android 11
let platform = new Platform(PlatformType.ANDROID, "11");
let deviceRequirements = new Map([['machine.platform', platform.toString()]]);
let deviceRequest = new DeviceRequest("Test Device", deviceRequirements);
await webmateSession.device.requestDeviceByRequirements(MY_WEBMATE_PROJECTID, deviceRequest).pipe(
Expand Down
2 changes: 1 addition & 1 deletion src/selenium-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Selenium Demo Test Suite', function () {
};

let platform = new Platform(PlatformType.WINDOWS, "10", "64");
let browser = new Browser(BrowserType.CHROME, "83", platform);
let browser = new Browser(BrowserType.CHROME, "99", platform);
await executeTestInBrowser(browser).catch(errorHandler);
});

Expand Down
9 changes: 5 additions & 4 deletions src/url-based-crossbrowser-test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ describe('URL Based Crossbrowser Test', function () {

it('should execute a crossbrowser test', async() => {
// Specify the reference browser
let referenceBrowser = new Browser(BrowserType.FIREFOX, "81", new Platform(PlatformType.WINDOWS, "10", "64"));
let referenceBrowser = new Browser(BrowserType.FIREFOX, "91", new Platform(PlatformType.WINDOWS, "10", "64"));

// Specify the browsers that should be compared to the reference browser
let crossBrowsers = [
new Browser(BrowserType.CHROME, "86", new Platform(PlatformType.WINDOWS, "10", "64")),
new Browser(BrowserType.CHROME, "96", new Platform(PlatformType.WINDOWS, "10", "64")),
new Browser(BrowserType.INTERNET_EXPLORER, "11", new Platform(PlatformType.WINDOWS, "10", "64"))
];

Expand All @@ -51,15 +51,16 @@ describe('URL Based Crossbrowser Test', function () {
"CrossBrowser Test via SDK",
ExpeditionSpecFactory.makeUrlListExpeditionSpec(urls, referenceBrowser),
[...(crossBrowsers.map(browser => ExpeditionSpecFactory.makeUrlListExpeditionSpec(urls, browser)))]
).withTagName("SDK").withTagName("Release", "2020-11");
).withTagName("SDK").withTagName("Release", "2022-03");

await webmateSession.testMgmt.startExecutionWithBuilder(testExecutionSpecBuilder).pipe(
mergeMap(testRun => {
return testRun.waitForCompletion();
}),
tap(info => {
log.info(`Finished waiting for TestRun: ${info.toString()}`);
log.info(`The result is available at: https://app.webmate.io/#/projects/${info.projectId}/testlab/testruns/${info.testRunId}`);
let webmateUrl = WEBMATE_API_URL.substring(0,WEBMATE_API_URL.length-6);
log.info(`The result is available at: ${webmateUrl}#/projects/${info.projectId}/testlab/testruns/${info.testRunId}`);
})
).toPromise();
});
Expand Down