Skip to content

Commit

Permalink
Add tests for enabling an app
Browse files Browse the repository at this point in the history
  • Loading branch information
paurakhsharma committed Oct 9, 2018
1 parent d5c4f23 commit cdb2dae
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/acceptance/features/bootstrap/OccContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,19 @@ public function theAdministratorDisablesTheAppUsingTheOccCommand($appName) {
);
}

/**
* @When the administrator enables the app :appName using the occ command
*
* @param string $appName
*
* @return void
*/
public function theAdministratorEnablesTheAppUsingTheOccCommand($appName) {
$this->featureContext->invokingTheCommand(
"app:enable $appName"
);
}

/**
* @When the administrator disables the user :username using the occ command
*
Expand Down
16 changes: 16 additions & 0 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,22 @@ public function theAppsShouldInclude($appList) {
}
}

/**
* @Then /^the app "([^"]*)" should not be on the apps list$/
*
* @param string $appName
*
* @return void
*/
public function theAppShouldNotBeOnTheAppsList($appName) {
$fullUrl = $this->getBaseUrl() . "/ocs/v2.php/cloud/apps";
$this->response = HttpRequestHelper::get(
$fullUrl, $this->getAdminUsername(), $this->getAdminPassword()
);
$respondedArray = $this->getArrayOfAppsResponded($this->response);
PHPUnit_Framework_Assert::assertNotContains($appName, $respondedArray);
}

/**
* @Then /^the user "([^"]*)" should be the subadmin of the group "([^"]*)"$/
*
Expand Down
25 changes: 25 additions & 0 deletions tests/acceptance/features/cliProvisioning/enableApp.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@cli @skipOnLDAP
Feature: enable an app
As an admin
I want to be able to enable a disabled app
So that I can use the app features again

Scenario: Admin enables an app
Given the app "comments" has been disabled
When the administrator enables the app "comments" using the occ command
Then the command should have been successful
And the command output should contain the text 'comments enabled'
And app "comments" should be enabled

Scenario: Admin tries to enable an app which is already enabled
Given the app "comments" has been enabled
When the administrator enables the app "comments" using the occ command
Then the command should have been successful
And the command output should contain the text 'comments enabled'
And app "comments" should be enabled

Scenario: Admin tries to enable an app which is not installed in ownCloud server
When the administrator enables the app "not-installed-app" using the occ command
Then the command should have failed with exit code 1
And the command output should contain the text 'not-installed-app not found'
And the app "not-installed-app" should not be on the apps list

0 comments on commit cdb2dae

Please sign in to comment.