Skip to content
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

Add acceptance tests for federated resharing #33506

Merged
merged 3 commits into from
Jan 17, 2019
Merged

Add acceptance tests for federated resharing #33506

merged 3 commits into from
Jan 17, 2019

Conversation

VicDeo
Copy link
Member

@VicDeo VicDeo commented Nov 13, 2018

Description

More acceptance tests for federation

Related Issue

#33422

Motivation and Context

Tests

How Has This Been Tested?

By CI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@VicDeo VicDeo self-assigned this Nov 13, 2018
@VicDeo VicDeo added this to the development milestone Nov 13, 2018
@codecov
Copy link

codecov bot commented Nov 13, 2018

Codecov Report

Merging #33506 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #33506   +/-   ##
=========================================
  Coverage     64.76%   64.76%           
  Complexity    18351    18351           
=========================================
  Files          1198     1198           
  Lines         69467    69467           
  Branches       1281     1281           
=========================================
  Hits          44993    44993           
  Misses        24101    24101           
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <ø> (ø) 18351 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e7e31a...d104b81. Read the comment docs.

@VicDeo VicDeo force-pushed the implement-33422 branch 3 times, most recently from 964fb00 to b37601d Compare November 13, 2018 20:19
@VicDeo VicDeo force-pushed the implement-33422 branch 7 times, most recently from 0a96918 to b8c312a Compare November 27, 2018 14:05
@VicDeo VicDeo force-pushed the implement-33422 branch 2 times, most recently from c71a8d7 to 41ffbbd Compare December 4, 2018 10:59
@VicDeo
Copy link
Member Author

VicDeo commented Dec 4, 2018

Only CI gods know what is happening here...

> make test-acceptance-webui BEHAT_FEATURE=tests/acceptance/features/webUISharingExternal/federationSharing.feature:187
php build/composer.phar install --dev
You are using the deprecated option "dev". Dev packages are installed by default now.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/common is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/http is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/stream is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Generating optimized autoload files
Composer cleaner: Removed 17 files or directories.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
./tests/acceptance/run.sh --remote --type webUI
Script path: /home/deo/public_html/autotest/tests/acceptance
Not using php inbuilt server for running scenario ...
Updating .htaccess for proper rewrites
"maxDuration":"3600"
{"extensions" : {"Behat\\MinkExtension" : {"browser_name": "chrome", "base_url" : "http://172.17.0.1/~deo/autotest", "selenium2":{"capabilities": {"marionette":null, "browser": "chrome", "name": "ownCloud non-CI", "extra_capabilities": {"maxDuration":"3600"}}, "wd_host":"http://localhost:4445/wd/hub"}}, "SensioLabs\\Behat\\PageObjectExtension" : {}}}
Running webUISharingExternal tests tagged ~@skipWhenTestingRemoteSystems&&~@skipOnOcV11&&~@skipOnOcV11.0&&~@skipOnOcV11.0.0&&@webUI&&~@skip on browser 'chrome' 
@webUI @insulated @disablePreviews @TestAlsoOnExternalUserBackend
Feature: Federation Sharing - sharing with users on other cloud storages
  As a user
  I want to share files with any users on other cloud storages
  So that other users have access to these files

  Background:                                                 # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:7                                                                                                     
    Given using server "REMOTE"                               # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And using server "LOCAL"                                  # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "user1" has logged in using the webUI            # WebUILoginContext::theUserLogsInUsingTheWebUI()

  Scenario: test sharing folder to a remote server and resharing it back to the local                                   # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:187
    Given using server "LOCAL"                                                                                          # FeatureContext::usingServer()
    And these users have been created:                                                                                  # FeatureContext::theseUsersHaveBeenCreated()
      | username |
      | user2    |
    When the user shares folder "simple-folder" with remote user "user1@%remote_server_without_scheme%" using the webUI # WebUISharingContext::theUserSharesFileFolderWithUserUsingTheWebUI()
    And using server "REMOTE"                                                                                           # FeatureContext::usingServer()
    And user "user1" re-logs in to "%remote_server%" using the webUI                                                    # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                      # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    And user "user1" from server "REMOTE" has shared "/simple-folder (2)" with user "user2" from server "LOCAL"         # FederationContext::userFromServerHasSharedWithUserFromServer()
    And using server "LOCAL"                                                                                            # FeatureContext::usingServer()
    And user "user2" re-logs in to "%local_server%" using the webUI                                                     # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
INFORMATION: timed out waiting for outstanding ajax calls
    And the user accepts the offered remote shares using the webUI                                                      # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
      │ INFORMATION: timed out waiting for outstanding ajax calls
    Then as "user2" folder "/simple-folder (2)" should exist                                                            # FeatureContext::asFileOrFolderShouldExist()
    And as "user2" file "/simple-folder (2)/lorem.txt" should exist                                                     # FeatureContext::asFileOrFolderShouldExist()
