I'm not sure these functions belong in scope. This file is just to make sure that the page and browser variables can be shared across the various test helper functions. These look like helper functions for the tests, and so they would fit into tests/features/support/steps.js or another file entirely.
Response:
Functions that are just in tests/features/support/steps.js are not accessible to the actual steps. I don't think they keep that context somehow. At least, it didn't work when I tried it, but maybe I did something wrong. For that reason, I had suspected it wouldn't work in other files, though I didn't try.
I think I also saw some examples out there that used scope for this kind of thing, but maybe they were bad examples. We can make this a research issue. If there's an established practice out there, I'm interested in learning more about it.
I'm not sure these functions belong in
scope
. This file is just to make sure that thepage
andbrowser
variables can be shared across the various test helper functions. These look like helper functions for the tests, and so they would fit intotests/features/support/steps.js
or another file entirely._Originally posted by @niharikasingh in https://github.com/SuffolkLITLab/docassemble-MAVirtualCourt/pull/597#discussion_r482635122_
Response: Functions that are just in
tests/features/support/steps.js
are not accessible to the actual steps. I don't think they keep that context somehow. At least, it didn't work when I tried it, but maybe I did something wrong. For that reason, I had suspected it wouldn't work in other files, though I didn't try.I think I also saw some examples out there that used
scope
for this kind of thing, but maybe they were bad examples. We can make this a research issue. If there's an established practice out there, I'm interested in learning more about it.