OAuth consent opens a popup and my steps keep talking to the first tab
Asked 2,970 views1 answer
16votes
Clicking "Connect account" opens the provider's consent screen in a new tab. Everything after that in my scenario runs against the original tab, which is still sitting on the integrations page, so I get a timeout on the consent button.
Is there a step to switch tabs? I could not find one.
There is not — every UI step targets the scenario's page, and nothing in the shared library changes what that is. It is an open issue with a proposed tab step set, unwritten.
waitForPopup() on the base class is the hook. The important detail is that you have to be waiting before the click, or you race the popup:
Keep the whole popup interaction inside one project step. A step that leaves the scenario pointing at a different tab than it started with is the kind of thing that makes the next five steps in the feature file lie about where they are running.