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

[stable14] Bring the browser window of an actor to the foreground when acting as him #12120

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/acceptance/features/bootstrap/FileListContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ public function iRenameTo($fileName1, $fileName2) {

$this->actor->find(self::renameMenuItem(), 2)->click();

// For reference, due to a bug in the Firefox driver of Selenium and/or
// maybe in Firefox itself, as a range is selected in the rename input
// (the name of the file, without its extension) when the value is set
// the window must be in the foreground. Otherwise, if the window is in
// the background, instead of setting the value in the whole field it
// would be set only in the selected range.
// This should not be a problem, though, as the default behaviour is to
// bring the browser window to the foreground when switching to a
// different actor.
$this->actor->find(self::renameInputForFile($this->fileListAncestor, $fileName1), 10)->setValue($fileName2 . "\r");
}

Expand Down
8 changes: 8 additions & 0 deletions tests/acceptance/features/core/ActorContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ public function iActAs($actorName) {
}

$this->currentActor = $this->actors[$actorName];

// Ensure that the browser window of the actor is the one in the
// foreground; this works around a bug in the Firefox driver of Selenium
// and/or maybe in Firefox itself when interacting with a window in the
// background, but also reflects better how the user would interact with
// the browser in real life.
$session = $this->actors[$actorName]->getSession();
$session->switchToWindow($session->getWindowName());
}

/**
Expand Down