Skip to content
Snippets Groups Projects
Commit b086a0f0 authored by Daniel Calviño Sánchez's avatar Daniel Calviño Sánchez Committed by backportbot[bot]
Browse files

Add explicit locator for "Enable all" bundle button


Instead of looking for the bundle button and then checking its value now
the expected value is included in the locator and the button is checked
similarly to other elements.

No "Disable all" locator was added as it was not currently needed
anywhere.

Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
parent 1058abc9
No related branches found
No related tags found
No related merge requests found
......@@ -84,10 +84,10 @@ class AppsManagementContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
public static function bundleButton($bundle) {
return Locator::forThe()->xpath("//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input")->
public static function enableAllBundleButton($bundle) {
return Locator::forThe()->xpath("//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input[@value='Enable all']")->
descendantOf(self::appsList())->
describedAs("Button to enable / disable bundles");
describedAs("Button to enable bundles");
}
/**
......@@ -245,14 +245,16 @@ class AppsManagementContext implements Context, ActorAwareInterface {
* @When /^I enable all apps from the "([^"]*)"$/
*/
public function iEnableAllAppsFromThe($bundle) {
$this->actor->find(self::bundleButton($bundle), 2)->click();
$this->actor->find(self::enableAllBundleButton($bundle), 2)->click();
}
/**
* @Given /^I see that the "([^"]*)" is disabled$/
*/
public function iSeeThatTheIsDisabled($bundle) {
PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle), 2)->getValue());
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::enableAllBundleButton($bundle), 2)->isVisible()
);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment