QA: Runtime::Browser.visit should either share single session or allow session to be resumed
The following discussion from !3893 (merged) should be addressed:
-
@brodock commented on a discussion: (+5 comments) I can't really use nested blocks, I tried that earlier. Somehow after the second
Runtime::Browser.visit
call it didn't work anymore.Something that may fix this is to make the session global, based on the spec, not on the block itself. So we start a session only per spec example.
I tried to do a quick fix but it would involve more lines than I was confortable to work as part of this MR (it would snowball into more specs etc).
Another idea was to spawn a fiber for each session and use it to jump and resume then, keeping the state alive for each one.
With fibers would be something like this:
Runtime::Browser.visit(:geo_primary, ...) do # first block Runtime::Browser.visit(:geo_secondary, ...) do # second block end end Runtime::Browser.visit(:geo_primary, ...) do #third block Runtime::Browser.visit(:geo_secondary, ...) do # fourth block end end
-
Runtime::Browser.visit(:geo_primary)
should be possible (defaulting page to/
when not informed). See discussion here: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3893#note_53144854