ravensight-playtest 0.11.1 → 0.13.0

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.
Files changed (63) hide show
  1. package/README.md +165 -15
  2. package/addons/mobile/Host/AppDelegate.swift +11 -0
  3. package/addons/mobile/RavensightMobile.xcodeproj/project.pbxproj +398 -0
  4. package/addons/mobile/RavensightMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  5. package/addons/mobile/RavensightMobile.xcodeproj/xcshareddata/xcschemes/RavensightMobile.xcscheme +116 -0
  6. package/addons/mobile/UITests/MobileInputTests.swift +152 -0
  7. package/addons/mobile/project.yml +45 -0
  8. package/docs/ADAPTERS.md +5 -4
  9. package/docs/MOBILE.md +107 -0
  10. package/docs/NATIVE_RUNNER.md +7 -3
  11. package/package.json +9 -7
  12. package/src/api/client.js +10 -1
  13. package/src/cli.js +65 -8
  14. package/src/commands/check.js +17 -3
  15. package/src/commands/device.js +64 -0
  16. package/src/commands/hosted.js +31 -13
  17. package/src/commands/run.js +125 -16
  18. package/src/detect.js +17 -0
  19. package/src/hosted/archivePreflight.js +3 -3
  20. package/src/hosted/recordedRun.js +19 -3
  21. package/src/run/anygame/index.js +9 -3
  22. package/src/run/args.js +30 -0
  23. package/src/run/budgetReserve.js +98 -16
  24. package/src/run/choiceCheck.js +26 -7
  25. package/src/run/claimProtocol.js +27 -0
  26. package/src/run/completion.js +86 -0
  27. package/src/run/drivers/android.js +3 -0
  28. package/src/run/drivers/index.js +4 -0
  29. package/src/run/drivers/ios.js +3 -0
  30. package/src/run/drivers/mobile/adb.js +91 -0
  31. package/src/run/drivers/mobile/attempt.js +18 -0
  32. package/src/run/drivers/mobile/crash.js +115 -0
  33. package/src/run/drivers/mobile/frame.js +64 -0
  34. package/src/run/drivers/mobile/ios-helper.js +102 -0
  35. package/src/run/drivers/mobile/lock.js +32 -0
  36. package/src/run/drivers/mobile/native.js +227 -0
  37. package/src/run/drivers/mobile/preflight.js +80 -0
  38. package/src/run/drivers/mobile/process.js +57 -0
  39. package/src/run/drivers/mobile/recording.js +88 -0
  40. package/src/run/drivers/mobile/screenshot.js +34 -0
  41. package/src/run/drivers/mobile/simctl.js +60 -0
  42. package/src/run/drivers/mobile/target.js +53 -0
  43. package/src/run/drivers/web.js +118 -5
  44. package/src/run/honesty.js +66 -26
  45. package/src/run/inputMeasurement.js +49 -0
  46. package/src/run/livesite/browser.js +316 -0
  47. package/src/run/livesite/hosts.js +107 -0
  48. package/src/run/livesite/network.js +117 -0
  49. package/src/run/livesite/options.js +167 -0
  50. package/src/run/livesite/resolver.js +78 -0
  51. package/src/run/livesite/run.js +113 -0
  52. package/src/run/model.js +20 -27
  53. package/src/run/personaLoop.js +486 -95
  54. package/src/run/proxyClient.js +177 -0
  55. package/src/run/redaction.js +191 -0
  56. package/src/run/report.js +24 -2
  57. package/src/run/resume.js +63 -7
  58. package/src/run/screenshots.js +3 -1
  59. package/src/run/state.js +3 -1
  60. package/src/run/tooFast.js +116 -0
  61. package/src/run/tools.js +30 -4
  62. package/src/run/transcript.js +3 -1
  63. package/src/run/usage.js +3 -1
