Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage: Don't attempt to read cookies while an alert is open #6211

Merged
merged 2 commits into from May 28, 2021

Conversation

marcovtwout
Copy link
Contributor

@marcovtwout marcovtwout commented May 19, 2021

Fixes #1485

Please check and test this workaround thoroughly.

@Naktibalda
Copy link
Member

Naktibalda commented May 20, 2021

Wouldn't it be better to catch exception thrown by grabCookie?

@marcovtwout
Copy link
Contributor Author

marcovtwout commented May 20, 2021

@Naktibalda It's actually not grabCookie() that throws the exception. Calling grabCookie() (which internally calls WebDriver->manage()->getCookies()) unexpectedly dismisses the alert and execution continues. Then the next call in your acceptance tests such as $I->acceptPopup() will fail since the alert is no longer present.

@Naktibalda Naktibalda merged commit 91d6cb0 into Codeception:4.1 May 28, 2021
5 of 13 checks passed
@marcovtwout marcovtwout deleted the fix-1485 branch May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants