--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/f66cd19f-fe4b-4411-817a-1c4f97d6dc24n%40googlegroups.com.
Hi Marcin.
I am not sure you are following the Spock chat on Gitter. While talking to Jeremy there, I was looking into how Geb actually works. Result (I wrote much more there): It is a simple global Spock extension. But to my surprise, the Geb config is not read just once during extension start, but quite often, e.g. whenever the Geb test manager calls getBrowser in beforeTest, i.e. for each feature method in a Geb spec. By printing callstacks from the Geb config, this is easy to see.
So my question is: What is the reason for that? Are you expecting cases in which the Geb config changes during a JVM session? The driver configurations for multiple environments are closures, so they can be evaluated without re-reading the file. Any system properties defined there should also not depend on dynamic things like time stamps, random values or whatever.
Cheers
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/CA%2B52dQR8S536Wopv0-aajsjuSvD2tdiy2Mup2LJpqsoG-ZVgnw%40mail.gmail.com.
But to my surprise, the Geb config is not read just once during extension start, but quite often, e.g. whenever the Geb test manager calls getBrowser in beforeTest, i.e. for each feature method in a Geb spec
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/20220331091724.E73B378C0999%40dd19710.kasserver.com.
I can create an issue tomorrow or so. I might even create a PR, if you like. It might not be a great PR, given the fact that I do not know the Geb source code well and never have contributes to the project before, but I can give it a try. At least you have something to work with, or we have something to discuss and, if necessary, throw away and re-do better. Would a PR go on the current main branch or are you planning a special branch for the work on Geb 6?
--
Alexander Kriegisch
https://scrum-master.de
But to my surprise, the Geb config is not read just once during extension start, but quite often, e.g. whenever the Geb test manager calls getBrowser in beforeTest, i.e. for each feature method in a Geb specis not completely precise. Geb config is read whenever ConfigurationLoader.getConf() is called. It happens to be called via the parameterless constructor of Browser, which in turn is called for the first time getBrowser() is called on an instance of GebTestManager.All that aside, yes, Geb config is definitely read more often than it needs to be. There will definitely be a performance penalty to parsing and executing that script for every single test but this has worked like that since forever (I started contributing to Geb in 2010 and it's how it was back then) so changing this will be a breaking change. It will be fairly easy to change to only load the config once per GebTestManager instance but that would be a breaking change so would need to be done only in Geb 6 which might be coming soon due to switching to Selenium 4 which is not backwards compatible. If you feel like this would be worthwhile to change, Alexander, then please open an issue in the tracker and I will schedule it for Geb 6.
On Thu, Mar 31, 2022 at 10:17 AM Alexander Kriegisch <alex...@kriegisch.name> wrote:
I am not sure you are following the Spock chat on Gitter. While talking to Jeremy there, I was looking into how Geb actually works. Result (I wrote much more there): It is a simple global Spock extension. But to my surprise, the Geb config is not read just once during extension start, but quite often, e.g. whenever the Geb test manager calls getBrowser in beforeTest, i.e. for each feature method in a Geb spec. By printing callstacks from the Geb config, this is easy to see.
So my question is: What is the reason for that? Are you expecting cases in which the Geb config changes during a JVM session? The driver configurations for multiple environments are closures, so they can be evaluated without re-reading the file. Any system properties defined there should also not depend on dynamic things like time stamps, random values or whatever.
Marcin Erdmann schrieb am 31.03.2022 02:45 (GMT +07:00):
--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/20220412162153.C862478C0ECE%40dd19710.kasserver.com.