index : btroops | |
Virtual board game-aid for BattleTroops, an infantry combat simulator wargame published by FASA in 1989. |
aboutsummaryrefslogtreecommitdiff |
diff options
author | Catalin Mititiuc <webdevcat@proton.me> | 2024-06-12 10:50:34 -0700 |
---|---|---|
committer | Catalin Mititiuc <webdevcat@proton.me> | 2024-06-12 11:24:14 -0700 |
commit | ac8eb25ac0b1d518beebe810e6430e375032028c (patch) | |
tree | dfcb005463cf4144d6874b768a6f88086d5be2b6 | |
parent | 16fc0bf7938071b400364d705f9ac859068be5f3 (diff) |
Add some 'load scenario' todo tests
-rw-r--r-- | esbuild-server.mjs | 6 | ||||
-rw-r--r-- | package.json | 4 | ||||
-rw-r--r-- | test/integration/loadScenario.test.js | 23 |
3 files changed, 29 insertions, 4 deletions
diff --git a/esbuild-server.mjs b/esbuild-server.mjs index bf73692..c269a52 100644 --- a/esbuild-server.mjs +++ b/esbuild-server.mjs @@ -259,7 +259,8 @@ if (process.env.NODE_ENV === 'test') { res.end("Not found"); } }).listen(3005, () => { - console.log('test server is online'); + const serverUrl = 'http://localhost:3005'; + console.log(`Test server running at ${serverUrl}`); }); } else { buildOptions.define = { 'window.IS_DEV': 'true' }; @@ -321,7 +322,8 @@ if (process.env.NODE_ENV === 'test') { req.pipe(proxyReq, { end: true }); } }).listen(8080, (e) => { - console.log('server is online', e); + const serverUrl = 'http://localhost:8080'; + console.log(`Development server running at ${serverUrl}`); }); } diff --git a/package.json b/package.json index 9c26357..e72df9b 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "selenium-webdriver": "^4.19.0" }, "scripts": { - "start": "node server.cjs", - "start:esbuildserver": "node esbuild-server.mjs", + "start": "node esbuild-server.mjs", + "start:esbuild-server": "node server.cjs", "test:integ": "node ./node_modules/.bin/jest --detectOpenHandles --config jest.config.integ.cjs", "test:integ:debug": "NODE_INSPECT_RESUME_ON_START=1 node inspect ./node_modules/jest/bin/jest.js --config jest.config.integ.cjs --runInBand", "test": "jest" diff --git a/test/integration/loadScenario.test.js b/test/integration/loadScenario.test.js new file mode 100644 index 0000000..645c5c2 --- /dev/null +++ b/test/integration/loadScenario.test.js @@ -0,0 +1,23 @@ +const { Builder } = require('selenium-webdriver'), + chrome = require('selenium-webdriver/chrome.js'), + chromeOptions = new chrome.Options(); + +chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox'); +chromeOptions.enableBidi(); + +let driver; + +beforeEach(async () => { + const builder = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions); + driver = builder.build(); +}); + +it.todo('loads default scenario on initial page load'); +it.todo('loads previously-loaded scenario on page refresh'); +it.todo('loads built-in scenario from dialog'); +it.todo('loads custom scenario directly from file'); +it.todo('loads saved scenario from file'); + +afterEach(async () => { + await driver.quit(); +}); |