SCENARIO RESULT: (pass)

1 scenario (1 passed)
17 steps (17 passed)
1m42.68s (25.87Mb)
runsh: Exit code of main run: 0
> make test-acceptance-webui BEHAT_FEATURE=tests/acceptance/features/webUISharingExternal/federationSharing.feature:203
php build/composer.phar install --dev
You are using the deprecated option "dev". Dev packages are installed by default now.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/common is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/http is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/stream is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Generating optimized autoload files
Composer cleaner: Removed 17 files or directories.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
./tests/acceptance/run.sh --remote --type webUI
Script path: /home/deo/public_html/autotest/tests/acceptance
Not using php inbuilt server for running scenario ...
Updating .htaccess for proper rewrites
"maxDuration":"3600"
{"extensions" : {"Behat\\MinkExtension" : {"browser_name": "chrome", "base_url" : "http://172.17.0.1/~deo/autotest", "selenium2":{"capabilities": {"marionette":null, "browser": "chrome", "name": "ownCloud non-CI", "extra_capabilities": {"maxDuration":"3600"}}, "wd_host":"http://localhost:4445/wd/hub"}}, "SensioLabs\\Behat\\PageObjectExtension" : {}}}
Running webUISharingExternal tests tagged ~@skipWhenTestingRemoteSystems&&~@skipOnOcV11&&~@skipOnOcV11.0&&~@skipOnOcV11.0.0&&@webUI&&~@skip on browser 'chrome' 
@webUI @insulated @disablePreviews @TestAlsoOnExternalUserBackend
Feature: Federation Sharing - sharing with users on other cloud storages
  As a user
  I want to share files with any users on other cloud storages
  So that other users have access to these files

  Background:                                                 # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:7                                                                                                     
    Given using server "REMOTE"                               # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And using server "LOCAL"                                  # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "user1" has logged in using the webUI            # WebUILoginContext::theUserLogsInUsingTheWebUI()

  Scenario: test resharing folder as readonly and set it as readonly by resharer                                                # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:203                                 
    Given using server "LOCAL"                                                                                                  # FeatureContext::usingServer()                                                                                                               
    And these users have been created:                                                                                          # FeatureContext::theseUsersHaveBeenCreated()                                                                                                 
      | username |
      | user2    |
    When the user shares folder "simple-folder" with remote user "user1@%remote_server_without_scheme%" using the webUI         # WebUISharingContext::theUserSharesFileFolderWithUserUsingTheWebUI()
    And using server "REMOTE"                                                                                                   # FeatureContext::usingServer()
    And user "user1" re-logs in to "%remote_server%" using the webUI                                                            # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                              # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    And user "user1" from server "REMOTE" has shared "/simple-folder (2)" with user "user2" from server "LOCAL"                 # FederationContext::userFromServerHasSharedWithUserFromServer()
    And the user sets the sharing permissions of "user2@%local_server%/ (federated)" for "simple-folder (2)" using the webUI to # WebUISharingContext::theUserSetsTheSharingPermissionsOfForOnTheWebUI()
      | edit | no |
    And using server "LOCAL"                                                                                                    # FeatureContext::usingServer()
    And user "user2" re-logs in to "%local_server%" using the webUI                                                             # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                              # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    Then as "user2" folder "/simple-folder (2)" should exist                                                                    # FeatureContext::asFileOrFolderShouldExist()
    And as "user2" file "/simple-folder (2)/lorem.txt" should exist                                                             # FeatureContext::asFileOrFolderShouldExist()
    And the user opens folder "simple-folder (2)" using the webUI                                                               # WebUIFilesContext::theUserOpensFolderNamedUsingTheWebUI()
    And it should not be possible to delete file "lorem.txt" using the webUI                                                    # WebUIFilesContext::itShouldNotBePossibleToDeleteFileFolderUsingTheWebUI()
SCENARIO RESULT: (pass)

