Git Product home page Git Product logo

Comments (4)

jhpyle avatar jhpyle commented on July 23, 2024

The only way I could think of to implement that would be to have a "testing default value" option for each field, so that in the testing mode, a default value is plugged in. Whether the interview actually gets to the question you want to test will depend on the values that have been input until that point.

One way around the problem you describe is to develop your interview in the playground and click "Save and Run" once so that you have an interview in another tab. Then navigate through the interview to the screen you want to edit. Then you make changes to the relevant question block in the interview YAML and click "Save." Then, go to the tab with the interview running in it and refresh the page with Ctrl-R. You will see the effect of the changes you made to the question, and you won't have to start at the beginning. There are some instances where this might not work, such as when you change mandatory code blocks that have already been executed in the test interview.

Another thing that might work is to install the iMacros browser extension and "record" yourself using the interview, starting with navigating to the URL of the interview with &reset=1. Then you can save that macro and double-click it in the iMacros sidebar every time you want to get to a certain place in an interview.

from docassemble.

jhpyle avatar jhpyle commented on July 23, 2024

See https://docassemble.org/docs/development.html#testing for a discussion of interview testing. The testing mechanism described, which uses lettuce and selenium, can be used to fast-forward to a particular place in an interview scenario.

Another suggestion for testing individual questions is to insert a mandatory: True code block at the start of the interview that runs force_ask('some_variable'), where some_variable is the name of a variable that is defined by the question you want to inspect. This will ask the minimum necessary questions to present the question to the user. It might not work in certain circumstances, such as questions from a middle of a list gathering process. See https://docassemble.org/docs/functions.html#force_ask

from docassemble.

nonprofittechy avatar nonprofittechy commented on July 23, 2024

These are great ideas for testing an interview for correctness. I do think that a lot of us would find it helpful to have a "test" button that just runs the code or asks the question in the current section of the YAML file, without requiring a mandatory instruction, while we are just debugging or learning the syntax of a question. What I have settled on doing now is copying the question, adding mandatory: true and the objects declaration from the beginning of the interview into a new yaml file. It's a fine workaround but it might be a really nice addition to the system to have that quick test/preview option.

Maybe the test button could simulate having the force_ask('some_variable') block at the beginning of the interview? Perhaps it's really two distinct options: a preview that just displays the question without asking the predecessor questions (using just the variable name for variables used in the question), and a test button that asks the minimum number of predecessor questions?

This isn't a high priority issue, but it would definitely speed up learning Docassemble and I think be a helpful addition to the Playground.

from docassemble.

jhpyle avatar jhpyle commented on July 23, 2024

I am going through old issues to close them. There are a variety of ways to fast-forward. At the end of the day, a docassemble interview interview is a computer program that raises an exception and then gets re-run with different input; there is no universal way to fast-forward through that.

from docassemble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.