@@ -0,0 +1,116 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "1430"
4
+ version = "1.7">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES"
8
+ runPostActionsOnFailure = "NO">
9
+ <BuildActionEntries>
10
+ <BuildActionEntry
11
+ buildForTesting = "YES"
12
+ buildForRunning = "YES"
13
+ buildForProfiling = "YES"
14
+ buildForArchiving = "YES"
15
+ buildForAnalyzing = "YES">
16
+ <BuildableReference
17
+ BuildableIdentifier = "primary"
18
+ BlueprintIdentifier = "CA571D0AB1C3F8DB42E6C5F4"
19
+ BuildableName = "RavensightMobile.app"
20
+ BlueprintName = "RavensightMobile"
21
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
22
+ </BuildableReference>
23
+ </BuildActionEntry>
24
+ <BuildActionEntry
25
+ buildForTesting = "YES"
26
+ buildForRunning = "NO"
27
+ buildForProfiling = "NO"
28
+ buildForArchiving = "NO"
29
+ buildForAnalyzing = "NO">
30
+ <BuildableReference
31
+ BuildableIdentifier = "primary"
32
+ BlueprintIdentifier = "60060BBC01D82AE54A500976"
33
+ BuildableName = "RavensightMobileUITests.xctest"
34
+ BlueprintName = "RavensightMobileUITests"
35
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
36
+ </BuildableReference>
37
+ </BuildActionEntry>
38
+ </BuildActionEntries>
39
+ </BuildAction>
40
+ <TestAction
41
+ buildConfiguration = "Debug"
42
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
43
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
44
+ shouldUseLaunchSchemeArgsEnv = "YES"
45
+ onlyGenerateCoverageForSpecifiedTargets = "NO">
46
+ <MacroExpansion>
47
+ <BuildableReference
48
+ BuildableIdentifier = "primary"
49
+ BlueprintIdentifier = "CA571D0AB1C3F8DB42E6C5F4"
50
+ BuildableName = "RavensightMobile.app"
51
+ BlueprintName = "RavensightMobile"
52
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
53
+ </BuildableReference>
54
+ </MacroExpansion>
55
+ <Testables>
56
+ <TestableReference
57
+ skipped = "NO"
58
+ parallelizable = "NO">
59
+ <BuildableReference
60
+ BuildableIdentifier = "primary"
61
+ BlueprintIdentifier = "60060BBC01D82AE54A500976"
62
+ BuildableName = "RavensightMobileUITests.xctest"
63
+ BlueprintName = "RavensightMobileUITests"
64
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
65
+ </BuildableReference>
66
+ </TestableReference>
67
+ </Testables>
68
+ <CommandLineArguments>
69
+ </CommandLineArguments>
70
+ </TestAction>
71
+ <LaunchAction
72
+ buildConfiguration = "Debug"
73
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
74
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
75
+ launchStyle = "0"
76
+ useCustomWorkingDirectory = "NO"
77
+ ignoresPersistentStateOnLaunch = "NO"
78
+ debugDocumentVersioning = "YES"
79
+ debugServiceExtension = "internal"
80
+ allowLocationSimulation = "YES">
81
+ <BuildableProductRunnable
82
+ runnableDebuggingMode = "0">
83
+ <BuildableReference
84
+ BuildableIdentifier = "primary"
85
+ BlueprintIdentifier = "CA571D0AB1C3F8DB42E6C5F4"
86
+ BuildableName = "RavensightMobile.app"
87
+ BlueprintName = "RavensightMobile"
88
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
89
+ </BuildableReference>
90
+ </BuildableProductRunnable>
91
+ </LaunchAction>
92
+ <ProfileAction
93
+ buildConfiguration = "Release"
94
+ shouldUseLaunchSchemeArgsEnv = "YES"
95
+ savedToolIdentifier = ""
96
+ useCustomWorkingDirectory = "NO"
97
+ debugDocumentVersioning = "YES">
98
+ <BuildableProductRunnable
99
+ runnableDebuggingMode = "0">
100
+ <BuildableReference
101
+ BuildableIdentifier = "primary"
102
+ BlueprintIdentifier = "CA571D0AB1C3F8DB42E6C5F4"
103
+ BuildableName = "RavensightMobile.app"
104
+ BlueprintName = "RavensightMobile"
105
+ ReferencedContainer = "container:RavensightMobile.xcodeproj">
106
+ </BuildableReference>
107
+ </BuildableProductRunnable>
108
+ </ProfileAction>
109
+ <AnalyzeAction
110
+ buildConfiguration = "Debug">
111
+ </AnalyzeAction>
112
+ <ArchiveAction
113
+ buildConfiguration = "Release"
114
+ revealArchiveInOrganizer = "YES">
115
+ </ArchiveAction>
116
+ </Scheme>
@@ -0,0 +1,152 @@
1
+ import XCTest
2
+ import UIKit
3
+
4
+ private enum BridgeError: Error {
5
+ case invalidConfiguration, invalidCommand, invalidCoordinate, applicationNotRunning, network, deadline
6
+ }
7
+
8
+ @MainActor
9
+ final class MobileInputTests: XCTestCase {
10
+ private var applications: [String: XCUIApplication] = [:]
11
+ private var activeBundle: String?
12
+ private var baseURL: URL!
13
+
14
+ // The transport is available only on a token-scoped loopback URL supplied by the CLI.
15
+ private func request(_ path: String, body: [String: Any]? = nil) throws -> [String: Any] {
16
+ var req = URLRequest(url: baseURL.appendingPathComponent(path))
17
+ req.timeoutInterval = 15
18
+ if let body {
19
+ req.httpMethod = "POST"
20
+ req.setValue("application/json", forHTTPHeaderField: "Content-Type")
21
+ req.httpBody = try JSONSerialization.data(withJSONObject: body)
22
+ }
23
+ let signal = DispatchSemaphore(value: 0)
24
+ var dataResult: Data?
25
+ var status = 0
26
+ var requestError: Error?
27
+ let task = URLSession.shared.dataTask(with: req) { data, response, error in
28
+ dataResult = data
29
+ status = (response as? HTTPURLResponse)?.statusCode ?? 0
30
+ requestError = error
31
+ signal.signal()
32
+ }
33
+ task.resume()
34
+ guard signal.wait(timeout: .now() + 16) == .success else { task.cancel(); throw BridgeError.deadline }
35
+ guard requestError == nil, (200..<300).contains(status) else { throw BridgeError.network }
36
+ guard let data = dataResult, !data.isEmpty else { return [:] }
37
+ return (try JSONSerialization.jsonObject(with: data)) as? [String: Any] ?? [:]
38
+ }
39
+
40
+ private func app(_ command: [String: Any]) throws -> XCUIApplication {
41
+ guard let bundle = command["bundleId"] as? String ?? activeBundle,
42
+ bundle.range(of: "^[A-Za-z0-9][A-Za-z0-9.-]+$", options: .regularExpression) != nil else { throw BridgeError.invalidCommand }
43
+ if let app = applications[bundle] { activeBundle = bundle; return app }
44
+ let app = XCUIApplication(bundleIdentifier: bundle)
45
+ applications[bundle] = app
46
+ activeBundle = bundle
47
+ return app
48
+ }
49
+
50
+ private func point(_ command: [String: Any], _ app: XCUIApplication, x: String = "x", y: String = "y") throws -> XCUICoordinate {
51
+ guard let dx = (command[x] as? NSNumber)?.doubleValue,
52
+ let dy = (command[y] as? NSNumber)?.doubleValue,
53
+ dx.isFinite, dy.isFinite else { throw BridgeError.invalidCoordinate }
54
+ let frame = app.frame
55
+ guard frame.contains(CGPoint(x: dx, y: dy)) else { throw BridgeError.invalidCoordinate }
56
+ return app.coordinate(withNormalizedOffset: .zero).withOffset(CGVector(dx: dx - frame.minX, dy: dy - frame.minY))
57
+ }
58
+
59
+ private func number(_ command: [String: Any], _ name: String, fallback: Double = 0, maximum: Double = 5000) throws -> Double {
60
+ let value = (command[name] as? NSNumber)?.doubleValue ?? fallback
61
+ guard value.isFinite, value >= 0, value <= maximum else { throw BridgeError.invalidCommand }
62
+ return value
63
+ }
64
+
65
+ private func execute(_ command: [String: Any]) throws -> [String: Any] {
66
+ guard let kind = command["kind"] as? String else { throw BridgeError.invalidCommand }
67
+ if kind == "wait" { Thread.sleep(forTimeInterval: try number(command, "durationMs") / 1000); return [:] }
68
+ if kind == "orientation" {
69
+ guard let orientation = command["orientation"] as? String,
70
+ ["portrait", "landscape"].contains(orientation) else { throw BridgeError.invalidCommand }
71
+ XCUIDevice.shared.orientation = orientation == "portrait" ? .portrait : .landscapeLeft
72
+ let screen = UIScreen.main.bounds
73
+ let long = max(screen.width, screen.height), short = min(screen.width, screen.height)
74
+ return ["width": orientation == "portrait" ? short : long,
75
+ "height": orientation == "portrait" ? long : short]
76
+ }
77
+ let target = try app(command)
78
+ switch kind {
79
+ case "status":
80
+ let running = target.state == .runningForeground || target.state == .runningBackground
81
+ if running { let frame = target.frame; return ["running": true, "width": frame.maxX, "height": frame.maxY] }
82
+ return ["running": false]
83
+ case "launch":
84
+ if command["activate"] as? Bool == true {
85
+ guard target.state == .runningForeground || target.state == .runningBackground else {
86
+ throw BridgeError.applicationNotRunning
87
+ }
88
+ target.activate()
89
+ } else if target.state == .notRunning { target.launch() } else { target.activate() }
90
+ let frame = target.frame
91
+ return ["width": frame.maxX, "height": frame.maxY]
92
+ case "stop": target.terminate()
93
+ case "click":
94
+ let coordinate = try point(command, target)
95
+ let hold = try number(command, "holdMs") / 1000
96
+ if hold > 0 { coordinate.press(forDuration: hold) }
97
+ else if command["double"] as? Bool == true { coordinate.doubleTap() }
98
+ else { coordinate.tap() }
99
+ case "drag", "swipe":
100
+ let start = try point(command, target)
101
+ let end = try point(command, target, x: "toX", y: "toY")
102
+ let duration = max(0.05, try number(command, "durationMs", fallback: 350) / 1000)
103
+ let hold = try number(command, "holdMs", fallback: 50) / 1000
104
+ let dx = ((command["toX"] as? NSNumber)?.doubleValue ?? 0) - ((command["x"] as? NSNumber)?.doubleValue ?? 0)
105
+ let dy = ((command["toY"] as? NSNumber)?.doubleValue ?? 0) - ((command["y"] as? NSNumber)?.doubleValue ?? 0)
106
+ let velocity = XCUIGestureVelocity(rawValue: max(1, hypot(dx, dy) / duration))
107
+ start.press(forDuration: hold, thenDragTo: end, withVelocity: velocity, thenHoldForDuration: 0)
108
+ case "type":
109
+ guard let text = command["text"] as? String, text.count <= 4096 else { throw BridgeError.invalidCommand }
110
+ target.typeText(text)
111
+ case "key":
112
+ guard let key = command["key"] as? String else { throw BridgeError.invalidCommand }
113
+ if key == "Enter" || key == "Return" { target.typeText("\n") }
114
+ else if key == "Backspace" { target.typeText(XCUIKeyboardKey.delete.rawValue) }
115
+ else { throw BridgeError.invalidCommand }
116
+ default: throw BridgeError.invalidCommand
117
+ }
118
+ return [:]
119
+ }
120
+
121
+ func testServe() throws {
122
+ continueAfterFailure = false
123
+ guard let raw = ProcessInfo.processInfo.environment["RAVENSIGHT_MOBILE_URL"],
124
+ let url = URL(string: raw), url.scheme == "http", url.host == "127.0.0.1",
125
+ url.port != nil, url.user == nil, url.password == nil, url.query == nil,
126
+ url.lastPathComponent.count >= 16 else { throw BridgeError.invalidConfiguration }
127
+ baseURL = url
128
+ let bounds = UIScreen.main.bounds
129
+ _ = try request("ready", body: ["width": bounds.width, "height": bounds.height])
130
+ let deadline = Date().addingTimeInterval(3600)
131
+ var failures = 0
132
+ while Date() < deadline {
133
+ let command: [String: Any]
134
+ do { command = try request("next"); failures = 0 }
135
+ catch { failures += 1; if failures >= 3 { throw error }; Thread.sleep(forTimeInterval: 0.2); continue }
136
+ guard let id = command["id"] else { Thread.sleep(forTimeInterval: 0.05); continue }
137
+ if command["kind"] as? String == "shutdown" {
138
+ _ = try request("result", body: ["id": id, "ok": true])
139
+ return
140
+ }
141
+ do {
142
+ var result = try execute(command)
143
+ result["id"] = id
144
+ result["ok"] = true
145
+ _ = try request("result", body: result)
146
+ } catch {
147
+ _ = try request("result", body: ["id": id, "ok": false, "error": "native input failed: \(error)"])
148
+ }
149
+ }
150
+ throw BridgeError.deadline
151
+ }
152
+ }
@@ -0,0 +1,45 @@
1
+ name: RavensightMobile
2
+ options:
3
+ bundleIdPrefix: com.ravensight.mobile
4
+ deploymentTarget:
5
+ iOS: '17.0'
6
+ settings:
7
+ base:
8
+ SWIFT_VERSION: '5.0'
9
+ CODE_SIGNING_ALLOWED: NO
10
+ ENABLE_USER_SCRIPT_SANDBOXING: YES
11
+ TARGETED_DEVICE_FAMILY: '1,2'
12
+ targets:
13
+ RavensightMobile:
14
+ type: application
15
+ platform: iOS
16
+ sources: [Host]
17
+ settings:
18
+ base:
19
+ PRODUCT_BUNDLE_IDENTIFIER: com.ravensight.mobile.helper
20
+ GENERATE_INFOPLIST_FILE: YES
21
+ INFOPLIST_KEY_UILaunchScreen_Generation: YES
22
+ INFOPLIST_KEY_UIApplicationSceneManifest_Generation: YES
23
+ INFOPLIST_KEY_UISupportedInterfaceOrientations: 'UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight'
24
+ RavensightMobileUITests:
25
+ type: bundle.ui-testing
26
+ platform: iOS
27
+ sources: [UITests]
28
+ dependencies:
29
+ - target: RavensightMobile
30
+ settings:
31
+ base:
32
+ PRODUCT_BUNDLE_IDENTIFIER: com.ravensight.mobile.helper.tests
33
+ GENERATE_INFOPLIST_FILE: YES
34
+ TEST_TARGET_NAME: RavensightMobile
35
+ INFOPLIST_KEY_NSAppTransportSecurity_NSAllowsLocalNetworking: YES
36
+ schemes:
37
+ RavensightMobile:
38
+ build:
39
+ targets:
40
+ RavensightMobile: all
41
+ RavensightMobileUITests: [test]
42
+ test:
43
+ gatherCoverageData: false
44
+ targets:
45
+ - RavensightMobileUITests
package/docs/ADAPTERS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Connect a game to Ravensight Playtester
2
2
 
3
- **What can be playtested today:** web builds from any engine (`playwright_web`, on this machine or in the cloud) and Godot projects on this machine (`godot_driver`). Native builds (Unity, Unreal, desktop, iOS, Android) cannot be playtested today: the cloud accepts web builds only, and the native drivers below are experimental. Each needs a separate automation server that you run yourself and that Ravensight does not provide, and none has been tested against a real automation server. For a Unity game, build for the Web platform and playtest that web build.
3
+ **What can be playtested:** web builds from any engine (`playwright_web`, on this machine or in the cloud), Godot projects on this machine (`godot_driver`), and, since 0.12.0, Android builds in a local Android emulator and iOS Simulator builds in the iOS Simulator on a Mac (`android_driver` or `ios_driver` with `--native-build`, see [MOBILE.md](MOBILE.md)). The cloud accepts web builds only. Physical devices, desktop builds and Unreal builds cannot be playtested: the W3C drivers below are experimental, each needs a separate automation server that you run yourself and that Ravensight does not provide, and none has been tested against a real automation server. For a Unity desktop game, build for the Web platform and playtest that web build.
4
4
 
5
5
  Run the CLI on the machine that can access your build. Sign in, link the project with `ravensight-playtest init --game <gameId>`, and complete its expectations brief. `run` quotes the existing persona price before registration. Adapters share the same prepaid job, action limits, model budget, cancellation, reports and uploads.
