flowstride 1.0.19 → 1.0.20-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NATIVE_CI.md +155 -0
- package/README.md +40 -33
- package/RELEASE_NOTES.md +40 -0
- package/dist/adapters/web/playwright.d.ts +1 -0
- package/dist/adapters/web/playwright.js +18 -14
- package/dist/ci/config.d.ts +3 -0
- package/dist/ci/config.js +76 -0
- package/dist/ci/deadline.d.ts +2 -0
- package/dist/ci/deadline.js +16 -0
- package/dist/ci/init.d.ts +1 -0
- package/dist/ci/init.js +21 -0
- package/dist/ci/runtime.d.ts +19 -0
- package/dist/ci/runtime.js +190 -0
- package/dist/cli/commands/run.js +15 -34
- package/dist/cli/index.js +44 -5
- package/dist/game/bridge.d.ts +13 -0
- package/dist/game/bridge.js +15 -0
- package/dist/game/sdk.d.ts +27 -0
- package/dist/game/sdk.js +255 -0
- package/dist/game/three-bridge.d.ts +18 -0
- package/dist/game/three-bridge.js +59 -0
- package/dist/runner/flow_orchestrator.d.ts +5 -1
- package/dist/runner/flow_orchestrator.js +31 -7
- package/dist/runner/flow_worker.js +28 -4
- package/dist/runner/plugin_manager.d.ts +1 -0
- package/dist/runner/plugin_manager.js +33 -1
- package/dist/types/index.d.ts +36 -0
- package/examples/native-game/flows/canvas.flow +13 -0
- package/examples/native-game/flowstride.config.json +12 -0
- package/examples/native-game/server.mjs +12 -0
- package/package.json +14 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Feature: Native canvas game testing
|
|
2
|
+
let game = "flowstride:game"
|
|
3
|
+
Scenario: A tap changes game state and rendering
|
|
4
|
+
Given "The game is ready"
|
|
5
|
+
flow.open "http://127.0.0.1:5189"
|
|
6
|
+
game.fixture {"name":"reset"}
|
|
7
|
+
game.snapshot {"name":"before","canvas":"#game"}
|
|
8
|
+
When "The player taps the game"
|
|
9
|
+
game.tap {"canvas":"#game","x":0.5,"y":0.5}
|
|
10
|
+
Then "The score and scene change"
|
|
11
|
+
game.expectState {"path":"score","equals":1}
|
|
12
|
+
game.expectVisual {"name":"before","canvas":"#game","minChange":0.9}
|
|
13
|
+
game.checkpoint {"name":"game-result","canvas":"#game"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import { registerGame } from 'flowstride/dist/game/bridge.js';
|
|
3
|
+
const html = `<!doctype html><html><head><title>Flowstride native game fixture</title></head><body>
|
|
4
|
+
<canvas id="game" width="300" height="200" style="touch-action:none"></canvas>
|
|
5
|
+
<script>
|
|
6
|
+
const canvas=document.querySelector('canvas'),context=canvas.getContext('2d');
|
|
7
|
+
const state={score:0};
|
|
8
|
+
function draw(){context.fillStyle=state.score?'blue':'red';context.fillRect(0,0,canvas.width,canvas.height);}
|
|
9
|
+
canvas.onpointerdown=()=>{state.score++;draw();};draw();
|
|
10
|
+
const register=${registerGame.toString()};register({readState:()=>state,testMode:true,fixtures:{reset:()=>{state.score=0;draw();}}});
|
|
11
|
+
</script></body></html>`;
|
|
12
|
+
http.createServer((_request,response)=>{response.setHeader('Content-Type','text/html');response.end(html);}).listen(5189,'127.0.0.1');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowstride",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20-rc.2",
|
|
4
4
|
"description": "An opensource flowfirst test automation framework",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"packages/flowstride_report"
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"src/ui/dist"
|
|
12
|
+
"src/ui/dist",
|
|
13
|
+
"NATIVE_CI.md",
|
|
14
|
+
"examples/native-game",
|
|
15
|
+
"RELEASE_NOTES.md"
|
|
13
16
|
],
|
|
14
17
|
"bin": {
|
|
15
18
|
"flowstride": "dist/cli/index.js"
|
|
@@ -18,7 +21,8 @@
|
|
|
18
21
|
"build": "tsc",
|
|
19
22
|
"flowstride": "node ./dist/cli/index.js",
|
|
20
23
|
"test": "echo 'Test script to be configured'",
|
|
21
|
-
"prepublishOnly": "npm run build"
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"test:native": "node --test --test-concurrency=1 tests/native/*.test.cjs"
|
|
22
26
|
},
|
|
23
27
|
"keywords": [
|
|
24
28
|
"automation",
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
"author": "Samuel Okolo",
|
|
30
34
|
"license": "MIT",
|
|
31
35
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
36
|
+
"node": ">=22.12.0"
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|
|
35
39
|
"@inquirer/prompts": "^7.10.1",
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
"dotenv": "^17.4.2",
|
|
40
44
|
"open": "^11.0.0",
|
|
41
45
|
"ora": "^5.4.1",
|
|
42
|
-
"playwright": "
|
|
46
|
+
"playwright": "1.59.1",
|
|
43
47
|
"playwright-extra": "^4.3.6",
|
|
44
48
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
45
49
|
"tar": "^7.5.16",
|
|
@@ -54,5 +58,10 @@
|
|
|
54
58
|
},
|
|
55
59
|
"optionalDependencies": {
|
|
56
60
|
"@rolldown/binding-darwin-arm64": "^0.15.1"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"tag": "next",
|
|
64
|
+
"access": "public",
|
|
65
|
+
"registry": "https://registry.npmjs.org"
|
|
57
66
|
}
|
|
58
67
|
}
|