-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
509fe30
commit 347284c
Showing
10 changed files
with
228 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
default: | ||
autoload: | ||
'': '%paths.base%/../features/bootstrap' | ||
|
||
suites: | ||
cliMain: | ||
paths: | ||
- '%paths.base%/../features/cliMain' | ||
contexts: | ||
- MarketContext: | ||
- FeatureContext: &common_feature_context_params | ||
baseUrl: http://localhost:8080 | ||
adminUsername: admin | ||
adminPassword: admin | ||
regularUserPassword: 123456 | ||
ocPath: apps/testing/api/v1/occ | ||
- LoggingContext: | ||
- OccContext: | ||
- OccAppManagementContext: | ||
|
||
extensions: | ||
Cjm\Behat\StepThroughExtension: ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* ownCloud | ||
* | ||
* @author Phil Davis <info@jankaritech.com> | ||
* @copyright Copyright (c) 2022 Phil Davis info@jankaritech.com | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
use Behat\Behat\Context\Context; | ||
|
||
require_once 'bootstrap.php'; | ||
|
||
/** | ||
* Context for market specific steps | ||
*/ | ||
class MarketContext implements Context { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* ownCloud | ||
* | ||
* @author Phil Davis <info@jankaritech.com> | ||
* @copyright Copyright (c) 2022 Phil Davis info@jankaritech.com | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public | ||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
require_once __DIR__ . '/../../../../../../tests/acceptance/features/bootstrap/bootstrap.php'; | ||
|
||
$classLoader = new \Composer\Autoload\ClassLoader(); | ||
$classLoader->addPsr4( | ||
"", | ||
__DIR__ . "/../../../../../../tests/acceptance/features/bootstrap", | ||
true | ||
); | ||
$classLoader->register(); |
87 changes: 87 additions & 0 deletions
87
tests/acceptance/features/cliMain/marketInstallUpgradeUninstall.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
@cli | ||
Feature: install, upgrade and uninstall apps that are available in the market-place | ||
|
||
# Note: testing this feature requires that the real market-place be online, | ||
# working and reachable from the system-under-test. | ||
# The activity app must not yet be installed on the system-under-test. | ||
# Happy-path install, upgrade and uninstall are tested all in one scenario as a "user journey" | ||
# because we need to install anyway, in order to test a normal uninstall. | ||
Scenario: install, attempt to reinstall, upgrade and uninstall an app that is available in the market-place | ||
# Note: use the activity app as the example to install | ||
# it should be an app that is always available | ||
When the administrator invokes occ command "market:install activity" | ||
Then the command should have been successful | ||
And the command output should be: | ||
""" | ||
activity: Installing new app ... | ||
activity: App installed. | ||
""" | ||
And app "activity" should be enabled | ||
# Attempt to install again and check the different message | ||
When the administrator invokes occ command "market:install activity" | ||
Then the command should have been successful | ||
And the command output should be: | ||
""" | ||
activity: App already installed and no update available | ||
""" | ||
And app "activity" should be enabled | ||
# Attempt to upgrade and check that no update is available | ||
When the administrator invokes occ command "market:upgrade activity" | ||
Then the command should have been successful | ||
And the command output should be: | ||
""" | ||
activity: No update available. | ||
""" | ||
And app "activity" should be enabled | ||
# Uninstall the app - to make sure that uninstall works, and to cleanup | ||
When the administrator invokes occ command "market:uninstall activity" | ||
Then the command should have been successful | ||
And the command output should be: | ||
""" | ||
activity: Un-Installing ... | ||
activity: App uninstalled. | ||
""" | ||
And app "activity" should not be in the apps list | ||
|
||
Scenario: install an app that is not available in the market-place | ||
When the administrator invokes occ command "market:install nonexistentapp" | ||
Then the command should have failed with exit code 1 | ||
And the command output should be: | ||
""" | ||
nonexistentapp: Installing new app ... | ||
nonexistentapp: Unknown app (nonexistentapp) | ||
""" | ||
|
||
Scenario: upgrade an app that is not available in the market-place | ||
When the administrator invokes occ command "market:upgrade nonexistentapp" | ||
Then the command should have failed with exit code 1 | ||
And the command output should be: | ||
""" | ||
nonexistentapp: Not installed ... | ||
""" | ||
|
||
Scenario: upgrade an app that is available in the market-place but not installed locally | ||
When the administrator invokes occ command "market:upgrade activity" | ||
Then the command should have failed with exit code 1 | ||
And the command output should be: | ||
""" | ||
activity: Not installed ... | ||
""" | ||
|
||
Scenario: uninstall an app that is not available in the market-place | ||
When the administrator invokes occ command "market:uninstall nonexistentapp" | ||
Then the command should have failed with exit code 1 | ||
And the command output should be: | ||
""" | ||
nonexistentapp: Un-Installing ... | ||
nonexistentapp: App (nonexistentapp) could not be uninstalled. Please check the server logs. | ||
""" | ||
|
||
Scenario: uninstall an app that is available in the market-place but not installed locally | ||
When the administrator invokes occ command "market:uninstall activity" | ||
Then the command should have failed with exit code 1 | ||
And the command output should be: | ||
""" | ||
activity: Un-Installing ... | ||
activity: App (activity) could not be uninstalled. Please check the server logs. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@cli | ||
Feature: list apps that are available in the market-place | ||
|
||
# Note: testing this feature requires that the real market-place be online, | ||
# working and reachable from the system-under-test. | ||
Scenario: list the apps available in the market-place | ||
When the administrator invokes occ command "market:list" | ||
Then the command should have been successful | ||
# The command lists all the apps that are available on the market-place | ||
# Just check for an example app that should always be there | ||
And the command output should contain the text "activity" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"config" : { | ||
"platform": { | ||
"php": "7.4" | ||
} | ||
}, | ||
"require": { | ||
"behat/behat": "^3.9", | ||
"behat/gherkin": "^4.9", | ||
"behat/mink": "1.7.1", | ||
"friends-of-behat/mink-extension": "^2.5", | ||
"behat/mink-selenium2-driver": "^1.5", | ||
"ciaranmcnulty/behat-stepthroughextension" : "dev-master", | ||
"rdx/behat-variables": "^1.2", | ||
"sensiolabs/behat-page-object-extension": "^2.3", | ||
"symfony/translation": "^4.4", | ||
"sabre/xml": "^2.2", | ||
"guzzlehttp/guzzle": "^7.4", | ||
"phpunit/phpunit": "^9.5" | ||
} | ||
} |