6
6
 
@@ -10,7 +10,8 @@ Run the CLI on the machine that can access your build. Sign in, link the project
10
10
  | `godot_driver` | Godot project with the playtest addon | Existing addon protocol and runner tests |
11
11
  | `desktop_driver` | Local W3C/Appium session configuration | Experimental. Tested only against a stub; needs your own automation server |
12
12
  | `unity_driver`, `unreal_driver` | Desktop exports through that same W3C interface | Experimental. Engine-neutral screen controls, not editor plugins; untested against a real automation server. For Unity, export a web build instead |
13
- | `android_driver`, `ios_driver` | Appium device/emulator/simulator configuration | Experimental. Tested only against a stub; untested on a real automation server, device or simulator |
13
+ | `android_driver`, `ios_driver` with `--native-build` | An Android emulator APK or an iOS Simulator APP on this machine | Released in 0.12.0. Real emulator and simulator tests in the CLI's suite; see [MOBILE.md](MOBILE.md) |
14
+ | `android_driver`, `ios_driver` with `--driver-config` | Appium device/emulator/simulator configuration | Experimental. Tested only against a stub; untested on a real automation server, device or simulator |
14
15
  | `cli_stdio` | Developer-owned JSON-RPC bridge | Real child-process protocol test |
15
16
 
16
17
  No adapter promises every game is autonomously solvable. Fast action games, unusual controls, anti-cheat, hardware access and protected platforms may require a game-specific bridge. Console tooling and authorization remain the developer's responsibility. The runner cannot bypass platform access restrictions.
@@ -24,9 +25,9 @@ ravensight-playtest run --driver godot_driver --godot-project ./your-game
24
25
 
25
26
  `--controller freki` plays with Freki, the selecting playtester, when the server supports it. Screen interpretation proposes up to three actions and a separate selector chooses one. `--controller geri` plays with Geri, which chooses every action itself. When Freki is unsure, its most likely candidate (or the first action proposed for that screen) is played and the run goes on. Provider credentials stay on Ravensight. A completed playtest report is evidence for human review, not proof that a game is bug-free.
26
27
 
27
- ## Desktop and mobile (experimental)
28
+ ## Desktop and mobile through W3C (experimental)
28
29
 
29
- These drivers are not a supported way to playtest today. This section is the technical reference for anyone trying one; expect to adapt it, and tell us what you had to change.
30
+ For Android emulator and iOS Simulator builds, use `--native-build` instead ([MOBILE.md](MOBILE.md)). The W3C drivers in this section are not a supported way to playtest. This section is the technical reference for anyone trying one; expect to adapt it, and tell us what you had to change.
30
31
 
31
32
  Before anything else, `ravensight-playtest check --driver <name> --driver-config <file>` probes the automation server for free (status, a session with your capabilities, the app answering, the session closed), and `run` repeats that probe before it registers a paid native job. [NATIVE_RUNNER.md](NATIVE_RUNNER.md) is an untested, step by step iOS simulator starter with the expected `check` rows.
32
33
 
package/docs/MOBILE.md ADDED
@@ -0,0 +1,107 @@
1
+ # Native mobile playtests on this machine
2
+
3
+ Since 0.12.0, `ravensight-playtest` plays an Android build in a local Android emulator, or an iOS Simulator build in the iOS Simulator on a Mac. The persona sees the screen and plays with taps, double taps, long presses, straight drags and text, the same way it plays a web or Godot game. The game, the emulator and the video stay on this machine.
4
+
5
+ What it does not do: physical phones and tablets, App Store or device builds (`.ipa`), pinch, and pausing the game while the persona thinks. Cloud playtests (`hosted run`) still need a web build of the game.
6
+
7
+ ## Set up a test device
8
+
9
+ ### Android
10
+
11
+ Android needs the Android SDK with its emulator, platform-tools and build-tools. `ANDROID_HOME` or `ANDROID_SDK_ROOT` selects the SDK; the standard macOS and Linux SDK locations are also searched. `RAVENSIGHT_ADB`, `RAVENSIGHT_EMULATOR` and `RAVENSIGHT_AAPT` select a binary explicitly.
12
+
13
+ ```sh
14
+ sdkmanager --licenses
15
+ ravensight-playtest device setup android
16
+ ravensight-playtest device list
17
+ ravensight-playtest device boot Ravensight_Playtest_API35 --platform android
18
+ ```
19
+
20
+ `device setup android` asks before it downloads anything (about 1 to 2 GB). It installs the emulator and one API 35 system image, arm64 on Apple Silicon and x86_64 elsewhere, and creates one emulator named `Ravensight_Playtest_API35`. It never replaces an existing emulator of that name. It never accepts the Android SDK licenses for you: read and accept them first with `sdkmanager --licenses`, or setup stops and says so.
21
+
22
+ ### iOS (macOS only)
23
+
24
+ Install Xcode and an iOS Simulator runtime first.
25
+
26
+ ```sh
27
+ ravensight-playtest device setup ios
28
+ ravensight-playtest device list
29
+ ravensight-playtest device boot <UDID> --platform ios
30
+ ```
31
+
32
+ `device setup ios` builds the input helper that ships with the CLI (an XCTest runner) into the CLI's own folder. There is no separate automation server to install or run. The helper sends taps and text to the selected app only, never desktop mouse clicks. On its first run the simulator may need a visible window and Xcode's automation permission. `RAVENSIGHT_IOS_HELPER_DIR` selects a helper built elsewhere.
33
+
34
+ ### Video
35
+
36
+ Recording needs `ffmpeg` and `ffprobe` on this machine (`RAVENSIGHT_FFMPEG` and `RAVENSIGHT_FFPROBE` select them). With `--no-record-video` neither is needed.
37
+
38
+ ### Device commands
39
+
40
+ | Command | What it does |
41
+ |---|---|
42
+ | `device list` | Lists running Android emulators, Android virtual devices and iOS Simulators. `--json` for a machine readable list. |
43
+ | `device boot <name> --platform android\|ios` | Starts the exact emulator or simulator named. |
44
+ | `device shutdown <name> --platform android\|ios` | Stops it, unless a run is using it. Only stop what you started. |
45
+ | `device setup android\|ios` | Prepares a test device, as above. `--yes` answers the download question. |
46
+
47
+ ## Check, then play
48
+
49
+ Use an Android APK built for the emulator, or an iOS Simulator `.app`. `check` reads the build's package or bundle identifier and architecture, confirms the device is ready and the recording tools are present, then installs and opens the app once, reads its first screen and closes it. It starts no job and makes no model call.
50
+
51
+ ```sh
52
+ ravensight-playtest check --driver android_driver --native-build ./game.apk --device emulator-5554
53
+ ravensight-playtest run --driver android_driver --native-build ./game.apk --device emulator-5554
54
+
55
+ ravensight-playtest check --driver ios_driver --native-build ./Game.app --device <UDID>
56
+ ravensight-playtest run --driver ios_driver --native-build ./Game.app --device <UDID>
57
+ ```
58
+
59
+ | Flag | Effect |
60
+ |---|---|
61
+ | `--driver android_driver\|ios_driver` | Play on a local Android emulator or iOS Simulator. |
62
+ | `--native-build <path>` | The APK or the simulator APP to install and play. |
63
+ | `--device <id>` | The exact emulator serial or AVD name, or simulator UDID or name. A name that matches more than one device is refused. |
64
+ | `--package <id>` | Android only: the package you expect. Checked against the APK; it cannot point the run at another installed app. |
65
+ | `--bundle-id <id>` | iOS only: the bundle identifier you expect, checked the same way. |
66
+ | `--portrait`, `--landscape` | The orientation. Portrait is the default. |
67
+ | `--no-record-video` | Keep no video. |
68
+ | `--upload-video` | Upload the final video with the reports. Without it the video never leaves this machine. |
69
+
70
+ Your account, the game this folder is linked to, the brief, the price shown before you confirm and each run's model budget work as for any local persona run. Native runs use Geri, the default playtester. `run` repeats the free checks before it registers the job. `--skip-preflight` skips opening the game but never the build identity and architecture checks.
71
+
72
+ One run at a time uses a device: a run holds its device from the first check until the run is settled, and `device shutdown` refuses a device a run is using.
73
+
74
+ ## How a native run plays
75
+
76
+ - The game runs in real time, also while the playtester thinks. A short timer can run out before the next input arrives; a timer challenge it did not finish is not, by itself, a defect in the game. A finding or note that a game timer ran out, or left too little time, is moved out of the findings into a `[too_fast]` line under "What this run didn't cover", with how long the playtester took a turn, and `run` says what to add before the next run.
77
+ - Inputs use the coordinates of the screenshot the playtester was shown, with no crop. On Android the runner waits 700 milliseconds after an input before it captures the next screen.
78
+ - Taps, double taps, long presses and straight drags work on both platforms. Android text accepts printable ASCII without percent signs; iOS text goes to the focused keyboard. Pinch, held keys, drags with waypoints and pausing the game are refused as runner limits, never reported as defects in the game.
79
+ - Android's system Back (`key Back`) works even when the game draws no Back button; it may close a layer, go back or leave the app. iOS has no system Back through this runner, so the playtester uses the game's own buttons.
80
+ - A screenshot the playtester asks for is the exact image the runner kept. Only identical pictures reuse an earlier file.
81
+ - A native run makes no claim about audio, sensors, purchases, notifications, performance on a real device or replaying a run exactly.
82
+
83
+ When the game exits, an iOS run looks for a crash report that matches the selected simulator, the app, its process and the time of the run, and keeps a short `native-crash.json` summary, never other diagnostics from your Mac. Without a matching report, on iOS or Android, the run says the cause is unknown.
84
+
85
+ ## Project defaults and resuming
86
+
87
+ `.ravensight/config.json` can hold the defaults:
88
+
89
+ ```json
90
+ {
91
+ "driver": "android_driver",
92
+ "build": { "kind": "native_build", "ref": "./game.apk" },
93
+ "native": { "device": "emulator-5554", "orientation": "portrait" }
94
+ }
95
+ ```
96
+
97
+ Each job records the device and the build's hash. `resume` uses the same device and refuses a build that has changed; use a new job for another build or device. A resumed native run moves the earlier attempt's files under the job's `native-attempts/` folder and starts fresh evidence, so an earlier recording is never reused as new evidence.
98
+
99
+ A project whose build is `"kind": "driver_config"`, or a run given `--driver-config`, still uses the experimental W3C adapter in [NATIVE_RUNNER.md](NATIVE_RUNNER.md). An explicit `--native-build` overrides that default. Passing both `--native-build` and `--driver-config` is an error.
100
+
101
+ ## Video and privacy
102
+
103
+ The video is kept on this machine by default and uploaded only with `--upload-video`. The final `session.mp4` has its audio removed and is at most 15 minutes, 200 MB and 1280 by 720 pixels (720 by 1280 in portrait). The original captures stay on this machine for diagnosis and can include any sound the emulator recorded. `recording.json` lists the captures, the actual length and any gaps. Screenshots and the step log upload as for any local run, with the same opt out.
104
+
105
+ The recorder captures only the selected simulator or emulator display, so a notification or permission dialog shown there can appear in your local evidence.
106
+
107
+ The runner does not mark your app's own analytics as a playtest. Use a test build with analytics turned off, or configure your app's Ravensight SDK to mark these sessions synthetic.
@@ -1,6 +1,6 @@
1
- # Native runner starter: an iOS simulator app
1
+ # Legacy W3C native runner starter: an iOS simulator app
2
2
 
