<commit_before>@api @files_sharing-app-required @public_link_share-feature-required @issue-ocis-reva-49
Feature: upload to a public link share

  Background:
    Given user "Alice" has been created with default attributes and skeleton files

  @smokeTest @skipOnOcis
  Scenario: Uploading same file to a public upload-only share multiple times via old API
    # The old API needs to have the header OC-Autorename: 1 set to do the autorename
    Given user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When the public uploads file "test.txt" with content "test" using the old public WebDAV API
    And the public uploads file "test.txt" with content "test2" with auto-rename mode using the old public WebDAV API
    Then the HTTP status code should be "201"
    And the following headers should match these regular expressions
      | ETag | /^"[a-f0-9:]{1,32}"$/ |
    And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
    And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

  @smokeTest @skipOnOcis @issue-ocis-reva-286
  Scenario: Uploading same file to a public upload-only share multiple times via new API
    # The new API does the autorename automatically in upload-only folders
    Given the administrator has enabled DAV tech_preview
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When the public uploads file "test.txt" with content "test" using the new public WebDAV API
    When the public uploads file "test.txt" with content "test2" using the new public WebDAV API
    Then the HTTP status code should be "201"
    And the following headers should match these regular expressions
      | ETag | /^"[a-f0-9:]{1,32}"$/ |
    And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
    And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

  @skipOnOcis
  Scenario Outline: Uploading file to a public upload-only share using old public API that was deleted does not work
    Given using <dav-path> DAV path
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When user "Alice" deletes file "/FOLDER" using the WebDAV API
    Then uploading a file should not work using the old public WebDAV API
    And the HTTP status code should be "404"
    Examples:
      | dav-path |
      | old      |
      | new      |

  @skipOnOcis @issue-ocis-reva-290
  Scenario Outline: Uploading file to a public upload-only share using new public API that was deleted does not work
    Given using <dav-path> DAV path
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When user "Alice" deletes file "/FOLDER" using the WebDAV API
    Then uploading a file should not work using the new public WebDAV API
    And the HTTP status code should be "404"
    Examples:
      | dav-path |
      | old      |
      | new      |

  @skipOnOcV10 @issue-ocis-reva-290<commit_msg>skip on old oC10 test fixed in PR 37625<commit_after>@api @files_sharing-app-required @public_link_share-feature-required @issue-ocis-reva-49
Feature: upload to a public link share

  Background:
    Given user "Alice" has been created with default attributes and skeleton files

  @smokeTest @skipOnOcis
  Scenario: Uploading same file to a public upload-only share multiple times via old API
    # The old API needs to have the header OC-Autorename: 1 set to do the autorename
    Given user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When the public uploads file "test.txt" with content "test" using the old public WebDAV API
    And the public uploads file "test.txt" with content "test2" with auto-rename mode using the old public WebDAV API
    Then the HTTP status code should be "201"
    And the following headers should match these regular expressions
      | ETag | /^"[a-f0-9:]{1,32}"$/ |
    And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
    And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

  @smokeTest @skipOnOcis @issue-ocis-reva-286
  Scenario: Uploading same file to a public upload-only share multiple times via new API
    # The new API does the autorename automatically in upload-only folders
    Given the administrator has enabled DAV tech_preview
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When the public uploads file "test.txt" with content "test" using the new public WebDAV API
    When the public uploads file "test.txt" with content "test2" using the new public WebDAV API
    Then the HTTP status code should be "201"
    And the following headers should match these regular expressions
      | ETag | /^"[a-f0-9:]{1,32}"$/ |
    And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
    And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"

  @skipOnOcis
  Scenario Outline: Uploading file to a public upload-only share using old public API that was deleted does not work
    Given using <dav-path> DAV path
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When user "Alice" deletes file "/FOLDER" using the WebDAV API
    Then uploading a file should not work using the old public WebDAV API
    And the HTTP status code should be "404"
    Examples:
      | dav-path |
      | old      |
      | new      |

  @skipOnOcV10.3 @skipOnOcV10.4 @skipOnOcis @issue-ocis-reva-290
  Scenario Outline: Uploading file to a public upload-only share using new public API that was deleted does not work
    Given using <dav-path> DAV path
    And user "Alice" has created a public link share with settings
      | path        | FOLDER |
      | permissions | create |
    When user "Alice" deletes file "/FOLDER" using the WebDAV API
    Then uploading a file should not work using the new public WebDAV API
    And the HTTP status code should be "404"
    Examples:
      | dav-path |
      | old      |
      | new      |

  @skipOnOcV10 @issue-ocis-reva-290
{'fraction_non_alphanumeric': 0.06799130704750078, 'fraction_numerical': 0.01505743557901273, 'mean_word_length': 2.950337216431637, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7323767', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1857, 'n_words': 855}