Hey #Twine #Sugarcube users, I wrote a test configuration management doohickey! It's over at https://git.chromaticdragon.app/kistaro/sugarcube-test-config-manager/src/branch/main/test-config-manager.js -- paste it into your Story Javascript (like other Sugarcube add-ons) to use it.
Twine has a "Test From Here" button, but it doesn't have a built-in way to configure variables and history for a test run. You can write a passage to configure variables and add a link to where you want to start, but you have to rewrite it for every different start point and it doesn't edit your history.
To use Test Config Manager, create "test config" passages that do all the variable assignments you want for your test run. Tag test configs "test-config". Then whenever you start a test run, you'll have the option to "load" one test config -- Test Config Manager will "run" it and then reload the page you started on. So you can set up different player states and recycle them on many different start pages more easily. In-engine "Restart" will restart from your test start point and let you load a different config.
I also added a new macro, <<touch "passagename">>, which is only valid in test configs. This will insert "passagename" into your history, as though you had visited it. (It does not load or execute that page.) You can use <<goto>> macros (yes, multiple if you like!) inside your test config to actually visit and execute a page invisible during setup; you'll get redirected to your specified start page anyway.
The history tampering isn't perfect -- if you use `touch` or `goto` you'll wind up with a history that says you visited the starting page twice, which will affect various "have you only been here once?" things, and the starting page will always execute again after loading a config (so other calculated state changes will repeat). I can imagine a more complicated startup flow that would fix these; if there's demand for it I'll give it a try.
Anyway, feel free to use this in your Twine projects, and let me know if you run into any trouble -- I'd also love to know if you don't, I'm just curious to see if people use it! My partner has drafted a sci-fi Twine novel, which is novel-length, and I wrote it for zir because testing and stabilization has been a chore. But I'd love for more than zir to get use out of it! Folks better at JavaScript or jQuery than me (which is likely a lot of folks, I'm not a frontend dev at all) are also invited to suggest fixes or improvements.