-
Notifications
You must be signed in to change notification settings - Fork 16
Acceptance tests #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Acceptance tests #104
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
| default: | ||
| autoload: | ||
| '': '%paths.base%/../features/bootstrap' | ||
|
|
||
| suites: | ||
| webUIFirstrunwizard: | ||
| paths: | ||
| - '%paths.base%/../features/webUIFirstrunwizard' | ||
| contexts: | ||
| - WebUIFirstrunwizardContext: | ||
| - WebUIGeneralContext: | ||
| - WebUILoginContext: | ||
| - FeatureContext: &common_feature_context_params | ||
| baseUrl: http://localhost:8080 | ||
| adminUsername: admin | ||
| adminPassword: admin | ||
| regularUserPassword: 123456 | ||
| ocPath: apps/testing/api/v1/occ | ||
| - OccContext: | ||
|
|
||
| extensions: | ||
| jarnaiz\JUnitFormatter\JUnitFormatterExtension: | ||
| filename: report.xml | ||
| outputDir: '%paths.base%/../output/' |
117 changes: 117 additions & 0 deletions
117
tests/acceptance/features/bootstrap/WebUIFirstrunwizardContext.php
This file contains hidden or 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,117 @@ | ||
| <?php | ||
| /** | ||
| * ownCloud | ||
| * | ||
| * @author Bhawana Prasain <bhawana.prs@gmail.com> | ||
| * @copyright Copyright (c) 2019 Bhawana Prasain bhawana.prs@gmail.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; | ||
| use Behat\Behat\Hook\Scope\BeforeScenarioScope; | ||
| use Behat\MinkExtension\Context\RawMinkContext; | ||
| use Page\FirstrunwizardPage; | ||
|
|
||
| require_once 'bootstrap.php'; | ||
|
|
||
| /** | ||
| * Context for First run wizard specific webUI steps | ||
| */ | ||
| class WebUIFirstrunwizardContext extends RawMinkContext implements Context { | ||
|
|
||
| /** | ||
| * @var FeatureContext | ||
| */ | ||
| private $featureContext; | ||
|
|
||
| /** | ||
| * @var WebUIGeneralContext | ||
| */ | ||
| private $webUIGeneralContext; | ||
|
|
||
| /** | ||
| * @var FirstrunwizardPage | ||
| */ | ||
| private $firstrunwizardPage; | ||
|
|
||
| /** | ||
| * WebUIFirstrunwizardContext constructor. | ||
| * | ||
| * @param FirstrunwizardPage $firstrunwizardPage | ||
| */ | ||
| public function __construct(FirstrunwizardPage $firstRunWizardPage) { | ||
| $this->firstRunWizardPage = $firstRunWizardPage; | ||
| } | ||
|
|
||
| /** | ||
| * @Then the user should see the firstrunwizard popup message | ||
| * | ||
| * @throws Exception | ||
| * | ||
| * @return void | ||
| */ | ||
| public function theUserShouldSeeTheFirstrunwizardPopupMessage() { | ||
| $firstrunwizardScreen = $this->firstRunWizardPage->getWizardPopup(); | ||
| if ($firstrunwizardScreen === null) { | ||
| throw new Exception("Could not find firstrunwizard popup"); | ||
| } | ||
| if ($firstrunwizardScreen->isVisible() === false) { | ||
| throw new Exception("Firstrunwizard popup is not visible"); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * @Then the user should not see the firstrunwizard popup message | ||
| * | ||
| * @throws Exception | ||
| * | ||
| * @return void | ||
| */ | ||
| public function theUserShouldNotNotSeeTheFirstrunwizardPopUpMessage() { | ||
| $firstrunwizardScreen = $this->firstRunWizardPage->getWizardPopup(); | ||
|
|
||
| if ($firstrunwizardScreen !== null) { | ||
|
dpakach marked this conversation as resolved.
|
||
| if ($firstrunwizardScreen->isVisible() === true) { | ||
| throw new Exception("The firstrunwizard popup is not expected to appear but is present"); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * @When the user closes the firstrunwizard popup message | ||
| * @Given the user has closed the firstrunwizard popup message | ||
| * | ||
| * @return void | ||
|
individual-it marked this conversation as resolved.
|
||
| */ | ||
| public function closeDialogBox() { | ||
| $this->firstRunWizardPage->closePopup(); | ||
| } | ||
|
|
||
| /** | ||
| * @BeforeScenario | ||
| * | ||
| * @param BeforeScenarioScope $scope | ||
| * | ||
| * @return void | ||
| */ | ||
| public function setUpScenario(BeforeScenarioScope $scope) { | ||
| // Get the environment | ||
| $environment = $scope->getEnvironment(); | ||
| // Get all the contexts you need in this context | ||
| $this->featureContext = $environment->getContext('FeatureContext'); | ||
| $this->webUIGeneralContext = $environment->getContext('WebUIGeneralContext'); | ||
| } | ||
| } | ||
This file contains hidden or 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,34 @@ | ||
| <?php | ||
| /** | ||
| * ownCloud | ||
| * | ||
| * @author Artur Neumann <info@jankaritech.com> | ||
|
individual-it marked this conversation as resolved.
|
||
| * @copyright Copyright (c) 2019 Artur Neumann 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("Page\\", __DIR__ . "/../lib", true); | ||
| $classLoader->addPsr4( | ||
| "", __DIR__ . "/../../../../../../tests/acceptance/features/bootstrap", true | ||
| ); | ||
|
|
||
| //some tests need the guests app contexts | ||
| $classLoader->addPsr4( | ||
| "", __DIR__ . "/../../../../../guests/tests/acceptance/features/bootstrap", true | ||
| ); | ||
| $classLoader->register(); | ||
This file contains hidden or 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,54 @@ | ||
| <?php | ||
| /** | ||
| * ownCloud | ||
| * | ||
| * @author Bhawana Prasain <bhawana.prs@gmail.com> | ||
| * @copyright Copyright (c) Bhawana Prasain 2019 bhawana.prs@gmail.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/>. | ||
| * | ||
| */ | ||
|
|
||
| namespace Page; | ||
|
|
||
| use \Behat\Mink\Element\NodeElement; | ||
|
|
||
| /** | ||
| * Page object for Firstrunwizard | ||
| * | ||
| */ | ||
|
|
||
| class FirstrunwizardPage extends OwncloudPage { | ||
| protected $closeWizardXpath = "//*[@id='closeWizard']"; | ||
| protected $firstrunwizardPopupXpath = "//*[@id='firstrunwizard']"; | ||
|
|
||
| /** | ||
|
dpakach marked this conversation as resolved.
|
||
| * Closes Popup message from Firstrunwizard | ||
| * | ||
| * @return void | ||
| */ | ||
| public function closePopup() { | ||
| $closeButton = $this->find("xpath", $this->closeWizardXpath); | ||
| $this->assertElementNotNull($closeButton, "no close button"); | ||
| $closeButton->click(); | ||
| $this->waitTillElementIsNull($this->closeWizardXpath); | ||
| } | ||
|
|
||
| /** | ||
| * @return NodeElement|null | ||
| */ | ||
| public function getWizardPopup() { | ||
| return $this->find("xpath", $this->firstrunwizardPopupXpath); | ||
| } | ||
| } | ||
17 changes: 17 additions & 0 deletions
17
tests/acceptance/features/webUIFirstrunwizard/firstrunwizard.feature
This file contains hidden or 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,17 @@ | ||
| @webUI @insulated @disablePreviews | ||
| Feature: first login wizard | ||
| As a user | ||
| I want to be informed about the basic features of ownCloud when I first log in | ||
| So that I can get a basic overview about ownCloud | ||
|
|
||
| Scenario: User logs in into ownCloud for the first time | ||
| Given user "user1" has been created with default attributes | ||
| When user "user1" logs in using the webUI | ||
| Then the user should see the firstrunwizard popup message | ||
|
|
||
|
dpakach marked this conversation as resolved.
|
||
| Scenario: Previously created user logs into ownCloud | ||
| Given user "user1" has been created with default attributes | ||
| When user "user1" logs in using the webUI | ||
| And the user closes the firstrunwizard popup message | ||
| And the user re-logs in as "user1" using the webUI | ||
| Then the user should not see the firstrunwizard popup message | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.