summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-06-09 12:06:14 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-09 12:06:14 +0200
commitcdbe39d0069b107ec0b2d77b262f108f06519199 (patch)
tree9806ace0d5e8a12b56999d901a56f3327125f77f
parentf5ecd1c100a9a09120f22ed9aa3d5753531ce360 (diff)
downloadnextcloud-server-cdbe39d0069b107ec0b2d77b262f108f06519199.tar.gz
nextcloud-server-cdbe39d0069b107ec0b2d77b262f108f06519199.zip
Properly check for the sidebar
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--tests/acceptance/features/apps.feature6
-rw-r--r--tests/acceptance/features/bootstrap/AppsManagementContext.php23
2 files changed, 26 insertions, 3 deletions
diff --git a/tests/acceptance/features/apps.feature b/tests/acceptance/features/apps.feature
index a7dd14d3fab..4881dfe9d8c 100644
--- a/tests/acceptance/features/apps.feature
+++ b/tests/acceptance/features/apps.feature
@@ -53,7 +53,7 @@ Feature: apps
And I am logged in as the admin
And I open the Apps management
When I click on the "QA testing" app
- Then I see that the sidebar is open
+ Then I see that the app details are shown
# TODO: Improve testing with app store as external API
# The following scenarios require the files_antivirus and calendar app
@@ -77,7 +77,7 @@ Feature: apps
And I open the Apps management
And I open the "Tools" section
When I click on the "Antivirus App for files" app
- Then I see that the sidebar is open
+ Then I see that the app details are shown
Scenario: Install an app from the app store
Given I act as Jane
@@ -85,6 +85,6 @@ Feature: apps
And I open the Apps management
And I open the "Office & text" section
And I click on the "Calendar" app
- And I see that the sidebar is open
+ And I see that the app details are shown
Then I download and enable the "Calendar" app
And I see that the "Calendar" app has been enabled
diff --git a/tests/acceptance/features/bootstrap/AppsManagementContext.php b/tests/acceptance/features/bootstrap/AppsManagementContext.php
index 117fb9b2c4b..b9896305182 100644
--- a/tests/acceptance/features/bootstrap/AppsManagementContext.php
+++ b/tests/acceptance/features/bootstrap/AppsManagementContext.php
@@ -106,6 +106,14 @@ class AppsManagementContext implements Context, ActorAwareInterface {
describedAs("Enable button in the app list");
}
+ /**
+ * @return Locator
+ */
+ public static function sidebar() {
+ return Locator::forThe()->id("app-sidebar")->
+ describedAs("Sidebar in apps management");
+ }
+
/**
* @When I enable the :app app
@@ -205,5 +213,20 @@ class AppsManagementContext implements Context, ActorAwareInterface {
PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle))->getValue());
}
+ /**
+ * @Given /^I see that the app details are shown$/
+ */
+ public function iSeeThatTheAppDetailsAreShown() {
+ // The sidebar always exists in the DOM, so it has to be explicitly
+ // waited for it to be visible instead of relying on the implicit wait
+ // made to find the element.
+ if (!WaitFor::elementToBeEventuallyShown(
+ $this->actor,
+ self::sidebar(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ PHPUnit_Framework_Assert::fail("The sidebar was not shown yet after $timeout seconds");
+ }
+ }
+
}