Browse Source

Properly check for the sidebar

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v14.0.0beta1
Julius Härtl 6 years ago
parent
commit
cdbe39d006
No account linked to committer's email address

+ 3
- 3
tests/acceptance/features/apps.feature View File

@@ -53,7 +53,7 @@ Feature: apps
And I am logged in as the admin
And I open the Apps management
When I click on the "QA testing" app
Then I see that the sidebar is open
Then I see that the app details are shown

# TODO: Improve testing with app store as external API
# The following scenarios require the files_antivirus and calendar app
@@ -77,7 +77,7 @@ Feature: apps
And I open the Apps management
And I open the "Tools" section
When I click on the "Antivirus App for files" app
Then I see that the sidebar is open
Then I see that the app details are shown

Scenario: Install an app from the app store
Given I act as Jane
@@ -85,6 +85,6 @@ Feature: apps
And I open the Apps management
And I open the "Office & text" section
And I click on the "Calendar" app
And I see that the sidebar is open
And I see that the app details are shown
Then I download and enable the "Calendar" app
And I see that the "Calendar" app has been enabled

+ 23
- 0
tests/acceptance/features/bootstrap/AppsManagementContext.php View File

@@ -106,6 +106,14 @@ class AppsManagementContext implements Context, ActorAwareInterface {
describedAs("Enable button in the app list");
}

/**
* @return Locator
*/
public static function sidebar() {
return Locator::forThe()->id("app-sidebar")->
describedAs("Sidebar in apps management");
}


/**
* @When I enable the :app app
@@ -205,5 +213,20 @@ class AppsManagementContext implements Context, ActorAwareInterface {
PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle))->getValue());
}

/**
* @Given /^I see that the app details are shown$/
*/
public function iSeeThatTheAppDetailsAreShown() {
// The sidebar always exists in the DOM, so it has to be explicitly
// waited for it to be visible instead of relying on the implicit wait
// made to find the element.
if (!WaitFor::elementToBeEventuallyShown(
$this->actor,
self::sidebar(),
$timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
PHPUnit_Framework_Assert::fail("The sidebar was not shown yet after $timeout seconds");
}
}


}

Loading…
Cancel
Save