Open kreuka opened 9 months ago
Well, that's just how JavaScript (or any programming language for that matter) works... since test
is declared in global scope (in the context of the file), it will be accessible in all the functions declared or called in that file. And if one such function changes its value, it will be changed for all the functions that access it afterwards.
What you can do is reset the variable test
manually at the end or start of each test, but the function to reset should be mentioned in the same file so that it can access the test
variable.
@garg3133 But it worked in another way in the 2.2.3 version. It also seems to me that it violated the principle where each test should be completely independent
@kreuka we'll look into it in that case.
Description of the bug/issue
I can reuse the usual const/let variable from test number 1, in test number 2the
Steps to reproduce
No response
Sample test
Command to run
Verbose Output
Nightwatch Configuration
No response
Nightwatch.js Version
3.3.2
Node Version
18.21.0
Browser
No response
Operating System
No response
Additional Information
No response