Adjust acceptance tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
33bafb8e2b
commit
970d52fc29
|
@ -12,7 +12,8 @@ Feature: access-levels
|
||||||
Scenario: regular users cannot see admin-level items on the Settings page
|
Scenario: regular users cannot see admin-level items on the Settings page
|
||||||
Given I am logged in
|
Given I am logged in
|
||||||
When I visit the settings page
|
When I visit the settings page
|
||||||
Then I see that the "Personal" settings panel is shown
|
Then I see that the "Personal info" entry in the settings panel is shown
|
||||||
|
And I see that the "Personal" settings panel is not shown
|
||||||
And I see that the "Administration" settings panel is not shown
|
And I see that the "Administration" settings panel is not shown
|
||||||
|
|
||||||
Scenario: admin users can see admin-level items on the Settings page
|
Scenario: admin users can see admin-level items on the Settings page
|
||||||
|
|
|
@ -93,6 +93,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface {
|
||||||
describedAs($itemText . " item in Settings panel");
|
describedAs($itemText . " item in Settings panel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $itemText
|
||||||
|
* @return Locator
|
||||||
|
*/
|
||||||
|
private static function settingsPanelEntryFor($itemText) {
|
||||||
|
return Locator::forThe()->xpath("//div[@id = 'app-navigation']//ul//li[normalize-space() = '$itemText']")->
|
||||||
|
describedAs($itemText . " entry in Settings panel");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -188,6 +197,15 @@ class SettingsMenuContext implements Context, ActorAwareInterface {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then I see that the :itemText entry in the settings panel is shown
|
||||||
|
*/
|
||||||
|
public function iSeeThatTheItemEntryInTheSettingsPanelIsShown($itemText) {
|
||||||
|
PHPUnit_Framework_Assert::assertTrue(
|
||||||
|
$this->actor->find(self::settingsPanelEntryFor($itemText), 10)->isVisible()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then I see that the :itemText settings panel is not shown
|
* @Then I see that the :itemText settings panel is not shown
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue