Closed thompsd3 closed 7 years ago
Should I not expect my method to be ran each time a session is generated?
No, the config is read once you start the test.
If not, is it possible to do this?
Just set a random number for each capability. Or use the beforeSession hook to set this unique cache id for each test individually.
Join our for these kind of questions. This is not necessary an issue.
@christian-bromann thanks for the suggestion to "use the beforeSession hook to set this unique cache id for each test individually". That is what worked for us. And I will be sure to appropriately direct my questions in the future.
Wanted to test out webdriverio for a project I'm working on because I've found it very easy to use myself as well as potentially easier to maintain on a cross functional team of developers. What I have is an application that is a wrapper around a browser and some tests I'm trying to convert to use webdriverio. I've gotten most of the POC work done and last thing is to work out is concurrency.
In the application, I have a cache that dictates which instance to use. By default the same instance is reused, however, within the capabilities, we run a method to generate a unique cache id in the capabilities similar to below.
The above code only runs
desktopCache.generateCacheId()
for the first test and the subsequent sessions all use the same id that was generated the first time rather than using a unique id for each. Should I not expect my method to be ran each time a session is generated? If not, is it possible to do this? Reason is because we need a unique cache id set for each test (similar to how we have maxInstances which allow chrome to generate unique sessions.