Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

check_for_popup assumes the user only has 1 current window_handle. #173

Open
b4handjr opened this issue Dec 5, 2017 · 4 comments
Open

Comments

@b4handjr
Copy link
Collaborator

b4handjr commented Dec 5, 2017

Currently the function found here: https://github.com/mozilla/fxapom/blob/master/fxapom/pages/sign_in.py#L55 assumes that the user only has 1 window_handle. What if the user has more then 1?

The function should wait for their to be 1 additional window that has opened and assume that window is the popup.

@davehunt
Copy link
Member

davehunt commented Dec 6, 2017

As far as I can tell, we're checking for more than one handle, and then iterating through the handles to find the one containing the FxA sign-in. Are you saying the code is trying to find the window before the popup has shown? There's not currently a wait here, so I'm not sure what might cause this issue. Perhaps we should introduce a short wait to see if a new window is opened? Maybe you could provide some additional information.

@b4handjr
Copy link
Collaborator Author

b4handjr commented Dec 6, 2017

check_for_popup get initialized with the current window handles: self.check_for_popup(self.selenium.window_handles). Line 55 just checks if the amount of handles is greater than 1. If I already have 2 windows opened, it proceeds before the fxa popup window can actually open.

@davehunt
Copy link
Member

davehunt commented Dec 6, 2017

Right, but at no point do we wait for > 1 windows. I'd agree with you if we had a wait, and needed it to be original handles +1, but there is no wait.

@b4handjr
Copy link
Collaborator Author

b4handjr commented Dec 6, 2017

Yes I think a wait and a +1 would be perfect. I'll get a patch up later today PST time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants