<commit_before>Feature: edit article
  As a noosfero user
  I want to create and edit articles

  Background:
    Given I am on the homepage
    And the following users
      | login     | name       |
      | joaosilva | <NAME> |
    And the following articles
      | owner     | name              | body |
      | joaosilva | Save the whales   | ...  |
    And I am logged in as "joaosilva"

  Scenario: create a folder
    Given I am on joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I press "Save"
    And I go to joaosilva's control panel
    And I follow "Manage Content"
    Then I should see "My Folder"

  @selenium
  Scenario: denied access folder for a not logged user
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I uncheck "article_show_to_followers"
    And I press "Save"
    And I log off
    And I go to /freesoftware/my-folder
    Then I should see "Access denied"

  @selenium
  Scenario: Hide token field when show to members is activated
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I check "article_show_to_followers"
    Then I should not see "Fill in the search"

  @selenium
  Scenario: show exception users field when you choose the private option
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I uncheck "article_show_to_followers"
    Then I should see "Fill in the search field to add the exception users to see this content"

  @selenium
  Scenario: allowed user should see the content of a folder
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And the following articles
      | owner        | name       | body |
      | freesoftware | My Folder  | ...  |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I go to /freesoftware/my-folder
    When I follow "Edit"
    And I choose "article_published_false"
    And I press "Save"
    And I add to "My Folder" the following exception "<NAME>"
    And I am logged in as "maria"
    And I go to /freesoftware/my-folder<commit_msg>Fix "edit article" test for private articles<commit_after>Feature: edit article
  As a noosfero user
  I want to create and edit articles

  Background:
    Given I am on the homepage
    And the following users
      | login     | name       |
      | joaosilva | <NAME> |
    And the following articles
      | owner     | name              | body |
      | joaosilva | Save the whales   | ...  |
    And I am logged in as "joaosilva"

  Scenario: create a folder
    Given I am on joaosilva's control panel
    And I follow "Manage Content"
    And I follow "New content"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I press "Save"
    And I go to joaosilva's control panel
    And I follow "Manage Content"
    Then I should see "My Folder"

  @selenium
  Scenario: denied access folder for a not logged user
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I uncheck "article_show_to_followers"
    And I press "Save"
    And I log off
    And I go to /freesoftware/my-folder
    Then I should see "Access denied"

  @selenium
  Scenario: Hide token field when show to members is activated
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I check "article_show_to_followers"
    Then I should not see "Fill in the search"

  @selenium
  Scenario: show exception users field when you choose the private option
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME> |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I am on freesoftware's control panel
    And I follow "Manage Content"
    And I should see "New content"
    And I follow "New content"
    And I should see "Folder"
    When I follow "Folder"
    And I fill in "Title" with "My Folder"
    And I choose "article_published_false"
    And I uncheck "article_show_to_followers"
    Then I should see "Allow only community members entered below to view this content"

  @selenium
  Scenario: allowed user should see the content of a folder
    Given the following communities
      | name           | identifier    | owner     |
      | Free Software  | freesoftware  | joaosilva |
    And the following users
      | login | name        |
      | mario | <NAME> |
      | maria | <NAME>va |
    And the following articles
      | owner        | name       | body |
      | freesoftware | My Folder  | ...  |
    And "<NAME>" is a member of "Free Software"
    And "<NAME>" is a member of "Free Software"
    And I go to /freesoftware/my-folder
    When I follow "Edit"
    And I choose "article_published_false"
    And I press "Save"
    And I add to "My Folder" the following exception "<NAME>"
    And I am logged in as "maria"
    And I go to /freesoftware/my-folder
{'fraction_non_alphanumeric': 0.06963958460598656, 'fraction_numerical': 0.0, 'mean_word_length': 2.2600557546794104, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '335161', 'n_tokens_mistral': 2436, 'n_tokens_neox': 2399, 'n_words': 1067}