Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

fix(tests): Add a helper function to close a window.#4038

Merged
vladikoff merged 2 commits intomasterfrom
issue-3902-closeCurrentWindow-helper
Aug 11, 2016
Merged

fix(tests): Add a helper function to close a window.#4038
vladikoff merged 2 commits intomasterfrom
issue-3902-closeCurrentWindow-helper

Conversation

@shane-tomlinson
Copy link

Use a helper function to close the current window and
go back to the original window. The window will only
be closed if it's not the last window.

fixes #3902

@vladikoff and @jrgm - r?

I am running the functional tests using Marionette with the mock-raven from #4013 (comment). So far, so good.

Use a helper function to close the current window and
go back to the original window. The window will only
be closed if it's not the last window.

fixes #3902
@shane-tomlinson
Copy link
Author

So far, so good.

Spoke too soon. In any case, here's a PR to do what was asked, use a helper to only close the window if it's not the last.

if (handles.length > 1) {
return this.parent
.closeCurrentWindow()
.switchToWindow(tabName || '');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shane-tomlinson should this throw if last window or no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never thought of that.

@shane-tomlinson shane-tomlinson force-pushed the issue-3902-closeCurrentWindow-helper branch from 219381a to 19b4802 Compare August 11, 2016 15:04
@vladikoff vladikoff merged commit 7a7785e into master Aug 11, 2016
@vladikoff
Copy link
Contributor

Yay!

@vladikoff vladikoff deleted the issue-3902-closeCurrentWindow-helper branch August 11, 2016 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: implement a utility function to close windows (and never close the last window).

2 participants