3
- > **Experimental, not a supported path:** native builds cannot be playtested today. The cloud accepts web builds only, `ios_driver` needs an automation server you run yourself (Ravensight does not provide one), and it has not been tested against a real one. What works today: web builds from any engine (`playwright_web`) and Godot projects locally (`godot_driver`).
3
+ > **Experimental W3C adapter guide.** This page covers `ios_driver --driver-config`, which needs an external W3C automation server and has not been validated against a real one. To playtest an iOS Simulator or Android emulator build, use `--native-build` instead: since 0.12.0 it needs no automation server and ships its own iOS input helper. See [MOBILE.md](MOBILE.md). Cloud runs accept web builds only.
4
4
 
5
5
  The smallest setup that should let a persona play a native or engine-exported iOS
6
6
  game on a simulator through `ios_driver`. Each step ends with the
@@ -9,7 +9,7 @@ reserves units or starts a job, so you can run it as often as you like.
9
9
 
10
10
  ## Read this first: what is and is not validated
11
11
 
12
- Native persona playtesting needs a local W3C automation server, and it is
12
+ The legacy adapter described here needs a local W3C automation server, and it is
13
13
  **not yet validated on real hardware or a real simulator session**. A game that
14
14
  already sends events through a Ravensight SDK is not, by that alone, something a
15
15
  persona can play: the SDK token covers telemetry, and the persona needs the
@@ -243,3 +243,7 @@ probe's own session would get in the way.
243
243
 
244
244
  One persona and a low `--max-actions` keep the first native run cheap while you
245
245
  find out what the persona can reach.
246
+
247
+ ## The supported native path
248
+
249
+ This page describes the experimental W3C route. The supported way to playtest an Android emulator or iOS Simulator build is `--native-build`, with the Android SDK tools or the iOS input helper that ships with the CLI. See [MOBILE.md](MOBILE.md). The install command and W3C setup above do not apply to it.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "ravensight-playtest",
3
- "version": "0.11.1",
3
+ "version": "0.13.0",
4
4
  "description": "Local AI playtests and seeded game simulations with reports in Ravensight.",
5
5
  "license": "MIT",
6
- "homepage": "https://ravensight.io/docs/#playtest",
6
+ "homepage": "https://ravensight.io/docs/playtest/",
7
7
  "bugs": {
8
8
  "email": "support@realityse.com"
9
9
  },
@@ -41,21 +41,23 @@
41
41
  "!test",
