Skip to content

[tests-only] Add test scenario to check that guests work when share_folder is used#595

Merged
phil-davis merged 6 commits intomasterfrom
test-for-core-40864
Jul 12, 2023
Merged

[tests-only] Add test scenario to check that guests work when share_folder is used#595
phil-davis merged 6 commits intomasterfrom
test-for-core-40864

Conversation

@phil-davis
Copy link
Copy Markdown
Contributor

Description

When the core system setting share_folder is used, guest users have a problem - see the issue link below.

The problem was fixed in core - see the PR link below.

This guests PR adds test coverage. A scenario is added that sets share_folder and then verifies that a guest user can use a folder that is shared with them.

The scenario fails when run with core code before owncloud/core#40864

Feature: Guests

  Background:                       # /home/phil/git/owncloud/core/apps-external/guests/tests/acceptance/features/apiGuests/guests.feature:4
    Given using OCS API version "1" # FeatureContext::usingOcsApiVersion()
    And using new dav path          # FeatureContext::usingOldOrNewDavPath()

  @email @skipOnOcV10.11 @skipOnOcV10.12
  Scenario: A guest user can upload files to a folder shared with them when shared_folder is in use                                         # /home/phil/git/owncloud/core/apps-external/guests/tests/acceptance/features/apiGuests/guests.feature:575
    Given the administrator has set the default folder for received shares to "Shares"                                                      # OccContext::theAdministratorHasSetTheDefaultFolderForReceivedSharesTo()
    And user "Alice" has been created with default attributes and small skeleton files                                                      # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And the administrator has created guest user "guest1" with email "guest1@example.com"                                                   # GuestsContext::theAdministratorHasCreatedAGuestUser()
    And the HTTP status code should be "201"                                                                                                # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And user "Alice" has created folder "/tmp"                                                                                              # FeatureContext::userHasCreatedFolder()
    And user "Alice" has shared folder "/tmp" with guest user "guest1@example.com"                                                          # GuestsContext::userHasSharedFolderWithGuestUser()
    And guest user "guest1" has registered                                                                                                  # GuestsContext::guestUserHasRegistered()
    When user "guest1@example.com" uploads file "textfile.txt" from the guests test data folder to "/tmp/textfile.txt" using the WebDAV API # GuestsContext::userUploadsFileFromGuestsDataFolderTo()
    Then the HTTP status code should be "201"                                                                                               # FeatureContext::thenTheHTTPStatusCodeShouldBe()
      HTTP status code 409 is not the expected value 201
      Failed asserting that 409 matches expected '201'.
    And as "Alice" file "/tmp/textfile.txt" should exist                                                                                    # FeatureContext::asFileOrFolderShouldExist()

--- Failed scenarios:

    /home/phil/git/owncloud/core/apps-external/guests/tests/acceptance/features/apiGuests/guests.feature:575

1 scenario (1 failed)
12 steps (10 passed, 1 failed, 1 skipped)
0m25.98s (18.76Mb)
runsh: Total 1 scenarios (0 passed, 1 failed)
runsh: Exit code of main run: 1
runsh: Total unexpected failed scenarios throughout the test run:
apiGuests/guests.feature:575

When I use core from the PR, it passes.

Related Issue

https://github.com/owncloud/enterprise/issues/5842

and core PR owncloud/core#40864

How Has This Been Tested?

CI and locally

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)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@phil-davis phil-davis added the QA label Jul 10, 2023
@phil-davis phil-davis self-assigned this Jul 10, 2023
@phil-davis
Copy link
Copy Markdown
Contributor Author

Note: I expect this to fail today. The core daily-master tarball will be rebuilt overnight and tomorrow it will contain the core fix. I will re-run CI tomorrow and it should pass.

@phil-davis phil-davis marked this pull request as ready for review July 11, 2023 07:49
Comment thread tests/acceptance/features/apiGuests/guests.feature Outdated
Comment thread tests/acceptance/features/apiGuests/guests.feature Outdated
Copy link
Copy Markdown
Contributor

@amrita-shrestha amrita-shrestha left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

LGTM

@phil-davis phil-davis force-pushed the test-for-core-40864 branch from 75f3bd2 to bc8d385 Compare July 12, 2023 04:51
@phil-davis phil-davis merged commit d9b8dab into master Jul 12, 2023
@delete-merged-branch delete-merged-branch Bot deleted the test-for-core-40864 branch July 12, 2023 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants