Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #47 from openfin/w/test-examples
Browse files Browse the repository at this point in the history
Examples for wdio service and puppeteer
  • Loading branch information
wenjunche authored Apr 6, 2022
2 parents c1dd97d + 9aa62ba commit 8d2184c
Show file tree
Hide file tree
Showing 14 changed files with 11,560 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ logs
OpenFinRVM.exe
OpenFin

local.json
local.json

**/.idea
*.iml
*.log

build
17 changes: 15 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"runtime": {
"arguments": "--v=1 --inspect",
"version": "canary"
"version": "stable"
},
"shortcut": {
"company": "OpenFin",
Expand All @@ -27,7 +27,11 @@
},
"defaultWindowOptions": {
"url": "http://localhost:5555/platform-window.html",
"contextMenu": true,
"contextMenuSettings": {
"reload": false,
"devtools": false,
"enable": false
},
"defaultWidth": 900,
"defaultHeight": 720,
"defaultLeft": 0,
Expand Down Expand Up @@ -56,6 +60,7 @@
"snapshot": {
"windows": [
{
"name": "Seed Window",
"layout": {
"content": [
{
Expand All @@ -69,6 +74,14 @@
"processAffinity": "ps_1",
"url": "https://cdn.openfin.co/health/deployment/index.html"
}
},
{
"type": "component",
"componentName": "view",
"componentState": {
"processAffinity": "ps_1",
"url": "https://google.com"
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion platform-window.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>OpenFin Template</title>
<title>Platform Window Template</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/frame-styles.css"></link>
Expand Down
12 changes: 12 additions & 0 deletions test/puppeteer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Example for testing apps built on OpenFin platform with Puppeteer


This example demonstrates how to test apps, based on OpenFin Platform, with [Puppeteer](https://pptr.dev/#?product=Puppeteer&version=v12.0.1&show=outline).

## Run the example

1. host app.json of the Platform Seeed project on localhost:5555
2. run "npm run test"

## Guidelines for writing tests

59 changes: 59 additions & 0 deletions test/puppeteer/RunOpenFin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@ECHO OFF
REM This script is intended to be used for launching OpenFin Runtime by ChromeDriver or node of Selenium Grid server.
REM It parses --remote-debugging-port and --config parameters passed by ChromeDriver and passes them to OpenFinRVM.exe
REM %openfinLocation% needs to point to location of OpenFin install directory.
REM devtools_port should NOT be set in app manifest json file

SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS

SET args=

:loop
IF "%1"=="" GOTO cont
SET opt=%1
SET opt2=%2
IF "%2" == "" (
SET opt2Check=%opt2%
) ELSE (
SET opt2Check=%opt2:"=%
)
IF "%opt%" == "--config" (
SET startupURL=%2
GOTO doubleshift
) ELSE (
IF "%opt%" == "data:" (
echo "skipping data:"
) ELSE (
IF "%opt:~0,2%" == "--" (
IF "%opt2Check:~0,2%" == "--" (
SET args=%args% %1
) ELSE (
IF "%opt2Check%" == "" (
SET args=%args% %1
) ELSE (
IF "%opt2Check%" == "data:" (
SET args=%args% %1
) ELSE (
SET args=%args% %1=%2
GOTO doubleshift
)
)
)
)
)
)

SHIFT & GOTO loop

:doubleshift
SHIFT & SHIFT & GOTO loop

:cont

SET openfinLocation=%LocalAppData%\OpenFin

%openfinLocation%\OpenFinRVM.exe --config=%startupURL% --runtime-arguments="%args%"

ENDLOCAL

Loading

0 comments on commit 8d2184c

Please sign in to comment.