1 scenario (1 passed)
20 steps (20 passed)
2m29.50s (25.96Mb)
runsh: Exit code of main run: 0
> make test-acceptance-webui BEHAT_FEATURE=tests/acceptance/features/webUISharingExternal/federationSharing.feature:223
php build/composer.phar install --dev
You are using the deprecated option "dev". Dev packages are installed by default now.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package guzzle/common is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/http is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/parser is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Package guzzle/stream is abandoned, you should avoid using it. Use guzzle/guzzle instead.
Generating optimized autoload files
Composer cleaner: Removed 17 files or directories.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
./tests/acceptance/run.sh --remote --type webUI
Script path: /home/deo/public_html/autotest/tests/acceptance
Not using php inbuilt server for running scenario ...
Updating .htaccess for proper rewrites
"maxDuration":"3600"
{"extensions" : {"Behat\\MinkExtension" : {"browser_name": "chrome", "base_url" : "http://172.17.0.1/~deo/autotest", "selenium2":{"capabilities": {"marionette":null, "browser": "chrome", "name": "ownCloud non-CI", "extra_capabilities": {"maxDuration":"3600"}}, "wd_host":"http://localhost:4445/wd/hub"}}, "SensioLabs\\Behat\\PageObjectExtension" : {}}}
Running webUISharingExternal tests tagged ~@skipWhenTestingRemoteSystems&&~@skipOnOcV11&&~@skipOnOcV11.0&&~@skipOnOcV11.0.0&&@webUI&&~@skip on browser 'chrome' 
@webUI @insulated @disablePreviews @TestAlsoOnExternalUserBackend
Feature: Federation Sharing - sharing with users on other cloud storages
  As a user
  I want to share files with any users on other cloud storages
  So that other users have access to these files

  Background:                                                 # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:7                                                                                                     
    Given using server "REMOTE"                               # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And using server "LOCAL"                                  # FeatureContext::usingServer()
    And user "user1" has been created with default attributes # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "user1" has logged in using the webUI            # WebUILoginContext::theUserLogsInUsingTheWebUI()

  Scenario: test resharing folder and set it as readonly by owner                                                          # /home/deo/public_html/autotest/tests/acceptance/features/webUISharingExternal/federationSharing.feature:223                                      
    Given using server "LOCAL"                                                                                             # FeatureContext::usingServer()                                                                                                                    
    And these users have been created:                                                                                     # FeatureContext::theseUsersHaveBeenCreated()                                                                                                      
      | username |
      | user2    |                                                                                                                     
    When the user shares folder "simple-folder" with remote user "user1@%remote_server_without_scheme%" using the webUI    # WebUISharingContext::theUserSharesFileFolderWithUserUsingTheWebUI()                                                                              
    And using server "REMOTE"                                                                                              # FeatureContext::usingServer()
    And user "user1" re-logs in to "%remote_server%" using the webUI                                                       # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                         # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    And user "user1" from server "REMOTE" has shared "/simple-folder (2)" with user "user2" from server "LOCAL"            # FederationContext::userFromServerHasSharedWithUserFromServer()
    And using server "LOCAL"                                                                                               # FeatureContext::usingServer()
    And user "user1" re-logs in to "%local_server%" using the webUI                                                        # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user opens the share dialog for folder "simple-folder"                                                         # WebUISharingContext::theUserOpensTheShareDialogForFileFolder()
    And the user sets the sharing permissions of "user2@%local_server% (federated)" for "simple-folder" using the webUI to # WebUISharingContext::theUserSetsTheSharingPermissionsOfForOnTheWebUI()
      | edit | no |
    And user "user2" re-logs in to "%local_server%" using the webUI                                                        # WebUILoginContext::theUserRelogsInToUsingTheWebUI()
    And the user accepts the offered remote shares using the webUI                                                         # WebUISharingContext::theUserAcceptsTheOfferedRemoteShares()
    Then as "user2" folder "/simple-folder (2)" should exist                                                               # FeatureContext::asFileOrFolderShouldExist()
    And as "user2" file "/simple-folder (2)/lorem.txt" should exist                                                        # FeatureContext::asFileOrFolderShouldExist()
    And the user opens folder "simple-folder (2)" using the webUI                                                          # WebUIFilesContext::theUserOpensFolderNamedUsingTheWebUI()
    And it should not be possible to delete file "lorem.txt" using the webUI                                               # WebUIFilesContext::itShouldNotBePossibleToDeleteFileFolderUsingTheWebUI()
SCENARIO RESULT: (pass)

1 scenario (1 passed)
22 steps (22 passed)
2m24.14s (25.92Mb)
runsh: Exit code of main run: 0

@VicDeo VicDeo force-pushed the implement-33422 branch 2 times, most recently from b9a1e4a to 5064de1 Compare January 10, 2019 15:27
@VicDeo VicDeo changed the title Adding more federation acceptance tests Add acceptance tests for federated resharing Jan 14, 2019
Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just minor change requests

I wrote some general explanations about how we usually write the tests

Also, if you don't care particularly to test the UI but the sharing in general, its might be better to write pure API tests, they are much faster

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
There are lots of other combinations that could also be tested some day, but this is a good start.

@VicDeo
Copy link
Member Author

VicDeo commented Jan 17, 2019

Stable10: #34172

@lock lock bot locked as resolved and limited conversation to collaborators Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants