-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: get all fields on the page then compare to story table #158
Comments
plocket/docassemble-ALAutomatedTestingTests#56 is related to this as well. [I think this was transferred to #159] |
https://docassemble.org/docs/api.html#manage_api For reference, I think this is using the above methodology: https://github.com/jhpyle/docassemble/blob/master/docassemble_demo/docassemble/demo/random-test.py [I'm not sure how we would load those pages into something that puppeteer can test for other things, such as terms working properly, etc. Maybe everything would have to be overhauled to parse the data/html of the |
For now, we can at least handle the most basic case - |
Experiments going on here: https://repl.it/@plocket/findi#index.js |
All the part leading up to the 'proxy' var (x, i, j, etc.) and sought variable logic are hard-coded, but here's a version that may fit better with our current data structure: https://repl.it/@plocket/index-vars#index.js |
I need a sanity check on the assumptions, but I think this method can overcome the current obstacle to automated testing. Summary of use:
Known assumptions include:
As linked above, see example implementation of proxy var logic. |
Re #158, temp fix for simple index_var detection
A suggestion has been raised to change If we were to do that, I think https://cheerio.js.org/ might be the way to go. |
As far as logic goes, the one confounding factor I can see for removing one column from the story table is the inability to literally set a checkbox to false. That is, to unselect a checkbox that has been selected by default. In the table, we can make a rule that to set something to false, you leave it out of the table completely. Anything absent from the table would be set to false. It does seem like it would be confusing to users, though. So. Not sure how to handle that. And not sure how to otherwise simplify the table. Maybe the only thing in the right-hand column are 'true' or 'false' (where needed)? Not sure how to name those columns to make that clear. I think we need some kind of simplification because the code involved in the refactor is otherwise getting a bit out of hand. Maybe that's not the true source of the problem, but that's my best guess right now. |
I think we do need 3 columns. It's a shame, but I think it's too unclear otherwise. If people want to actively unselect something, they'll probably want to have that in a table row. Alternative I'm working with now: The third column could be left blank when not needed. Everything else would be squeezed into the first two columns. I'm not sure if it'll work or not, but I'm giving it a shot in https://github.com/plocket/docassemble-cucumber/tree/158_proxy_parse. [This would move us into v2, of course.] |
#158 Start refactor for parsing proxies and other improvements
Updated issue to explicitly address and outline the code changes (v2) needed for this functionality. |
#158 custom continue buttons that are not yesno or yesnomaybe
#158 Add an test an action button that triggers an event
We can stick with v1 by supporting the previously used story table. |
#158, implement new code for live tests
#158 refactor (needs publishing) Handle proxy vars, fix signatures
The transfer has been completed and more thoroughly tested now. We should be good. |
Edit 2 (03/23):
Turning this into a reworking of the framework. This need was highlighted by the trouble calculating variable names of proxy variables (x, i, etc).
Changes
for v2:| var name | value | checked |
. We need another word forchecked
. This will make it much easier for developers to know what to put in each column. It will also make it more straightforward to check against those values. Not completely sure this part will work out.Refactors
for v2:Clean upThis is holding up this issue and really belongs in its own issue.scope.js
. Are there outdated functions in there? Do we need to split it into multiple files?Testing changes
for v2:Edit 1:
We may have to do a big refactor to account for this newly discovered situation. That may include getting rid of one column in the table. Which of the three columns in the table need what information is pretty confusing as it is anyway.
https://docassemble.org/docs/fields.html#index%20variables. Also relevant to generic objects: https://docassemble.org/docs/modifiers.html#generic%20object.
This poses a particular problem. DOM uses literally 'i', not var name. This is fine as long as the answers are as interchangeable as this implies. If the specific variables' answers matter later on, it's more of a problem. It also poses a problem for testing generated PDFs because the order in which the vars might be set is not controlled, so you have the potential of coming out with a different PDF just because of a small change. It wouldn't even make a difference if we sort the rows alphabetically or something. If the developer changes the name of the variable, it will get out of whack. What is the solution here?
A simple example:
your_past_benefits['State Veterans Benefits']
. Here we can just replace what's inside the brackets with an 'i'. If something gets more complicated (e.g.thing[i]['bar']
), orthing['bar'][i]
orthing[i][j]
do we create all combos?Trying to discuss this upstream.
The text was updated successfully, but these errors were encountered: