diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-12-21 20:14:38 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-12-21 20:14:38 +0100 |
commit | 4566670fa38c64fff020fe012e2bd33254f55b07 (patch) | |
tree | ea30447f71ab168f21a2f69e50b07efaa9820176 /tests/acceptance/features/bootstrap | |
parent | 1a887aaad006bdfc7f58f05756f0089292ebb8f0 (diff) | |
download | nextcloud-server-4566670fa38c64fff020fe012e2bd33254f55b07.tar.gz nextcloud-server-4566670fa38c64fff020fe012e2bd33254f55b07.zip |
Add acceptance tests for opening search results for comments
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features/bootstrap')
-rw-r--r-- | tests/acceptance/features/bootstrap/FileListContext.php | 19 | ||||
-rw-r--r-- | tests/acceptance/features/bootstrap/SearchContext.php | 16 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FileListContext.php b/tests/acceptance/features/bootstrap/FileListContext.php index 90d2aeebdc5..ee35de40c5e 100644 --- a/tests/acceptance/features/bootstrap/FileListContext.php +++ b/tests/acceptance/features/bootstrap/FileListContext.php @@ -90,6 +90,15 @@ class FileListContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function breadcrumbs($fileListAncestor) { + return Locator::forThe()->css("#controls .breadcrumb")-> + descendantOf($fileListAncestor)-> + describedAs("Breadcrumbs in file list"); + } + + /** + * @return Locator + */ public static function createMenuButton($fileListAncestor) { return Locator::forThe()->css("#controls .button.new")-> descendantOf($fileListAncestor)-> @@ -376,6 +385,16 @@ class FileListContext implements Context, ActorAwareInterface { } /** + * @Then I see that the file list is currently in :path + */ + public function iSeeThatTheFileListIsCurrentlyIn($path) { + // The text of the breadcrumbs is the text of all the crumbs separated + // by white spaces. + PHPUnit_Framework_Assert::assertEquals( + str_replace('/', ' ', $path), $this->actor->find(self::breadcrumbs($this->fileListAncestor), 10)->getText()); + } + + /** * @Then I see that it is not possible to create new files */ public function iSeeThatItIsNotPossibleToCreateNewFiles() { diff --git a/tests/acceptance/features/bootstrap/SearchContext.php b/tests/acceptance/features/bootstrap/SearchContext.php index 36331606883..d2d6b708067 100644 --- a/tests/acceptance/features/bootstrap/SearchContext.php +++ b/tests/acceptance/features/bootstrap/SearchContext.php @@ -74,6 +74,15 @@ class SearchContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function searchResultLink($number) { + return Locator::forThe()->css(".link")-> + descendantOf(self::searchResult($number))-> + describedAs("Link for search result $number"); + } + + /** * @When I search for :query */ public function iSearchFor($query) { @@ -81,6 +90,13 @@ class SearchContext implements Context, ActorAwareInterface { } /** + * @When I open the search result :number + */ + public function iOpenTheSearchResult($number) { + $this->actor->find(self::searchResultLink($number), 10)->click(); + } + + /** * @Then I see that the search result :number is :name */ public function iSeeThatTheSearchResultIs($number, $name) { |