Skip to content
GEMSARCADIA
▸ MANUAL CONTENTS(Testing & preview)
GEMS ARCADIA · COIN-OP SERVICE MANUAL · FORM GA-DEV-1SEC. 3.2

Testing & preview

Three ways to try your game without spending a real coin, from your desk to the real cabinet.

StageWhereCoinsInsertion ids
Mock modeindex.html opened outside the arcade9999, never spentmock_...
PreviewYour cabinet, from the portalFree: test-mode sessiontest_...
LiveThe arcade floor, after reviewReal coins from the player's walletins_... etc.

Mock mode (local development)#

Open your game's index.html directly, or from any static server, not inside an iframe. The SDK notices there is no arcade around it, logs a warning and runs in mock mode:

  • init() answers with a test player, testMode: true and 9999 coins;
  • insertCoin() always succeeds and never spends anything;
  • submitScore() answers { ok: true }.

Simulate the arcade from the browser console:

JS
GemsArcadia.mock.insertCoin(); // fires coinInserted + balanceChanged
GemsArcadia.mock.pause();
GemsArcadia.mock.resume();

Pass init({ debug: true }) to log every bridge message.

Pointing a local copy at a dev server#

The SDK only talks to the arcade's origin, which defaults to the origin the script was loaded from. If you serve your own copy of the SDK, say where the arcade is:

HTML
<script src="/sdk/v1.js" data-host="http://localhost:3000"></script>

Unit tests#

The SDK is plain JavaScript, so in tests you can stub the global with whatever answers you need. Our own sample game is tested this way (with Vitest and jsdom):

JS
globalThis.GemsArcadia = {
  init: async () => ({
    player: { ref: "pr_test", displayName: "Tester" },
    coinsPerCredit: 1,
    balance: 3,
    testMode: true,
  }),
  insertCoin: async () => ({ ok: false, reason: "INSUFFICIENT_COINS" }),
  on: () => () => {},
  ready: () => {},
};
const game = await import("./game.js");
await game.ready;

Preview mode (your real cabinet)#

After uploading a build, open your game in the developer portal, pick the Preview tab, choose a build and press PREVIEW. The game opens in the real player page inside the real sandbox, with a test-mode session:

  • init() reports testMode: true with your real balance;
  • insertions are free and never touch your wallet or your earnings;
  • insertion ids start with test_, and the verification API answers 404 for them (there's nothing to verify).

Previews work for unpublished builds too: only you (and arcade admins, while reviewing) can open them.

API keys for development#

Create a ga_test_... key for laptops and CI and a separate ga_live_... key for production, so you can revoke one without touching the other. Both read the same data today: the prefix is for your own bookkeeping.

REV 1.0 · KEEP THIS MANUAL WITH THE CABINET · QUESTIONS? ASK GLINT