"browser" is undefined in before-hook INSIDE globals #2895
Replies: 3 comments
-
The purpose of |
Beta Was this translation helpful? Give feedback.
-
As Ravi pointed out, it's not possible to use the |
Beta Was this translation helpful? Give feedback.
-
Random outsider here who stumbled upon ticket #1487 looking for something else. I'm not familiar with Nightwatch but read through the comment chain anyway and believe I understand what's desired enough to the extent that the actual tech involved doesn't matter. Sorry for resurrecting old thread if it's no longer relevant. It sounds to me like what is desired is just a "run this code dependent on let didRun = false
beforeEach(browser => {
// Effectively runs once before first test
if(!didRun) {
didRun = true
// TODO: the rest of the code, incl. the part that depends on browser...
}
}) This is perhaps not the most semantically cogent solution, but it at least doesn't require modifying library code for now. A more satisfying solution that allows for modifying library code would have the addition of a hook like // A new hook
afterSessionStart(browser => {
// TODO: the rest of the code
}) Of course name that one as appropriate... |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Issue got closed by bot and still is not resolved within 1.7.8
#1487
Your Environment
Beta Was this translation helpful? Give feedback.
All reactions