<commit_before>Feature: domain for profile

  As a user
  I want access a profile by its own domain

  Background:
    Given the following user
      | login     | name       |
      | joaosilva | <NAME> |
    And the following communities
      | identifier       | name             | domain    |
      | sample-community | Sample Community | localhost |
    And the following blocks
      | owner            | type              |
      | joaosilva        | ProfileInfoBlock  |
    And the environment domain is "127.0.0.1"
    And "<NAME>" is environment admin
    And "<NAME>" is admin of "Sample Community"

  @selenium
  Scenario: access profile control panel through profile blocks
    Given I am logged in as "joaosilva"
    When I go to joaosilva's homepage
    And I follow "Control panel" within ".profile-info-block"
    Then I should see "<NAME>" within "span.control-panel-title"
    When I follow "Control panel" within ".profile-image-block"
    Then I should see "<NAME>" within "span.control-panel-title"

  @selenium
  Scenario: access user control panel
    Given I am logged in as "joaosilva"
    When I go to the homepage
    And I follow "joaosilva"
    And I go to sample-community's homepage
    And I follow "Login"
    And I fill in "joaosilva" for "Username"
    And I fill in "<PASSWORD>" for "Password"
    And I press "Log in"
    And I follow "Control panel" within "div#user"
    Then I should see "<NAME>" within "span.control-panel-title"

  # Looking for page title is problematic on selenium since it considers the
  # title to be invibible. Checkout some information about this:
  #   * https://github.com/jnicklas/capybara/issues/863
  #   * https://github.com/jnicklas/capybara/pull/953
  @selenium
  Scenario: access user page
    Given I am logged in as "joaosilva"
    When I go to the homepage
    And I follow "joaosilva"
    Then I should be on joaosilva's profile
    And I should see "<NAME>" within any "h1"
    #And the page title should be "<NAME>"

  Scenario: access community by domain
    Given I go to the search communities page
    When I follow "Sample Community" within ".search-profile-item"
    Then the page title should be "Sample Community - Colivre.net"

  # This test is not working because the community domain isn't at all different
  # from the environment (localhost / 127.0.0.1)
  @fixme
  Scenario: Go to profile homepage after clicking on home button on not found page
    Given I am on sample-community's homepage
    When I go to /something-that-does-not-exist
    And I follow "Go to the home page"
    Then the page title should be "Sample Community - Colivre.net"

  Scenario: Go to environment homepage after clicking on home button on not found page<commit_msg>profile-domain: title no longer carry the network name necessarily<commit_after>Feature: domain for profile

  As a user
  I want access a profile by its own domain

  Background:
    Given the following user
      | login     | name       |
      | joaosilva | <NAME> |
    And the following communities
      | identifier       | name             | domain    |
      | sample-community | Sample Community | localhost |
    And the following blocks
      | owner            | type              |
      | joaosilva        | ProfileInfoBlock  |
    And the environment domain is "127.0.0.1"
    And "<NAME>" is environment admin
    And "<NAME>" is admin of "Sample Community"

  @selenium
  Scenario: access profile control panel through profile blocks
    Given I am logged in as "joaosilva"
    When I go to joaosilva's homepage
    And I follow "Control panel" within ".profile-info-block"
    Then I should see "<NAME>" within "span.control-panel-title"
    When I follow "Control panel" within ".profile-image-block"
    Then I should see "<NAME>" within "span.control-panel-title"

  @selenium
  Scenario: access user control panel
    Given I am logged in as "joaosilva"
    When I go to the homepage
    And I follow "joaosilva"
    And I go to sample-community's homepage
    And I follow "Login"
    And I fill in "joaosilva" for "Username"
    And I fill in "<PASSWORD>" for "Password"
    And I press "Log in"
    And I follow "Control panel" within "div#user"
    Then I should see "<NAME>" within "span.control-panel-title"

  # Looking for page title is problematic on selenium since it considers the
  # title to be invibible. Checkout some information about this:
  #   * https://github.com/jnicklas/capybara/issues/863
  #   * https://github.com/jnicklas/capybara/pull/953
  @selenium
  Scenario: access user page
    Given I am logged in as "joaosilva"
    When I go to the homepage
    And I follow "joaosilva"
    Then I should be on joaosilva's profile
    And I should see "<NAME>" within any "h1"
    #And the page title should be "<NAME>"

  Scenario: access community by domain
    Given I go to the search communities page
    When I follow "Sample Community" within ".search-profile-item"
    Then the page title should be "Sample Community"

  # This test is not working because the community domain isn't at all different
  # from the environment (localhost / 127.0.0.1)
  @fixme
  Scenario: Go to profile homepage after clicking on home button on not found page
    Given I am on sample-community's homepage
    When I go to /something-that-does-not-exist
    And I follow "Go to the home page"
    Then the page title should be "Sample Community - Colivre.net"

  Scenario: Go to environment homepage after clicking on home button on not found page
{'fraction_non_alphanumeric': 0.0706393769244702, 'fraction_numerical': 0.006882811084948379, 'mean_word_length': 2.81881051175657, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3928152', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1543, 'n_words': 704}