I'm currently automating an AngularJS application that uses basic authentication.
After each test, I need to delete cookies and restart my browser in order to login with a different user.
To achieve this, I am utilizing the browser.restart() method of Protractor.
However, every time I perform browser.restart(), I lose references to my basePage.js and eventually encounter the error message: 'This driver instance does not have a valid session ID'
The structure of my framework is as follows:
features
--feature1
pages
-page1.js
-page2.js
--basePage.js
step_definitions
--step1.js
support
--world.js
--hooks.js
I am using
- Cucumber-JS
- JavaScript language
- Page Object Model (POM)
- Protractor version 5
- Node.js
After researching various sources, I learned about reinitializing basePage.js in world.js so that its references are recreated. However, I'm struggling to understand how to do this?