<commit_before>@api
Feature: delete folder
  As a user
  I want to be able to delete folders
  So that I can quickly remove unwanted data

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files
    And user "Alice" creates folder "/PARENT" using the WebDAV API

  @smokeTest
  Scenario Outline: delete a folder
    Given using <dav_version> DAV path
    When user "Alice" deletes folder "/PARENT" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT" should not exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @issue-ocis-reva-269
  Scenario Outline: delete a folder when 2 folder exist with different case
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/parent"
    When user "Alice" deletes folder "/PARENT" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT" should not exist
    But as "Alice" folder "/parent" should exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @issue-ocis-reva-269
  Scenario Outline: delete a sub-folder
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/PARENT/CHILD"
    And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/PARENT/parent.txt"
    When user "Alice" deletes folder "/PARENT/CHILD" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT/CHILD" should not exist
    But as "Alice" folder "/PARENT" should exist
    And as "Alice" file "/PARENT/parent.txt" should exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @files_sharing-app-required @issue-ocis-reva-11
  Scenario Outline: delete a folder when there is a default folder for received shares
    Given using <dav_version> DAV path
    And the administrator has set the default folder for received shares to "<share_folder>"
    And user "Brian" has been created with default attributes and without skeleton files
    And user "Brian" has created folder "/Received"
    And user "Brian" has created folder "/Top"
    And user "Brian" has created folder "/Top/ReceivedShares"
    And user "Alice" has shared folder "/PARENT" with user "Brian"
    When user "Brian" deletes folder "<share_folder>" using the WebDAV API
    Then the HTTP status code should be "403"
    And as "Brian" folder "<share_folder>/PARENT" should exist
    And user "Brian" should be able to delete folder "/Received"
    And user "Brian" should be able to delete folder "/Top/ReceivedShares"
    And user "Brian" should be able to delete folder "/Top"
    Examples:
      | dav_version | share_folder    |
      | old         | /ReceivedShares |
      | new         | /ReceivedShares |
      | old         | ReceivedShares  |
      | new         | ReceivedShares  |

  @files_sharing-app-required @issue-ocis-reva-11
  Scenario Outline: delete a folder when there is a default folder for received shares that is a multi-level path
    Given using <dav_version> DAV path
    And the administrator has set the default folder for received shares to "/My/Received/Shares"
    And user "Brian" has been created with default attributes and without skeleton files
    And user "Brian" has created folder "/M"
    And user "Brian" has created folder "/Received"
    And user "Brian" has created folder "/Received/Shares"
    And user "Alice" has shared folder "/PARENT" with user "Brian"
    When user "Brian" deletes folder "/My/Received/Shares" using the WebDAV API
    Then the HTTP status code should be "403"
    And user "Brian" should not be able to delete folder "/My/Received"
    And user "Brian" should not be able to delete folder "/My"
    And as "Brian" folder "/My/Received/Shares/PARENT" should exist
    But user "Brian" should be able to delete folder "/M"
    And user "Brian" should be able to delete folder "/Received/Shares"
    And user "Brian" should be able to delete folder "/Received"
    Examples:
      | dav_version |
      | old         |
      | new         |

  Scenario Outline: deleting folder with dot in the name
    Given using <dav_version> DAV path
    And user "Alice" has created folder "<folder_name>"<commit_msg>Add @notToImplementOnOCIS tag on tests<commit_after>@api
Feature: delete folder
  As a user
  I want to be able to delete folders
  So that I can quickly remove unwanted data

  Background:
    Given user "Alice" has been created with default attributes and without skeleton files
    And user "Alice" creates folder "/PARENT" using the WebDAV API

  @smokeTest
  Scenario Outline: delete a folder
    Given using <dav_version> DAV path
    When user "Alice" deletes folder "/PARENT" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT" should not exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @issue-ocis-reva-269
  Scenario Outline: delete a folder when 2 folder exist with different case
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/parent"
    When user "Alice" deletes folder "/PARENT" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT" should not exist
    But as "Alice" folder "/parent" should exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @issue-ocis-reva-269
  Scenario Outline: delete a sub-folder
    Given using <dav_version> DAV path
    And user "Alice" has created folder "/PARENT/CHILD"
    And user "Alice" has uploaded file "filesForUpload/lorem.txt" to "/PARENT/parent.txt"
    When user "Alice" deletes folder "/PARENT/CHILD" using the WebDAV API
    Then the HTTP status code should be "204"
    And as "Alice" folder "/PARENT/CHILD" should not exist
    But as "Alice" folder "/PARENT" should exist
    And as "Alice" file "/PARENT/parent.txt" should exist
    Examples:
      | dav_version |
      | old         |
      | new         |

  @files_sharing-app-required @notToImplementOnOCIS
  Scenario Outline: delete a folder when there is a default folder for received shares
    Given using <dav_version> DAV path
    And the administrator has set the default folder for received shares to "<share_folder>"
    And user "Brian" has been created with default attributes and without skeleton files
    And user "Brian" has created folder "/Received"
    And user "Brian" has created folder "/Top"
    And user "Brian" has created folder "/Top/ReceivedShares"
    And user "Alice" has shared folder "/PARENT" with user "Brian"
    When user "Brian" deletes folder "<share_folder>" using the WebDAV API
    Then the HTTP status code should be "403"
    And as "Brian" folder "<share_folder>/PARENT" should exist
    And user "Brian" should be able to delete folder "/Received"
    And user "Brian" should be able to delete folder "/Top/ReceivedShares"
    And user "Brian" should be able to delete folder "/Top"
    Examples:
      | dav_version | share_folder    |
      | old         | /ReceivedShares |
      | new         | /ReceivedShares |
      | old         | ReceivedShares  |
      | new         | ReceivedShares  |

  @files_sharing-app-required @notToImplementOnOCIS
  Scenario Outline: delete a folder when there is a default folder for received shares that is a multi-level path
    Given using <dav_version> DAV path
    And the administrator has set the default folder for received shares to "/My/Received/Shares"
    And user "Brian" has been created with default attributes and without skeleton files
    And user "Brian" has created folder "/M"
    And user "Brian" has created folder "/Received"
    And user "Brian" has created folder "/Received/Shares"
    And user "Alice" has shared folder "/PARENT" with user "Brian"
    When user "Brian" deletes folder "/My/Received/Shares" using the WebDAV API
    Then the HTTP status code should be "403"
    And user "Brian" should not be able to delete folder "/My/Received"
    And user "Brian" should not be able to delete folder "/My"
    And as "Brian" folder "/My/Received/Shares/PARENT" should exist
    But user "Brian" should be able to delete folder "/M"
    And user "Brian" should be able to delete folder "/Received/Shares"
    And user "Brian" should be able to delete folder "/Received"
    Examples:
      | dav_version |
      | old         |
      | new         |

  Scenario Outline: deleting folder with dot in the name
    Given using <dav_version> DAV path
    And user "Alice" has created folder "<folder_name>"
{'fraction_non_alphanumeric': 0.07312001848215317, 'fraction_numerical': 0.005544645951253321, 'mean_word_length': 2.860008916629514, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '375300', 'n_tokens_mistral': 2561, 'n_tokens_neox': 2399, 'n_words': 1103}