From 3d99a9d24ee710e7bac2fc1a4466aeefe915685a Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Thu, 8 Mar 2018 16:33:33 +0100 Subject: Header acceptance features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../features/bootstrap/SettingsMenuContext.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/acceptance/features/bootstrap/SettingsMenuContext.php') diff --git a/tests/acceptance/features/bootstrap/SettingsMenuContext.php b/tests/acceptance/features/bootstrap/SettingsMenuContext.php index 401575c78f0..eddf2599d78 100644 --- a/tests/acceptance/features/bootstrap/SettingsMenuContext.php +++ b/tests/acceptance/features/bootstrap/SettingsMenuContext.php @@ -3,6 +3,7 @@ /** * * @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com) + * @copyright Copyright (c) 2018, John Molakvoæ (skjnldsv) (skjnldsv@protonmail.com) * * @license GNU AGPL version 3 or any later version * @@ -75,6 +76,14 @@ class SettingsMenuContext implements Context, ActorAwareInterface { describedAs($itemText . " item in Settings panel"); } + /** + * @return array + */ + public function menuItems() { + return $this->actor->find(self::settingsMenu(), 10) + ->getWrappedElement()->findAll('xpath', '//a'); + } + /** * @When I open the Settings menu */ @@ -116,6 +125,13 @@ class SettingsMenuContext implements Context, ActorAwareInterface { $this->actor->find(self::settingsMenu(), 10)->isVisible()); } + /** + * @Then I see that the Settings menu has only :items items + */ + public function iSeeThatTheSettingsMenuHasOnlyXItems($items) { + PHPUnit_Framework_Assert::assertCount(intval($items), self::menuItems()); + } + /** * @Then I see that the :itemText item in the Settings menu is shown */ -- cgit v1.2.3