How to access global variable in global 'after' hook? #2758
Unanswered
kretschmannj
asked this question in
Help Needed
Replies: 1 comment
-
'this' won't work in the same way with fat arrow ("=>") functions Try changing your test steps where you are setting and printing "this" to the older function definition style . I think that should work for you function(blah){ this write up breaks it down nicely |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm creating a global variable in a globals.js file like so ...
When I run my tests, I'm appending values to the global variable like so ...
browser.globals.myGlobalVar = browser.globals.myGlobalVar + 'commercial_test\n'
How do I print out the value of the global variable to the console log at the very end of the test? I tried to use a global 'after' hook for this (defined in the globals.js) like so ...
However, that displays "undefined".
Beta Was this translation helpful? Give feedback.
All reactions