Skip to content

Commit

Permalink
Remove native ui automation until a review is performed.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnman committed Apr 30, 2024
1 parent 20e1478 commit 44ddca2
Show file tree
Hide file tree
Showing 13 changed files with 259 additions and 1,743 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ OpenFin provides some packages to assist in automation testing of your apps.

- [@openfin/automation-cli](https://www.npmjs.com/package/@openfin/automation-cli) - A command line tool for running tests in an OpenFin environment.
- [@openfin/automation-helpers](https://www.npmjs.com/package/@openfin/automation-helpers) - A package of helper methods for interacting with OpenFin components.
- [@openfin/automation-native](https://www.npmjs.com/package/@openfin/automation-native) - Helper methods to help interacting with native mouse and keyboard elements, such as context menus.

| Example | Description | Live Launch |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"devDependencies": {
"@openfin/automation-cli": "^1.2.0",
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"chai": "4.3.10",
"jasmine-pretty-html-reporter": "0.2.5",
"jest-html-reporters": "3.1.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {
WebDriver,
WebDriverKeys
} = require('@openfin/automation-helpers');
const { NativeDriver, NativeDriverKeys } = require('@openfin/automation-native');
const { expect } = require('chai');
const { By } = require('selenium-webdriver');

Expand Down Expand Up @@ -277,43 +276,4 @@ describe('Register with Home', () => {

await WebDriver.sleep(2000);
});

it('Can select a context menu entry in the interop window', async () => {
const foundWin = await WebDriver.switchToWindow('identityString', [
/internal-generated-window*/,
/register-with-home/
]);
expect(foundWin).to.be.true;

if (foundWin) {
const elem = await WebDriver.findElementByPath("//*[@aria-label='Open Browser Menu']");
expect(elem).to.exist;

if (elem) {
// First click on the button to show the native context menu
await WebDriver.actions([
{ type: 'mouseMove', origin: elem },
// Open the context menu
{ type: 'mouseClick', button: MouseButton.Left },
// Pause to give the menu time to appear
{ type: 'pause', duration: 2000 }
]);

// Do down arrow * 7 to select the close, you should see the confirmation popup
await NativeDriver.actions([
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'pause', duration: 1000 },
{ type: 'keyPress', key: NativeDriverKeys.Enter },
// Pause to see the confirmation
{ type: 'pause', duration: 2000 }
]);
}
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"devDependencies": {
"@openfin/automation-cli": "^1.2.0",
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"@types/chai": "4.3.12",
"chai": "4.3.10"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
WebDriver,
WebDriverKeys
} from "@openfin/automation-helpers";
import { NativeDriver, NativeDriverKeys } from "@openfin/automation-native";
import { expect } from "chai";
import { By } from "selenium-webdriver";

Expand Down Expand Up @@ -278,43 +277,4 @@ describe("Register with Home", () => {

await WebDriver.sleep(2000);
});

it("Can select a context menu entry in the interop window", async () => {
const foundWin = await WebDriver.switchToWindow("identityString", [
/internal-generated-window*/,
/register-with-home/
]);
expect(foundWin).to.be.true;

if (foundWin) {
const elem = await WebDriver.findElementByPath("//*[@aria-label='Open Browser Menu']");
expect(elem).to.exist;

if (elem) {
// First click on the button to show the native context menu
await WebDriver.actions([
{ type: "mouseMove", origin: elem },
// Open the context menu
{ type: "mouseClick", button: MouseButton.Left },
// Pause to give the menu time to appear
{ type: "pause", duration: 2000 }
]);

// Do down arrow * 7 to select the close, you should see the confirmation popup
await NativeDriver.actions([
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "keyPress", key: NativeDriverKeys.Down },
{ type: "pause", duration: 1000 },
{ type: "keyPress", key: NativeDriverKeys.Enter },
// Pause to see the confirmation
{ type: "pause", duration: 2000 }
]);
}
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"devDependencies": {
"@openfin/automation-cli": "^1.2.0",
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"chai": "4.3.10"
}
}
1 change: 0 additions & 1 deletion how-to/automation-testing/selenium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"license": "SEE LICENSE IN LICENSE.MD",
"devDependencies": {
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"chai": "4.3.10",
"chromedriver": "122.0.6",
"fkill": "7.2.1",
Expand Down
40 changes: 0 additions & 40 deletions how-to/automation-testing/selenium/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {
WebDriver,
WebDriverKeys
} = require('@openfin/automation-helpers');
const { NativeDriver, NativeDriverKeys } = require('@openfin/automation-native');
const { expect } = require('chai');
const { By } = require('selenium-webdriver');

Expand Down Expand Up @@ -275,43 +274,4 @@ describe('Register with Home', () => {

await WebDriver.sleep(2000);
});

it('Can select a context menu entry in the interop window', async () => {
const foundWin = await WebDriver.switchToWindow('identityString', [
/internal-generated-window*/,
/register-with-home/
]);
expect(foundWin).to.be.true;

if (foundWin) {
const elem = await WebDriver.findElementByPath("//*[@aria-label='Open Browser Menu']");
expect(elem).to.exist;

if (elem) {
// First click on the button to show the native context menu
await WebDriver.actions([
{ type: 'mouseMove', origin: elem },
// Open the context menu
{ type: 'mouseClick', button: MouseButton.Left },
// Pause to give the menu time to appear
{ type: 'pause', duration: 2000 }
]);

// Do down arrow * 7 to select the close, you should see the confirmation popup
await NativeDriver.actions([
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'pause', duration: 1000 },
{ type: 'keyPress', key: NativeDriverKeys.Enter },
// Pause to see the confirmation
{ type: 'pause', duration: 2000 }
]);
}
}
});
});
1 change: 0 additions & 1 deletion how-to/automation-testing/wdio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"devDependencies": {
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"@wdio/cli": "8.34.1",
"@wdio/local-runner": "8.34.1",
"@wdio/mocha-framework": "8.33.1",
Expand Down
40 changes: 0 additions & 40 deletions how-to/automation-testing/wdio/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {
WebDriver,
WebDriverKeys
} = require('@openfin/automation-helpers');
const { NativeDriver, NativeDriverKeys } = require('@openfin/automation-native');
const { expect } = require('chai');
const { By } = require('selenium-webdriver');

Expand Down Expand Up @@ -275,43 +274,4 @@ describe('Register with Home', () => {

await WebDriver.sleep(2000);
});

it('Can select a context menu entry in the interop window', async () => {
const foundWin = await WebDriver.switchToWindow('identityString', [
/internal-generated-window*/,
/register-with-home/
]);
expect(foundWin).to.be.true;

if (foundWin) {
const elem = await WebDriver.findElementByPath("//*[@aria-label='Open Browser Menu']");
expect(elem).to.exist;

if (elem) {
// First click on the button to show the native context menu
await WebDriver.actions([
{ type: 'mouseMove', origin: elem },
// Open the context menu
{ type: 'mouseClick', button: MouseButton.Left },
// Pause to give the menu time to appear
{ type: 'pause', duration: 2000 }
]);

// Do down arrow * 7 to select the close, you should see the confirmation popup
await NativeDriver.actions([
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'keyPress', key: NativeDriverKeys.Down },
{ type: 'pause', duration: 1000 },
{ type: 'keyPress', key: NativeDriverKeys.Enter },
// Pause to see the confirmation
{ type: 'pause', duration: 2000 }
]);
}
}
});
});
1 change: 0 additions & 1 deletion how-to/workspace-platform-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"devDependencies": {
"@openfin/automation-cli": "^1.2.0",
"@openfin/automation-helpers": "^1.2.0",
"@openfin/automation-native": "^1.2.0",
"@openfin/core": "36.80.11",
"@openfin/node-adapter": "36.80.11",
"@types/cors": "^2.8.17",
Expand Down
Loading

0 comments on commit 44ddca2

Please sign in to comment.