42
42
  "!src/run/__helpers__",
43
43
  "!src/run/__fixtures__",
44
- "!src/run/__fixtures__"
44
+ "!src/run/__fixtures__",
45
+ "docs/MOBILE.md"
45
46
  ],
46
47
  "exports": {
47
48
  ".": "./src/api/index.js",
48
49
  "./api": "./src/api/index.js"
49
50
  },
50
51
  "scripts": {
51
- "test": "node --test --test-reporter=spec 'src/**/!(godot-real|godot-draw.real|godot-inputs.real|godot-replay.real|godot-tester.real|web.e2e|web.containment.e2e|web.inputs.e2e|web.honesty.e2e|web.followups.e2e|web.replay.e2e|web.anygame.e2e|web.events.e2e|web.tester.e2e|scaffold.godot|template3d.godot).test.js'",
52
+ "test": "node --test --test-reporter=spec 'src/**/!(godot-real|godot-draw.real|godot-inputs.real|godot-replay.real|godot-tester.real|web.e2e|web.containment.e2e|web.inputs.e2e|web.honesty.e2e|web.followups.e2e|web.replay.e2e|web.anygame.e2e|web.events.e2e|web.tester.e2e|web.livesite.e2e|web.urlrun.e2e|scaffold.godot|template3d.godot).test.js'",
52
53
  "test:godot": "node scripts/gated-test.mjs RAVENSIGHT_RECORDING_E2E some -- --test --test-concurrency=1 --test-reporter=spec src/run/drivers/godot-real.test.js src/run/drivers/godot-draw.real.test.js src/run/drivers/godot-inputs.real.test.js src/run/drivers/godot-replay.real.test.js src/run/drivers/godot-tester.real.test.js src/create/scaffold.godot.test.js src/create/template3d.godot.test.js",
53
- "test:e2e": "node scripts/gated-test.mjs RAVENSIGHT_E2E all -- --test --test-reporter=spec src/run/drivers/web.e2e.test.js src/run/drivers/web.containment.e2e.test.js src/run/drivers/web.inputs.e2e.test.js src/run/drivers/web.honesty.e2e.test.js src/run/drivers/web.followups.e2e.test.js src/run/drivers/web.tester.e2e.test.js src/run/drivers/web.replay.e2e.test.js src/run/drivers/web.anygame.e2e.test.js src/run/drivers/web.events.e2e.test.js",
54
+ "test:e2e": "node scripts/gated-test.mjs RAVENSIGHT_E2E all -- --test --test-reporter=spec src/run/drivers/web.e2e.test.js src/run/drivers/web.containment.e2e.test.js src/run/drivers/web.inputs.e2e.test.js src/run/drivers/web.honesty.e2e.test.js src/run/drivers/web.followups.e2e.test.js src/run/drivers/web.tester.e2e.test.js src/run/drivers/web.replay.e2e.test.js src/run/drivers/web.anygame.e2e.test.js src/run/drivers/web.events.e2e.test.js src/run/drivers/web.livesite.e2e.test.js src/commands/run.urlrun.e2e.test.js",
54
55
  "lint": "node scripts/no-dashes.mjs",
55
- "audit:honesty": "node --test --test-reporter=spec src/run/honestyCorpus.test.js"
56
+ "audit:honesty": "node --test --test-reporter=spec src/run/honestyCorpus.test.js",
57
+ "test:android": "node scripts/gated-test.mjs RAVENSIGHT_ANDROID_E2E all -- --test --test-timeout=240000 --test-concurrency=1 src/run/drivers/mobile/native-real.test.js",
58
+ "test:ios": "node scripts/gated-test.mjs RAVENSIGHT_IOS_E2E all -- --test --test-timeout=240000 --test-concurrency=1 src/run/drivers/mobile/native-real.test.js"
56
59
  },
57
60
  "dependencies": {
58
- "@anthropic-ai/sdk": "^0.60.0",
59
61
  "ajv": "^8.17.1",
60
62
  "ajv-formats": "^3.0.1",
61
63
  "commander": "^13.0.0"
package/src/api/client.js CHANGED
@@ -500,5 +500,14 @@ export function createClient(options = {}) {
500
500
  runNotes: (gameId, buildSha256) => get(`${gameBase(gameId)}/memory/run-notes`, { query: { build_sha256: buildSha256 } })
501
501
  };
502
502
 
503
- return { apiUrl, token, cliVersion, request, cli, packs, brief, jobs, runs, labs, hosted, memory };
503
+ /**
504
+ * Live URL playtests: whether a host is verified for the game (stored state,
505
+ * then a fresh DNS check), asked before a local run against a public host.
506
+ * Answers `{ host, verified, domainId, code }`.
507
+ */
508
+ const url = {
509
+ checkDomain: (gameId, host) => get(`${gameBase(gameId)}/url/domains/check`, { query: { host } })
510
+ };
511
+
512
+ return { apiUrl, token, cliVersion, request, cli, packs, brief, jobs, runs, labs, hosted, memory, url };
504
513
  }