Skip to content
Prev Previous commit
Next Next commit
Add locator for apps list
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Mar 8, 2021
commit d293751ba7b1d1592f51e54cd584f82012a04a04
20 changes: 16 additions & 4 deletions tests/acceptance/features/bootstrap/AppsManagementContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
class AppsManagementContext implements Context, ActorAwareInterface {
use ActorAware;

/**
* @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
*/
Expand Down Expand Up @@ -59,31 +67,35 @@ public static function disableButtonForApp($app) {
* @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");
}

/**
* @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");
}

/**
* @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");
}

/**
* @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");
}

Expand Down