Compare commits

...

262 Commits

Author SHA1 Message Date
Pacman Ghost 24106fb7e5 Updated the documentation. 4 weeks ago
Pacman Ghost 2b4bc9045a Updated for VASL 6.6.7 and VASSAL 3.7.5. 4 weeks ago
Pacman Ghost 71b07accd8 Disable the context help button in the title bar (Windows). 2 months ago
Pacman Ghost acdb8351ef Added a link to the repo issues page in the About box. 2 months ago
Pacman Ghost 5606fe0d1a Show a better error message if Java is not configured. 2 months ago
Pacman Ghost cb0369b85a Show the "Program Info" menu item in the desktop program. 2 months ago
Pacman Ghost fdaf2f0cde Added logging for testing different VASSAL+VASL combinations. 2 months ago
Pacman Ghost bb075ef0da Tidied up some test fixtures. 2 months ago
Pacman Ghost a30cbbb616 Applied errata from ASLJ 13 for when the KMC get black OBA numbers. 2 months ago
Pacman Ghost 3e7daad138 Use blue counters for some French ordnance. 2 months ago
Pacman Ghost 2c6f0f2ba3 Updated the dependencies. 2 months ago
Pacman Ghost 127c5d46e0 Updated the dependencies. 3 months ago
Pacman Ghost 4df0f5cf77 Updated the version number to v1.12. 8 months ago
Pacman Ghost 8269917bee Updated the documentation 8 months ago
Pacman Ghost a274775bf7 Updated for VASSAL 3.6.14 and VASL 6.6.6. 9 months ago
Pacman Ghost 1c28ba4373 Show a better error message if the VASL data directory is not there. 1 year ago
Pacman Ghost bc87c398bb Added options to configure logging when running Docker. 1 year ago
Pacman Ghost 1e72a57d8d Added options to store data files outside a Docker container. 1 year ago
Pacman Ghost 8b8c3b2698 Fixed how external links in the help are opened. 1 year ago
Pacman Ghost 51a5bcee90 Booby Trap labels are now associated with a player nationality. 1 year ago
Pacman Ghost 6f070eb17a Correctly flag pieces from extensions as small. 1 year ago
Pacman Ghost 21d7aa2b68 Tweaked the display format for the Docker build timestamp. 1 year ago
Pacman Ghost 632e0e7e6d Tweaked a Trumbowyg icon. 1 year ago
Pacman Ghost 2c02163c46 Don't automatically create THH labels. 1 year ago
Pacman Ghost 20739d78de Updated the version strings. 1 year ago
Pacman Ghost 19734ac076 Updated for VASSAL 3.6.7 and VASL 6.6.5. 1 year ago
Pacman Ghost 85b625d54e Updated links to point to pacman-ghost.com. 1 year ago
Pacman Ghost 446a53b32f Fixed a possible timing error during startup. 1 year ago
Pacman Ghost c7a002b1c6 Fixed a test to work inside a Docker container with no internet access. 1 year ago
Pacman Ghost 8172fa7070 Allow the Canadians to generate a PIAT snippet. 1 year ago
Pacman Ghost 330d05e47d Don't show the loading spinner if Javascript is disabled. 1 year ago
Pacman Ghost b285a044ab Updated the documentation. 1 year ago
Pacman Ghost c555614ac6 Updated the examples. 1 year ago
Pacman Ghost 618fe3bd68 Tweaked a log message. 1 year ago
Pacman Ghost 0b720dc8bc Automatically set up basic logging for the desktop app. 1 year ago
Pacman Ghost 499e5645bc When loading a scenario, forget the previous .vsav file used. 1 year ago
Pacman Ghost fc3e1110f8 Worked around a layout problem when the Victory Conditions are long. 1 year ago
Pacman Ghost 8388cec67e Added large flags to the WYSIWYG editor's dropdown. 1 year ago
Pacman Ghost 569edbc48a Added shortcuts for Alt-Shift-< and >. 1 year ago
Pacman Ghost db7fecbc39 Optimized searching for scenarios. 1 year ago
Pacman Ghost 380dae5559 Merged the Extras templates for Kampfgruppe Scherer. 1 year ago
Pacman Ghost e5ad66658a Set focus to the correct default button if there are nested dialogs. 1 year ago
Pacman Ghost c5e1e53df4 Extended the files/directories monitored for Flask hot-reloading. 1 year ago
Pacman Ghost d00d809877 Don't reset the current directory for saving/loading files on "new scenario". 1 year ago
Pacman Ghost c4c2010170 Updated the National Capabilities label for the Free French. 1 year ago
Pacman Ghost c2e0b48343 Added Alt-Click handlers. 1 year ago
Pacman Ghost 0e0df4e3a6 Tightened up some tests. 1 year ago
Pacman Ghost d78ac34c1f Handle missing landing craft Chapter H notes. 1 year ago
Pacman Ghost 05933ad753 Reset the HTML editor controls each time they are used. 1 year ago
Pacman Ghost f6e5081605 Adjusted the layout of the SCENARIO panel. 1 year ago
Pacman Ghost b31f64ed7f Show an indicator when an HTML textbox goes multi-line. 1 year ago
Pacman Ghost 2d317c57bd Moved the "edit template" buttons into a drop-down menu. 1 year ago
Pacman Ghost 941439a2ae Allowed Extras templates to set the width of their dropdown's. 1 year ago
Pacman Ghost 071b6f587d Stopped incorrectly detecting "split MG" v/o comments as having been changed. 1 year ago
Pacman Ghost 437865b47d Improved time-based comments in the Axis Minor nat.caps. snippets. 1 year ago
Pacman Ghost 650a6f86d4 Grouped notes in Nationality Capabilities snippets. 1 year ago
Pacman Ghost 0682dc1dca Added an Extras template for Booby Traps. 1 year ago
Pacman Ghost 4ae19ca212 Tightened up how we detect if HTML content has been changed. 1 year ago
Pacman Ghost e7888e88e0 Cached V/O note images for extensions are now saved in their own sub-directory. 1 year ago
Pacman Ghost 1294d0e3d2 Store config and data files in the standard locations. 1 year ago
Pacman Ghost fbcf4e9184 Confirm closing the EDIT V/O dialog if changes have been made. 1 year ago
Pacman Ghost 6d261032be Improved the keyboard interface in the TURN TRACK dialog. 1 year ago
Pacman Ghost 4629b3421b Only show custom list bullets in the UI if they have been enabled. 1 year ago
Pacman Ghost 53e14f753f Allow single-line textbox's to be edited as HTML. 1 year ago
Pacman Ghost a09286bc50 Include the build git info in the SCENARIO template. 1 year ago
Pacman Ghost 4762a36eb6 Removed code supporting Internet Explorer. 1 year ago
Pacman Ghost 23256bbc63 Tightened up some tests. 1 year ago
Pacman Ghost 2628105ea9 Minor UI tweaks. 1 year ago
Pacman Ghost 77b1bc9548 Allow SSR snippets to be auto-generated. 1 year ago
Pacman Ghost ee4d8fbe02 Fixed a problem when auto-generating a simple note snippet with no content. 1 year ago
Pacman Ghost 2ee42f37b5 Tightened up the presentation of lists in the UI and snippets. 1 year ago
Pacman Ghost 15c632b522 Sanitize HTML content. 1 year ago
Pacman Ghost c420c168d1 Added a WYSIWYG editor for HTML content. 1 year ago
Pacman Ghost d5021f7960 Added the ASA and ROAR ID's to the SCENARIO template. 1 year ago
Pacman Ghost daef7c1c15 Gave VASSAL tests more time to run. 1 year ago
Pacman Ghost b10105f2a7 Improved the positioning and sizing of dialogs. 1 year ago
Pacman Ghost 6b909a37eb Changed how flags are resized. 1 year ago
Pacman Ghost 7e070c3b68 Update the UI after importing an ASA scenario. 1 year ago
Pacman Ghost 0312fa2fc7 Confirm closing the "add/edit simple note" dialog if changes have been made. 1 year ago
Pacman Ghost 95167f4888 Allow snippets to be generated from the "add/edit simple note" dialog. 1 year ago
Pacman Ghost 2a707863d2 Fixed a timing error during startup. 1 year ago
Pacman Ghost 13a1b511e6 Added splitters to make some UI elements resizable. 1 year ago
Pacman Ghost a556d22117 Got 1/2" counters showing at the smaller size again. 1 year ago
Pacman Ghost a52e7f8ba9 Added a splitter to the "edit vehicle/ordnance" dialog. 1 year ago
Pacman Ghost fa5a99e87c Changed how Java is detected (and reported) from the PATH. 1 year ago
Pacman Ghost 7f17a634eb Updated some icons, tightened up the UI. 1 year ago
Pacman Ghost fbc420d4b3 Tightened up the player flags. 1 year ago
Pacman Ghost feebe9f63c Disable snippet-width textbox's when disabling snippet buttons. 1 year ago
Pacman Ghost e479bf2a76 Removed the "Width:" labels from the UI. 1 year ago
Pacman Ghost 520ea43d9d Tidy-up strings coming from ROAR and ASA. 1 year ago
Pacman Ghost ff0f40b22b Tightened up how we map ASA theaters to our own. 1 year ago
Pacman Ghost 55c15e5157 Made the compass label part of the default template pack. 1 year ago
Pacman Ghost 757c78dbd8 Removed the text caption from some snippet buttons. 1 year ago
Pacman Ghost 1079ac7e60 Got the LFA tests going again in Firefox. 1 year ago
Pacman Ghost d165bfdefd Allow multiple levels of shading in the turn track. 1 year ago
Pacman Ghost 729c6e306d Reset the turn track when importing a scenario. 1 year ago
Pacman Ghost cd831446fd Allow turn track squares to be shaded. 1 year ago
Pacman Ghost 40c2b87cbe Added a new extras template for the compass. 1 year ago
Pacman Ghost bc724e426d Removed the option to create National Capabilities labels. 1 year ago
Pacman Ghost c850bbd281 Tweaked the presentation of the "VASSAL shim error" dialog. 1 year ago
Pacman Ghost 42cad6f87c Fixed a resizing problem in the "connect to ROAR" dialog. 1 year ago
Pacman Ghost c363acb73e Added more padding to dialogs. 1 year ago
Pacman Ghost c5cdaf27dd Return a spacer image as a flag for nationalities that don't have one. 1 year ago
Pacman Ghost 0966c08dd4 Added the turn track template. 1 year ago
Pacman Ghost 3a5e472b36 Updated dependencies. 2 years ago
Pacman Ghost f93888c51b Updated the version strings. 2 years ago
Pacman Ghost 786f35be9a Added the Swedish nationality. 2 years ago
Pacman Ghost cde6649918 Added support for VASL 6.6.4 and VASSAL 3.6.6. 2 years ago
Pacman Ghost 0cbce2182c Report the VASSAL and VASL versions when analyzing .vsav files. 2 years ago
Pacman Ghost 0ab71fb70e Added some more logging to the VASSAL shim. 2 years ago
Pacman Ghost 560f2e3e65 Default to showing images in snippets, and using custom list bullets. 2 years ago
Pacman Ghost 7a0c4044e4 Fixed an error caused by the VASL .vmod not loading properly. 2 years ago
Pacman Ghost 5d425f2ded Allow logging to a file during tests. 2 years ago
Pacman Ghost 22274a6183 Improved the help. 2 years ago
Pacman Ghost 0cbe6435cf Completely hide the UI controls if there are no vehicles/ordnance. 2 years ago
Pacman Ghost dad7dab770 Made a new VO_NOTE_IMAGE_URL_PATH parameter available to templates. 2 years ago
Pacman Ghost 114db959bd Minor tweaks to the templates. 2 years ago
Pacman Ghost b497aa6e0f Stop the DOS box from showing when we launch the webdriver. 2 years ago
Pacman Ghost 27bb528312 Updated the flags for the Allied/Axis Minor nationalities. 2 years ago
Pacman Ghost d8c9d20e2c Added some comments. 2 years ago
Pacman Ghost 6f1dbae5c8 Set the location of the geckodriver log file during tests. 2 years ago
Pacman Ghost ba8a2d425b Tightened up how the test suite skips certain versions of VASL. 2 years ago
Pacman Ghost 32efa5b1c7 Updated the Chapter H placeholders ZIP file. 2 years ago
Pacman Ghost 82ab463eab Use different backend webdriver's when running the test suite. 2 years ago
Pacman Ghost fe3d30d2e2 Added the Partisan nationality. 2 years ago
Pacman Ghost 38399c355f Allow VASL versions to be aliased. 2 years ago
Pacman Ghost 5c19af124a Got the embedded browser in the desktop app going again on Fedora 35. 2 years ago
Pacman Ghost 7c4e01eeec Allow URL's for downloaded artifacts for the Docker image to be overridden. 2 years ago
Pacman Ghost aeb3eaf5c8 Updated dependencies. 2 years ago
Pacman Ghost 4288125a7a Added some comments. 2 years ago
Pacman Ghost 44e4ff53dd Got accelerator underlines to show properly on Windows. 2 years ago
Pacman Ghost 1584988476 Show the Java version in the Program Info dialog. 2 years ago
Pacman Ghost dc8a05a78b Show the nationality colors as a palette in the LFA color-picker. 2 years ago
Pacman Ghost cbc86e6fe8 Tightened up the Docker build. 2 years ago
Pacman Ghost 2946b2d10f Use waitress to serve the webapp. 2 years ago
Pacman Ghost 2fc57b88ac Updated the version strings. 2 years ago
Pacman Ghost a1613942d4 Added support for VASSAL 3.5.8 and VASL 6.6.3. 2 years ago
Pacman Ghost 315549cd21 Documented how config files get installed into the Docker container. 2 years ago
Pacman Ghost f4553ca42f Always show the Installation tab in the help. 2 years ago
Pacman Ghost 35c9ee5d53 Documented the Selenium fix. 2 years ago
Pacman Ghost cc09ba179e Show a better error message if we can't get the VASSAL version number. 2 years ago
Pacman Ghost 71d4396678 Fixed some issues in the PF template. 2 years ago
Pacman Ghost 9d7e5d400c Update the UI correctly when reseting a vehicle/ordnance. 2 years ago
Pacman Ghost 8bf314248e Convert file downloads to UTF-8 when running in a browser. 2 years ago
Pacman Ghost 692c7fd33b Changed how the Docker container gets its container ID. 2 years ago
Pacman Ghost 427a3d65c5 Updated all dependencies. 2 years ago
Pacman Ghost 19dc063830 Changed the comment for the Pz VIE SA mines. 2 years ago
Pacman Ghost f23329a3c1 Update SMOKE Depletion Numbers correctly for Elite units. 2 years ago
Pacman Ghost 903f2f29ff Show a splash screen during startup. 2 years ago
Pacman Ghost 4fd57b5e75 Updated the version strings. 2 years ago
Pacman Ghost b5d570ce7b Fixed a test to work with Docker. 2 years ago
Pacman Ghost 84c4757b51 Cache the VASSAL version. 2 years ago
Pacman Ghost 089e43f31e Added a cache for vehicle/ordnance note images. 2 years ago
Pacman Ghost 85a0085a8a Prevented a console warning if asl-rulebook2 has not been configured. 3 years ago
Pacman Ghost 4d15050d72 Added a comment about setting the UID/GID inside the Docker container. 3 years ago
Pacman Ghost b8347f2b68 Changed how logging is configured in a Docker container. 3 years ago
Pacman Ghost 1d17a7ecdf Added some webdriver options. 3 years ago
Pacman Ghost b8c68b916e Added a vehicle entry for the LCV. 3 years ago
Pacman Ghost 94f3a2b8d5 Updated the vehicle/ordnance data with information from the back of counters. 3 years ago
Pacman Ghost 5cdbc3195a Don't change vehicular smoke dispenser depletion #'s for elite status. 3 years ago
Pacman Ghost 8ab4f3c730 Updated the regex for extracting turn track events from a vlog. 3 years ago
Pacman Ghost f3ae34878c Added asl-rulebook2 integration. 3 years ago
Pacman Ghost 1d3af963df Updated the version strings. 3 years ago
Pacman Ghost 687a65e76a Install the correct version of Python into the Docker container. 3 years ago
Pacman Ghost c56438d958 Fixed a possible timing error in the tests. 3 years ago
Pacman Ghost 3a8385023b Fixed Chapter H URL's for derived nationalities. 3 years ago
Pacman Ghost 82f383d6c4 Added some missing entries to the Chapter H placeholder zip. 3 years ago
Pacman Ghost 5936567a98 Added a check for invalid nationalities in a save file. 3 years ago
Pacman Ghost 0bd780e7b5 Added Note D to the British OML 2-in. Mortars. 3 years ago
Pacman Ghost f414a758a0 Added support for VASSAL 3.5.5 and VASL 6.6.2. 3 years ago
Pacman Ghost 4c07d279da Changed the ANZAC nationality to be based on the British. 3 years ago
Pacman Ghost 70edc69cdb Added the Australian nationality. 3 years ago
Pacman Ghost 6dd6ed11ef Updated the version strings. 3 years ago
Pacman Ghost 54780b1b66 Worked around a problem when switching between LFA graph types. 3 years ago
Pacman Ghost a8cdec3a33 Show custom flags properly if they are a local file. 3 years ago
Pacman Ghost ca750fb3a0 Pass a generic PLAYER_NAT parameter through to the templates. 3 years ago
Pacman Ghost b97ffa1cf9 Added an optional caption to the "Count remaining" extras template. 3 years ago
Pacman Ghost 1baaa2ee88 Updated the help. 3 years ago
Pacman Ghost 547eeff344 Changed how we auto-adjust the LFA moving average window size. 3 years ago
Pacman Ghost 4bc29250d5 Fixed the SS-only stuff in the German National Capabilities template. 3 years ago
Pacman Ghost 1c71b22c8e Added a note in the help about spaces in image URL's. 3 years ago
Pacman Ghost a7f7b22a36 Manually added Allied Minor Ordnance Note D to the Chapter H placeholders. 3 years ago
Pacman Ghost c703f3850d Changed how the Docker container gets its ID. 3 years ago
Pacman Ghost 692ee500c2 Added anchors to the help. 3 years ago
Pacman Ghost db2562e9ca Updated the help. 3 years ago
Pacman Ghost 36fcc4f9a5 Allow the User Files directory to be configured as a URL. 3 years ago
Pacman Ghost b5f72c2b57 Fixed a broken test when running against a remote server. 3 years ago
Pacman Ghost dbc366feda Added support for the "in" operator in Jinja templates. 3 years ago
Pacman Ghost a6e314f592 Show the current git info in the Program Info dialog when running in a container. 3 years ago
Pacman Ghost 95b7c52be4 Fixed an encoding problem when uploading scenarios to the ASL Scenario Archive. 3 years ago
Pacman Ghost 284a8e7042 Added an endpoint to return the favicon. 3 years ago
Pacman Ghost 54ea61ed84 Set the SameSite attibute when saving cookies. 3 years ago
Pacman Ghost fdef89ddb4 Fixed how single-year date-specific capabilities are calculated. 3 years ago
Pacman Ghost a8b6e53369 Default to line graphs for the LFA distribution graohs. 3 years ago
Pacman Ghost 4321d0d866 Increased the default LFA time-plot window size. 3 years ago
Pacman Ghost 2cc5b3cad4 Fixed some incorrect online counter image URL's. 3 years ago
Pacman Ghost 189293add5 Include the PyQt UI files in the setup package. 3 years ago
Pacman Ghost 8d7dd3af57 Added a clarification to the OB notes for the Finnish 37 PstK/37(g). 3 years ago
Pacman Ghost ba813a0e56 On Windows, try to use the Java bundled with VASSAL. 3 years ago
Pacman Ghost bdd2d169a2 Allow log file analysis distribution graphs to be shown as line graphs. 3 years ago
Pacman Ghost 42f3105556 Worked around a problem reading ZIP files. 3 years ago
Pacman Ghost 79babdf421 Fixed a problem with how we serve some counter images. 3 years ago
Pacman Ghost 1cfbd080cd Allow boxes in the "Grid" extras template to be labelled. 3 years ago
Pacman Ghost 52e2bf2d24 Worked around a timing problem when showing the Program Info dialog. 3 years ago
Pacman Ghost 951b57c6be Updated to Python 3.8.7. 3 years ago
Pacman Ghost 8f7077a884 Updated the version strings. 3 years ago
Pacman Ghost a68ef5f871 Decompress GZIP'ed responses when downloading files. 3 years ago
Pacman Ghost 5cb6376bd2 Updated the help. 3 years ago
Pacman Ghost bc5cd8db43 Tidied up the Docker launcher script. 3 years ago
Pacman Ghost 48896113ae Handle tabs in snippet content. 3 years ago
Pacman Ghost 77171a0d18 Only translate relative image URL's in Chapter H notes. 3 years ago
Pacman Ghost 7e05a04cd4 Apply the default settings when running the desktop app. 3 years ago
Pacman Ghost 864466bbdd Adjusted the layout of dialogs in the desktop application for HiDPI. 3 years ago
Pacman Ghost f3e487d03d Handle encoding when reading text files. 3 years ago
Pacman Ghost c078dcafa2 Improved how we handle and report errors during startup. 3 years ago
Pacman Ghost 0dbf1b0186 Disabled an intermittent pylint warning. 3 years ago
Pacman Ghost e0edff9b16 Added a missing env.var. for the Docker container. 3 years ago
Pacman Ghost 0efccd37e7 Tweaked the CSS for <sub> (for Pz IVF 1 and 2). 3 years ago
Pacman Ghost da5ced479f Show a larger flag in label headings that use a larger font. 3 years ago
Pacman Ghost 540f770b3a Worked around a problem building the desktop application. 3 years ago
Pacman Ghost b23199228e Show the desktop build info in the Program Info dialog. 3 years ago
Pacman Ghost 2a8f5f97aa Changed when we disable the Flask startup banner. 3 years ago
Pacman Ghost 7b0cd3be51 Tightened up some National Capabilities labels. 3 years ago
Pacman Ghost 13fcd0f51c Tightened up how we handle volume paths when launching the Docker container. 3 years ago
Pacman Ghost 92e17a3aaf Added support for the "Fight For Seoul" extension. 3 years ago
Pacman Ghost 39415d9560 Changed the supported versions of VASSAL. 3 years ago
Pacman Ghost 476688407c Updated the help. 3 years ago
Pacman Ghost 571175eef5 Do a multi-stage build for Docker. 3 years ago
Pacman Ghost 8401753cb6 Pre-load the menu item images. 3 years ago
Pacman Ghost 41c24bb354 Re-ordered the comments for the Japanese & Chinese knee mortar. 3 years ago
Pacman Ghost a4108c8256 Clear a player's description when their nationality is changed. 3 years ago
Pacman Ghost 1c7cabb73e Fixed the vertical alignment of flags in dialog titlebars. 3 years ago
Pacman Ghost d56a9a3f7a Added icons to the File menu. 3 years ago
Pacman Ghost e5872248a6 Fixed a test that was failing on Windows. 3 years ago
Pacman Ghost 6d59d6244c Added a dialog to show the program info. 3 years ago
Pacman Ghost 97cf6fd196 Fixed a possible test failure. 3 years ago
Pacman Ghost 02d1aeb408 Re-architected the test suite. 3 years ago
Pacman Ghost 92ccfdccf9 Fixed reading template packs from a ZIP file. 3 years ago
Pacman Ghost ca50cd00c0 Fixed the logo fade-in when searching for scenarios. 3 years ago
Pacman Ghost 6068b1e444 Force "first request" initialization to be done after starting the web server. 3 years ago
Pacman Ghost 1963558ba9 Download the scenario index files continuously. 3 years ago
Pacman Ghost 6fe7a693c3 Changed some test output to use a logger. 3 years ago
Pacman Ghost e3c5add8e7 Tightened up how the scenario date is unloaded. 3 years ago
Pacman Ghost d28cd9ffaa Fixed how select2's are loaded in the User Settings dialog. 3 years ago
Pacman Ghost f65ed8033d Fixed a possible timing error in the tests. 3 years ago
Pacman Ghost c92f24d9b0 Tightened up the Dockerfile. 3 years ago
Pacman Ghost b22c714ec5 Got VASSAL running inside the Docker container. 3 years ago
Pacman Ghost ab1d3251d9 Improved how we handle problems downloading the scenario index files. 3 years ago
Pacman Ghost 8ffb0bef49 Disabled warnings for some BFP multi-applicable notes. 3 years ago
Pacman Ghost 83e035e734 Show Chapter H notes as an image for landing craft correctly. 3 years ago
Pacman Ghost 2e3fe92d2b Improved how we handle problems downloading the scenario index files. 3 years ago
Pacman Ghost 8742f7fb0f Added a report showing the number of 2's and 12's rolled, and SA's. 3 years ago
Pacman Ghost 11ea8b47c2 Removed the help from the VASSAL shim. 3 years ago
Pacman Ghost 9adbae0a8e Changed how the VASSAL shim saves scenarios. 3 years ago
Pacman Ghost ac62b9b98a Changed how the "LFA upload" dialog is sized. 3 years ago
Pacman Ghost 4e3ee7d08c Renamed a test support function. 3 years ago
Pacman Ghost 605c56c302 Added a mapping for the ASL Scenario Archive theater "CBI". 3 years ago
Pacman Ghost 7f4cbc8286 Ignore the day-of-month when checking the date for the OBA info card. 3 years ago
Pacman Ghost c34310191c Fixed a timing problem during startup. 3 years ago
Pacman Ghost 26722019be Added support for VASSAL 3.4.2-.7 and VASL 6.6.0-.1. 3 years ago
Pacman Ghost 7e102744ca Updated the version strings. 3 years ago
Pacman Ghost b6afc5ade3 Fixed a problem saving the generated ASA screenshot for upload. 3 years ago
  1. 1
      .dockerignore
  2. 100
      .pylintrc
  3. 81
      Dockerfile
  4. 2
      MANIFEST.in
  5. 9
      README.md
  6. BIN
      chapter-h/chapter-h-placeholders.zip
  7. 193
      conftest.py
  8. 1
      docker/config/.gitignore
  9. 5
      docker/config/debug.cfg
  10. 31
      docker/config/logging.yaml
  11. 1
      docker/config/site.cfg
  12. 7
      docker/run.sh
  13. BIN
      examples/Hill 621 (Scenario E) (online).vsav
  14. 32
      examples/Hill 621 (Scenario E).json
  15. BIN
      examples/Hill 621 (Scenario E).png
  16. BIN
      examples/Hill 621 (Scenario E).small.jpg
  17. BIN
      examples/Hill 621 (Scenario E).vsav
  18. BIN
      examples/Hube's Pocket (Scenario G) (online).vsav
  19. 30
      examples/Hube's Pocket (Scenario G).json
  20. BIN
      examples/Hube's Pocket (Scenario G).png
  21. BIN
      examples/Hube's Pocket (Scenario G).small.jpg
  22. BIN
      examples/Hube's Pocket (Scenario G).vsav
  23. 2
      examples/README.md
  24. BIN
      examples/The Streets Of Stalingrad (Scenario C) (online).vsav
  25. 30
      examples/The Streets Of Stalingrad (Scenario C).json
  26. BIN
      examples/The Streets Of Stalingrad (Scenario C).png
  27. BIN
      examples/The Streets Of Stalingrad (Scenario C).small.jpg
  28. BIN
      examples/The Streets Of Stalingrad (Scenario C).vsav
  29. 308
      freeze.py
  30. BIN
      loader/assets/loading.gif
  31. 107
      loader/freeze.py
  32. 207
      loader/main.py
  33. 13
      requirements-dev.txt
  34. 15
      requirements.txt
  35. 540
      run-container.sh
  36. 20
      setup.py
  37. 6
      tools/build_file.py
  38. 28
      vasl_templates/about.py
  39. 19
      vasl_templates/file_dialog.py
  40. 106
      vasl_templates/main.py
  41. 46
      vasl_templates/main_window.py
  42. 15
      vasl_templates/server_settings.py
  43. 6
      vasl_templates/tools/check_connect_roar.py
  44. 4
      vasl_templates/tools/dump_log_file_analysis.py
  45. 83
      vasl_templates/tools/get_piece_info.py
  46. 38
      vasl_templates/tools/make_chapter_h_placeholders.py
  47. 45
      vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt
  48. 3
      vasl_templates/tools/tests/test_make_chapter_h_placeholders.py
  49. 26
      vasl_templates/tools/webdriver_stress_test.py
  50. 73
      vasl_templates/ui/about.ui
  51. 26
      vasl_templates/ui/server_settings.ui
  52. 52
      vasl_templates/utils.py
  53. 4
      vasl_templates/web_channel.py
  54. 202
      vasl_templates/webapp/__init__.py
  55. 3
      vasl_templates/webapp/config/constants.py
  56. 10
      vasl_templates/webapp/config/debug.cfg.example
  57. 44
      vasl_templates/webapp/config/logging.yaml.example
  58. 6
      vasl_templates/webapp/config/site.cfg.example
  59. 2
      vasl_templates/webapp/data/asl-scenario-archive.json
  60. 9
      vasl_templates/webapp/data/default-template-pack/atmm-romanian.j2
  61. 4
      vasl_templates/webapp/data/default-template-pack/atmm.j2
  62. 12
      vasl_templates/webapp/data/default-template-pack/baz-cpva16.j2
  63. 12
      vasl_templates/webapp/data/default-template-pack/baz-cpva17.j2
  64. 16
      vasl_templates/webapp/data/default-template-pack/baz.j2
  65. 16
      vasl_templates/webapp/data/default-template-pack/baz45.j2
  66. 16
      vasl_templates/webapp/data/default-template-pack/baz50.j2
  67. 3
      vasl_templates/webapp/data/default-template-pack/common.css
  68. 5
      vasl_templates/webapp/data/default-template-pack/compass.j2
  69. 41
      vasl_templates/webapp/data/default-template-pack/extras/booby-traps.j2
  70. 6
      vasl_templates/webapp/data/default-template-pack/extras/count-remaining.j2
  71. 20
      vasl_templates/webapp/data/default-template-pack/extras/grid.j2
  72. 2
      vasl_templates/webapp/data/default-template-pack/extras/kakazu-ridge-cave-complexes.j2
  73. 87
      vasl_templates/webapp/data/default-template-pack/extras/kgs.j2
  74. 49
      vasl_templates/webapp/data/default-template-pack/extras/kgs/grenade-bundles.j2
  75. 57
      vasl_templates/webapp/data/default-template-pack/extras/kgs/molotov-cocktails.j2
  76. 2
      vasl_templates/webapp/data/default-template-pack/extras/victory-points.j2
  77. 14
      vasl_templates/webapp/data/default-template-pack/mol-p.j2
  78. 8
      vasl_templates/webapp/data/default-template-pack/mol.j2
  79. 17
      vasl_templates/webapp/data/default-template-pack/nat_caps.j2
  80. 242
      vasl_templates/webapp/data/default-template-pack/national-capabilities.json
  81. 23
      vasl_templates/webapp/data/default-template-pack/nationalities.json
  82. 2
      vasl_templates/webapp/data/default-template-pack/ob_ma_notes.j2
  83. 2
      vasl_templates/webapp/data/default-template-pack/ob_vo.j2
  84. 5
      vasl_templates/webapp/data/default-template-pack/ob_vo_note.css
  85. 2
      vasl_templates/webapp/data/default-template-pack/ob_vo_note.j2
  86. 21
      vasl_templates/webapp/data/default-template-pack/pf-finnish.j2
  87. 20
      vasl_templates/webapp/data/default-template-pack/pf-hungarian.j2
  88. 19
      vasl_templates/webapp/data/default-template-pack/pf-romanian.j2
  89. 30
      vasl_templates/webapp/data/default-template-pack/pf.j2
  90. 12
      vasl_templates/webapp/data/default-template-pack/piat.j2
  91. 2
      vasl_templates/webapp/data/default-template-pack/player_flag.include
  92. 2
      vasl_templates/webapp/data/default-template-pack/player_flag_large.include
  93. 4
      vasl_templates/webapp/data/default-template-pack/players.j2
  94. 12
      vasl_templates/webapp/data/default-template-pack/psk.j2
  95. 4
      vasl_templates/webapp/data/default-template-pack/scenario.j2
  96. 2
      vasl_templates/webapp/data/default-template-pack/ssr.j2
  97. 8
      vasl_templates/webapp/data/default-template-pack/thh.j2
  98. 116
      vasl_templates/webapp/data/default-template-pack/turn_track.j2
  99. 4
      vasl_templates/webapp/data/extensions/bfp-bj-v403.json
  100. 44
      vasl_templates/webapp/data/extensions/ffs.json
  101. Some files were not shown because too many files have changed in this diff Show More

@ -3,5 +3,6 @@
! setup.py
! requirements*.txt
! vasl_templates/
! vassal-shim/release/
! docker/
! LICENSE.txt

@ -7,7 +7,7 @@ extension-pkg-whitelist=PyQt5
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
ignore=generated
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
@ -18,7 +18,7 @@ ignore-patterns=
#init-hook=
# Use multiple processes to speed up Pylint.
jobs=1
jobs=4
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
@ -54,88 +54,14 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
invalid-unicode-literal,
disable=
raw-checker-failed,
bad-inline-option,
locally-disabled,
locally-enabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
bad-whitespace,
bad-continuation,
invalid-name,
wrong-import-position,
global-statement,
@ -144,7 +70,14 @@ disable=print-statement,
duplicate-code, # can't get it to shut up about @pytest.mark.skipif's :-/
no-else-return,
len-as-condition,
consider-using-enumerate
consider-using-enumerate,
import-outside-toplevel,
isinstance-second-argument-not-valid-type,
consider-using-f-string,
consider-using-max-builtin,
use-implicit-booleaness-not-comparison,
unnecessary-lambda-assignment,
duplicate-string-formatting-argument,
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
@ -289,13 +222,6 @@ max-line-length=120
# Maximum number of lines in a module
max-module-lines=1000
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
@ -511,7 +437,7 @@ max-public-methods=20
max-returns=10
# Maximum number of statements in function / method body
max-statements=80
max-statements=100
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
@ -554,4 +480,4 @@ known-third-party=enchant
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.Exception

@ -1,29 +1,49 @@
# NOTE: Use the run-container.sh script to build and launch this container.
# We do a multi-stage build (requires Docker >= 17.05) to install everything, then copy it all
# to the final target image.
# NOTE: Multi-stage builds require Docker >= 17.05.
FROM rockylinux:9.1 AS base
FROM centos:8 AS base
# update packages and install Python
# update packages and install requirements
RUN dnf -y upgrade-minimal && \
dnf install -y python36 && \
dnf clean all
dnf install -y python3.11
# NOTE: We don't need the following stuff for the build step, but it's nice to not have to re-install
# it all every time we change the requirements :-/
# install Java
RUN dnf install -y java-17-openjdk
# install Firefox
# NOTE: We could install this using dnf, but the version of geckodriver needs to match it.
ARG FIREFOX_URL=https://ftp.mozilla.org/pub/firefox/releases/117.0.1/linux-x86_64/en-US/firefox-117.0.1.tar.bz2
RUN dnf install -y bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \
curl -s "$FIREFOX_URL" | tar -jx -C /usr/local/ && \
ln -s /usr/local/firefox/firefox /usr/bin/firefox && \
echo "exclude=firefox" >>/etc/dnf/dnf.conf
# install geckodriver
ARG GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz
RUN curl -sL "$GECKODRIVER_URL" | tar -xz -C /usr/bin/
# clean up
RUN dnf clean all
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FROM base AS build
# set up a virtualenv
RUN python3.6 -m venv /opt/venv
RUN python3.11 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip
# install the application requirements
COPY requirements.txt requirements-dev.txt ./
RUN pip install -r requirements.txt
ARG ENABLE_TESTS
RUN if [ "$ENABLE_TESTS" ]; then pip install -r requirements-dev.txt ; fi
COPY requirements.txt requirements-dev.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt
ARG CONTROL_TESTS_PORT
RUN if [ -n "$CONTROL_TESTS_PORT" ]; then \
pip3 install -r /tmp/requirements-dev.txt \
; fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -33,31 +53,34 @@ FROM base
COPY --from=build /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# install Firefox
RUN dnf install -y wget bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib
RUN wget -qO- "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US" | tar -C /usr/local/ -jx && \
ln -s /usr/local/firefox/firefox /usr/bin/firefox && \
echo "exclude=firefox" >> /etc/dnf/dnf.conf
# install geckodriver
RUN url=$( curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep -Eoh 'https.*linux64\.tar\.gz' ) && \
curl -sL "$url" | tar -C /usr/bin/ -xz
# install the application
WORKDIR /app
COPY vasl_templates vasl_templates
COPY vasl_templates/ ./vasl_templates/
COPY vassal-shim/release/vassal-shim.jar ./vassal-shim/release/
COPY setup.py requirements.txt requirements-dev.txt LICENSE.txt ./
RUN pip install -e .
RUN pip3 install --editable .
# copy the config files
COPY docker/config/* vasl_templates/webapp/config/
ARG ENABLE_TESTS
RUN if [ "$ENABLE_TESTS" ]; then echo "ENABLE_REMOTE_TEST_CONTROL = 1" >>vasl_templates/webapp/config/debug.cfg ; fi
# install the config files
COPY vasl_templates/webapp/config/logging.yaml.example ./vasl_templates/webapp/config/logging.yaml
COPY docker/config/ ./vasl_templates/webapp/config/
# create a new user
# NOTE: It would be nice to just specify the UID/GID in the "docker run" command, but VASSAL has problems
# if there is no user :-/ We could specify these here, but that would bake them into the image.
# In general, this is not a problem, since the application doesn't need to access files outside the container,
# but if the user wants to e.g. keep the cached scenario index files outside the container, and they are
# running with a non-default UID/GID, they will have to manage permissions themselves. Sigh...
RUN useradd --create-home app
USER app
# FUDGE! We need this to stop spurious warning messages:
# Fork support is only compatible with the epoll1 and poll polling strategies
# Setting the verbosity to ERROR should suppress these, but doesn't :-/
# https://github.com/grpc/grpc/issues/17253
# https://github.com/grpc/grpc/blob/master/doc/environment_variables.md
ENV GRPC_VERBOSITY=NONE
# run the application
EXPOSE 5010
COPY docker/run.sh .
COPY docker/run.sh ./
CMD ./run.sh

@ -1,3 +1,5 @@
recursive-include vasl_templates/ui *.*
recursive-include vasl_templates/webapp/config *.*
recursive-include vasl_templates/webapp/data *.*
recursive-include vasl_templates/webapp/static *.*

@ -1,16 +1,14 @@
# VASL Templates
<a href="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/hill-621.png" target="_blank">
<img src="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/hill-621.small.png" width="200" align="right" hspace="10">
</a>
[<img src="vasl_templates/webapp/static/help/images/hill-621.small.png" width="200" align="right" hspace="10">](vasl_templates/webapp/static/help/images/hill-621.png)
*VASL Templates* makes it easy to set up attractive VASL scenarios, with loads of useful information embedded to assist with game play.
Simply enter the scenario information into the UI, and the program will generate HTML snippets that you can transfer into VASL labels in your scenario.
<img src="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/ob_setup.png" width="200">
[<img src="vasl_templates/webapp/static/help/images/ob_setup.png" width="200">](vasl_templates/webapp/static/help/images/ob_setup.png)
You can find more examples of the program in action [here](https://github.com/pacman-ghost/vasl-templates/tree/master/examples/).
You can find more examples of the program in action [here](examples/).
### Documentation
@ -20,3 +18,4 @@ You can find more examples of the program in action [here](https://github.com/pa
* [Setting up Chapter H data](https://vasl-templates.org/help?tab=chapterh)
* [Writing your own templates](https://vasl-templates.org/help?tab=templatepacks)
* [For developers](https://vasl-templates.org/help?tab=fordevelopers)
* [FAQ](https://vasl-templates.org/FAQ)

@ -1,21 +1,25 @@
""" pytest support functions. """
import os
import shutil
import threading
import logging
import json
import re
import tempfile
import logging
import urllib.request
from urllib.error import URLError
import pytest
from flask import url_for
from vasl_templates.webapp import app
app.testing = True
from vasl_templates.webapp.tests import utils
from vasl_templates.webapp.tests.control_tests import ControlTests
FLASK_WEBAPP_PORT = 5011
_pytest_options = None
_orig_url_for = app.url_for
# ---------------------------------------------------------------------
def pytest_addoption( parser ):
@ -25,7 +29,7 @@ def pytest_addoption( parser ):
# add test options
parser.addoption(
"--server-url", action="store", dest="server_url", default=None,
"--webapp", action="store", dest="webapp_url", default=None,
help="Webapp server to test against."
)
# NOTE: Chrome seems to be ~15% faster than Firefox, headless ~5% faster than headful.
@ -38,7 +42,7 @@ def pytest_addoption( parser ):
help="Run the tests headless."
)
parser.addoption(
"--window-size", action="store", dest="window_size", default="1000x700",
"--window-size", action="store", dest="window_size", default="1020x700",
help="Browser window size."
)
@ -48,31 +52,6 @@ def pytest_addoption( parser ):
help="Run a shorter version of the test suite."
)
# NOTE: Some tests require the VASL module file(s). We don't want to put these into source control,
# so we provide this option to allow the caller to specify where they live.
parser.addoption(
"--vasl-mods", action="store", dest="vasl_mods", default=None,
help="Directory containing the VASL .vmod file(s)."
)
parser.addoption(
"--vasl-extensions", action="store", dest="vasl_extensions", default=None,
help="Directory containing the VASL extensions."
)
# NOTE: Some tests require VASSAL to be installed. This option allows the caller to specify
# where it is (multiple installations can be placed in sub-directories).
parser.addoption(
"--vassal", action="store", dest="vassal", default=None,
help="Directory containing VASSAL installation(s)."
)
# NOTE: Some tests require Chapter H vehicle/ordnance notes. This is copyrighted material,
# so it is kept in a private repo.
parser.addoption(
"--vo-notes", action="store", dest="vo_notes", default=None,
help="Directory containing Chapter H vehicle/ordnance notes and test results."
)
# NOTE: It's not good to have the code run differently to how it will normally,
# but using the clipboard to retrieve snippets causes more trouble than it's worth :-/
# since any kind of clipboard activity while the tests are running could cause them to fail
@ -82,16 +61,53 @@ def pytest_addoption( parser ):
help="Use the clipboard to get snippets."
)
# ---------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def pytest_configure( config ):
"""Called after command-line options have been parsed."""
global _pytest_options
_pytest_options = config.option
import vasl_templates.webapp.tests
vasl_templates.webapp.tests.pytest_options = config.option
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@pytest.fixture( scope="session" )
def monkeypatch():
"""Override the default monkeypatch fixture."""
assert False, "Don't use monkeypatch!" # it won't work when testing against a remote server
# ---------------------------------------------------------------------
_webapp = None
@pytest.fixture( scope="function" )
def webapp():
"""Launch the webapp."""
# get the global webapp fixture
global _webapp
if _webapp is None:
_webapp = _make_webapp()
# reset the remote webapp server
_webapp.control_tests.start_tests()
# return the webapp to the caller
yield _webapp
# reset the remote webapp server
_webapp.control_tests.end_tests()
def _make_webapp():
"""Create the global webapp fixture."""
# initialize
server_url = pytest.config.option.server_url #pylint: disable=no-member
app.base_url = server_url if server_url else "http://localhost:{}".format(FLASK_WEBAPP_PORT)
logging.disable( logging.CRITICAL )
webapp_url = _pytest_options.webapp_url
if webapp_url and not webapp_url.startswith( "http://" ):
webapp_url = "http://" + webapp_url
app.base_url = webapp_url if webapp_url else "http://localhost:{}".format( FLASK_WEBAPP_PORT )
_disable_console_logging()
# initialize
# WTF?! https://github.com/pallets/flask/issues/824
@ -105,32 +121,44 @@ def webapp():
# stop the browser from checking for a dirty scenario when leaving the page
kwargs["disable_close_window_check"] = 1
# check if the tests are being run headless
if pytest.config.option.headless: #pylint: disable=no-member
if _pytest_options.headless:
# yup - there is no clipboard support :-/
pytest.config.option.use_clipboard = False #pylint: disable=no-member
_pytest_options.use_clipboard = False
# check if we should disable using the clipboard for snippets
if not pytest.config.option.use_clipboard: #pylint: disable=no-member
if not _pytest_options.use_clipboard:
# NOTE: It's not a bad idea to bypass the clipboard, even when running in a browser,
# to avoid problems if something else uses the clipboard while the tests are running.
kwargs["store_clipboard"] = 1
url = url_for( endpoint, _external=True, **kwargs )
if kwargs.get( "_external" ) is None:
kwargs["_external"] = True
url = _orig_url_for( endpoint, **kwargs )
url = url.replace( "http://localhost", app.base_url )
return url
app.url_for = make_webapp_url
# check if we need to start a local webapp server
if not server_url:
if not webapp_url:
# yup - make it so
# NOTE: We run the server thread as a daemon so that it won't prevent the tests from finishing
# when they're done. We used to call $/shutdown after yielding the webapp fixture, but when
# we changed it from being per-session to per-function, we can no longer do that.
# This means that the webapp doesn't get a chance to shutdown properly (in particular,
# clean up the gRPC service), but since we send an EndTests message at the of each test,
# the remote server gets a chance to clean up then. It's not perfect (e.g. if the tests fail
# or otherwise finish early before they get a chance to send the EndTests message), but
# we can live with it.
thread = threading.Thread(
target = lambda: app.run( host="0.0.0.0", port=FLASK_WEBAPP_PORT, use_reloader=False )
target = lambda: app.run( host="0.0.0.0", port=FLASK_WEBAPP_PORT, use_reloader=False ),
daemon = True
)
thread.start()
# wait for the server to start up
def is_ready():
"""Try to connect to the webapp server."""
try:
resp = urllib.request.urlopen( app.url_for("ping") ).read()
assert resp.startswith( b"pong: " )
url = app.url_for( "ping" )
with urllib.request.urlopen( url ) as resp:
assert resp.read().startswith( b"pong: " )
return True
except URLError:
return False
@ -138,20 +166,41 @@ def webapp():
assert False, "Unexpected exception: {}".format(ex)
utils.wait_for( 5, is_ready )
# return the server to the caller
yield app
# set up control of the remote webapp server
try:
url = app.url_for( "get_control_tests" )
with urllib.request.urlopen( url ) as resp:
resp_data = json.load( resp )
except urllib.error.HTTPError as ex:
if ex.code == 404:
raise RuntimeError( "Can't get the test control port - has remote test control been enabled?" ) from ex
raise
port_no = resp_data.get( "port" )
if not port_no:
raise RuntimeError( "The webapp server is not running the test control service." )
mo = re.search( r"^http://(.+):\d+$", app.base_url )
addr = "{}:{}".format( mo.group(1), port_no )
app.control_tests = ControlTests( addr )
# NOTE: We set the back-end webdriver to be the of the same type (Firefox or Chrome) as the browser
# being used to drive the tests, which, strictly speaking, doesn't make sense, since the two things
# don't have anything to do with each other. However, this is a convenient way to switch the backend
# webdriver's and exercise both of them. The webdriver binary must be on the path, but if it's not,
# we won't have even got this far, since it needs to be there to drive the browser.
# NOTE: This will have no effect if we're talking to a remote server, but we can live with that.
if _pytest_options.webdriver == "firefox":
app.config[ "WEBDRIVER_PATH" ] = shutil.which( "geckodriver" )
elif _pytest_options.webdriver == "chrome":
app.config[ "WEBDRIVER_PATH" ] = shutil.which( "chromedriver" )
# shutdown the local webapp server
if not server_url:
urllib.request.urlopen( app.url_for("shutdown") ).read()
thread.join()
return app
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@pytest.fixture( scope="session" )
def test_client():
"""Return a test client that can be used to connect to the webapp."""
logging.disable( logging.CRITICAL )
_disable_console_logging()
return app.test_client()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -170,30 +219,24 @@ def webdriver( request ):
driver = request.config.getoption( "--webdriver" )
from selenium import webdriver as wb
if driver == "firefox":
options = wb.FirefoxOptions()
options.set_headless( headless = pytest.config.option.headless ) #pylint: disable=no-member
driver = wb.Firefox(
firefox_options = options,
log_path = os.path.join( tempfile.gettempdir(), "geckodriver.log" )
service = wb.firefox.service.Service(
log_output = os.path.join( tempfile.gettempdir(), "webdriver-pytest.log" )
)
options = wb.FirefoxOptions()
if _pytest_options.headless:
options.add_argument( "--headless" )
driver = wb.Firefox( options=options, service=service )
elif driver == "chrome":
options = wb.ChromeOptions()
options.set_headless( headless = pytest.config.option.headless ) #pylint: disable=no-member
driver = wb.Chrome( chrome_options=options )
elif driver == "ie":
# NOTE: IE11 requires a registry key to be set:
# https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration
options = wb.IeOptions()
if pytest.config.option.headless: #pylint: disable=no-member
raise RuntimeError( "IE WebDriver cannot be run headless." )
options.IntroduceInstabilityByIgnoringProtectedModeSettings = True
options.EnsureCleanSession = True
driver = wb.Ie( ie_options=options )
if _pytest_options.headless:
options.add_argument( "--headless" )
options.add_argument( "--disable-gpu" )
driver = wb.Chrome( options=options )
else: