Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUT-109 - Add a platform example #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Expand Up @@ -6,6 +6,8 @@ Example of Java test code on OpenFin Runtime with Chrome Driver.
### Source Code
HelloOpenFinTest.java has sample code for testing HTML5 components and OpenFin javascript adapter in Hello OpenFin demo application.

OpenFinPlatformMessagingTest.java has sample code for testing HTML5 components and OpenFin javascript adapter in a sample OpenFin Platform based demo application.

### Guidelines
Since all HTML5 applications in the OpenFin environment need to be started with OpenFin API, chromeDriver.get(URL) is not supported.

Expand All @@ -21,7 +23,7 @@ In Summary
* OpenFin RunTime must be shut down after a test is completed

### Assumptions
* Version 10.66.x.x of Runtime is required
* Version 10.66.x.x+ of Runtime is required (15.80.49.30+ if you are running an OpenFin Platform based application)

## Launch
## Run Locally
Expand All @@ -31,8 +33,13 @@ All binaries required to run HelloOpenFinTest are in release directory:
2. start chromedriver.exe
3. run testHelloOpenFin.bat

To run the Platform Messaging Sample we assume you have either installed the Hello OpenFin app above or you already have the OpenFin RVM installed by installing some other OpenFin Application.

1. start chromedriver.exe
2. run testOpenFinPlatformMessaging.bat

### Building from Source
To build one jar that includes all dependencies, use the command `mvn assembly:assembly -DdescriptorId=jar-with-dependencies`
To build one jar that includes all dependencies, use the command `mvn assembly:assembly -DdescriptorId=jar-with-dependencies` (ensure you have maven downloaded and setup and set in your PATH). Once the hello-openfin-selenium-jar-with-dependencies.jar is built ensure it is copied to the release folder before running the .bat file.

## Instructions for Selenium Server
Two example scripts are included in this project to demonstrate use of Selenium Server on localhost.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -40,7 +40,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.openfin.HelloOpenFinTest</mainClass>
<mainClass>com.openfin.OpenFinPlatformMessagingTest</mainClass>
</manifest>
</archive>
</configuration>
Expand Down
Binary file modified release/hello-openfin-selenium-jar-with-dependencies.jar
Binary file not shown.
47 changes: 47 additions & 0 deletions release/openfin_selenium_platform.json
@@ -0,0 +1,47 @@
{
"runtime": {
"arguments": "--v=1 --inspect",
"version": "stable"
},
"platform": {
"uuid": "platform_customization_selenium_messaging_sample",
"applicationIcon": "https://4k4o3.csb.app/favicon.ico",
"autoShow": false,
"defaultWindowOptions": {
"contextMenu": true,
"defaultWidth": 350,
"defaultHeight": 300,
"defaultLeft": 0,
"defaultTop": 0,
"saveWindowState": false,
"backgroundThrottling": true
}
},
"snapshot": {
"windows": [
{
"layout": {
"content": [
{
"type": "stack",
"id": "no-drop-target",
"content": [
{
"type": "component",
"componentName": "view",
"componentState": {
"name": "component_A1",
"processAffinity": "ps_1",
"url": "https://4k4o3.csb.app/platform-messaging/index.html"
}
}
]
}
]
}
}
]
},
"startup_app": null,
"shortcut": {}
}
4 changes: 2 additions & 2 deletions release/testHelloOpenFin.bat
@@ -1,6 +1,6 @@
@ECHO OFF
REM start tests with Selenium Grid running on http://10.37.129.2:8818/wd/hub
REM java -DRemoteDriverURL=http://10.37.129.2:8818/wd/hub -DExecPath=RunOpenFin.bat -DExecArgs=--config="https://demoappdirectory.openf.in/desktop/config/apps/OpenFin/HelloOpenFin/selenium.json" -jar hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest
REM java -DRemoteDriverURL=http://10.37.129.2:8818/wd/hub -DExecPath=RunOpenFin.bat -DExecArgs=--config="https://demoappdirectory.openf.in/desktop/config/apps/OpenFin/HelloOpenFin/selenium.json" -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest

REM start tests with standalone ChromeDrive.exe running on localhost:9515
java -DRemoteDriverURL=http://localhost:9515 -DExecPath=RunOpenFin.bat -DExecArgs="--config=%~dp0\openfin_selenium.json" -jar hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest
java -DRemoteDriverURL=http://localhost:9515 -DExecPath=RunOpenFin.bat -DExecArgs="--config=%~dp0\openfin_selenium.json" -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest
2 changes: 1 addition & 1 deletion release/testHelloOpenFin.sh
@@ -1,3 +1,3 @@
#!/bin/bash

java -DRemoteDriverURL=http://localhost:9515 -DExecPath=./RunOpenFin.sh -DExecArgs="--config=./openfin_selenium.json" -DSecurityRealm=realm1 -jar hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest
java -DRemoteDriverURL=http://localhost:9515 -DExecPath=./RunOpenFin.sh -DExecArgs="--config=./openfin_selenium.json" -DSecurityRealm=realm1 -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.HelloOpenFinTest
6 changes: 6 additions & 0 deletions release/testOpenFinPlatformMessaging.bat
@@ -0,0 +1,6 @@
@ECHO OFF
REM start tests with Selenium Grid running on http://10.37.129.2:8818/wd/hub
REM java -DRemoteDriverURL=http://10.37.129.2:8818/wd/hub -DExecPath=RunOpenFin.bat -DExecArgs=--config="https://4k4o3.csb.app/platform-messaging/app.json" -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.OpenFinPlatformMessagingTest

REM start tests with standalone ChromeDrive.exe running on localhost:9515
java -DRemoteDriverURL=http://localhost:9515 -DExecPath=RunOpenFin.bat -DExecArgs="--config=%~dp0\openfin_selenium_platform.json" -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.OpenFinPlatformMessagingTest
3 changes: 3 additions & 0 deletions release/testOpenFinPlatformMessaging.sh
@@ -0,0 +1,3 @@
#!/bin/bash

java -DRemoteDriverURL=http://localhost:9515 -DExecPath=./RunOpenFin.sh -DExecArgs="--config=./openfin_selenium_platform.json" -DSecurityRealm=realm1 -cp hello-openfin-selenium-jar-with-dependencies.jar com.openfin.OpenFinPlatformMessagingTest