aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-03-05 21:33:29 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-03-08 07:55:43 +0000
commit270db2f523a5027444781107709714d66c8543a4 (patch)
tree155a786796bf977839c7355c7e6bd64020d79a29
parent4c98d2949f22bad8e563615716560eb4a8e4d55d (diff)
downloadnextcloud-server-270db2f523a5027444781107709714d66c8543a4.tar.gz
nextcloud-server-270db2f523a5027444781107709714d66c8543a4.zip
Add locator for apps list
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--tests/acceptance/features/bootstrap/AppsManagementContext.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/acceptance/features/bootstrap/AppsManagementContext.php b/tests/acceptance/features/bootstrap/AppsManagementContext.php
index 2b53ee3222b..449030e81a8 100644
--- a/tests/acceptance/features/bootstrap/AppsManagementContext.php
+++ b/tests/acceptance/features/bootstrap/AppsManagementContext.php
@@ -31,6 +31,14 @@ class AppsManagementContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
+ public static function appsList() {
+ return Locator::forThe()->xpath("//main[@id='app-content' or contains(@class, 'app-content')]//div[@id='apps-list']")->
+ describedAs("Apps list in Apps Management");
+ }
+
+ /**
+ * @return Locator
+ */
public static function enableButtonForApp($app) {
return Locator::forThe()->button("Enable")->
descendantOf(self::rowForApp($app))->
@@ -59,7 +67,8 @@ class AppsManagementContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function bundleButton($bundle) {
- return Locator::forThe()->xpath("//main[@id='app-content' or contains(@class, 'app-content')]//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input")->
+ return Locator::forThe()->xpath("//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input")->
+ descendantOf(self::appsList())->
describedAs("Button to enable / disable bundles");
}
@@ -67,7 +76,8 @@ class AppsManagementContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function rowForApp($app) {
- return Locator::forThe()->xpath("//main[@id='app-content' or contains(@class, 'app-content')]//div[@class='app-name'][normalize-space() = '$app']/..")->
+ return Locator::forThe()->xpath("//div[@class='app-name'][normalize-space() = '$app']/..")->
+ descendantOf(self::appsList())->
describedAs("Row for app $app in Apps Management");
}
@@ -75,7 +85,8 @@ class AppsManagementContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function emptyAppList() {
- return Locator::forThe()->xpath("//main[@id='app-content' or contains(@class, 'app-content')]//div[@id='apps-list-empty']")->
+ return Locator::forThe()->xpath("//div[@id='apps-list-empty']")->
+ descendantOf(self::appsList())->
describedAs("Empty apps list view");
}
@@ -83,7 +94,8 @@ class AppsManagementContext implements Context, ActorAwareInterface {
* @return Locator
*/
public static function appEntries() {
- return Locator::forThe()->xpath("//main[@id='app-content' or contains(@class, 'app-content')]//div[@class='section']")->
+ return Locator::forThe()->xpath("//div[@class='section']")->
+ descendantOf(self::appsList())->
describedAs("Entries in apps list");
}