summaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-28 13:57:46 +0100
committerGitHub <noreply@github.com>2018-10-28 13:57:46 +0100
commit8c7432fa6df6df59464cace05195df3523a8d5e2 (patch)
tree2b28a80b1b9b6ce0577e3bf5b0ee0e3a41610b86 /tests/acceptance/features
parent13abee2836e00a91a7c2962920624f15f587e1cb (diff)
parentf844799d9b3a7f2430d4aaac075493a1de9bb686 (diff)
downloadnextcloud-server-8c7432fa6df6df59464cace05195df3523a8d5e2.tar.gz
nextcloud-server-8c7432fa6df6df59464cace05195df3523a8d5e2.zip
Merge pull request #12063 from nextcloud/bring-the-browser-window-of-an-actor-to-the-foreground-when-acting-as-him
Bring the browser window of an actor to the foreground when acting as him
Diffstat (limited to 'tests/acceptance/features')
-rw-r--r--tests/acceptance/features/bootstrap/FileListContext.php9
-rw-r--r--tests/acceptance/features/core/ActorContext.php8
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FileListContext.php b/tests/acceptance/features/bootstrap/FileListContext.php
index 6a39d7a999f..5206e6417de 100644
--- a/tests/acceptance/features/bootstrap/FileListContext.php
+++ b/tests/acceptance/features/bootstrap/FileListContext.php
@@ -295,6 +295,15 @@ class FileListContext implements Context, ActorAwareInterface {
$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");
}
diff --git a/tests/acceptance/features/core/ActorContext.php b/tests/acceptance/features/core/ActorContext.php
index 2cdc4b01ff1..81587e40682 100644
--- a/tests/acceptance/features/core/ActorContext.php
+++ b/tests/acceptance/features/core/ActorContext.php
@@ -164,6 +164,14 @@ class ActorContext extends RawMinkContext {
}
$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());
}
/**