<commit_before>Feature: Manage Realms
  In order to manage realms
  As an admin
  I want to add/edit/remove realms

  Background:
    Given I am an authorised user
    And I am logged in
    And there's no realm
    And a realm "testrealm1" exists

  Scenario: Create new frontend realm
    Given I am on the realms page
    When I follow "new_realm_button"
    Then I should be on the new realm page
    When I fill in "frontend_realm_name" with "testrealm2"
    And I press "Save"
    Then I should see a confirmation message

  Scenario: Validate unique frontend realm name
    Given I am on the realms page
    And there is a realm "testrealm1"
    When I follow "new_realm_button"
    Then I should be on the new realm page
    When I fill in "frontend_realm_name" with "testrealm1"
    And I press "frontend_realm_submit"
    Then I should see an error message

  Scenario: Add realm mapping
    Given I am on the realms page
    And there is a realm "testrealm1"
    And a provider "provider1" exists
    When I follow "testrealm1"
    Then I should see "Add mapping to provider"
    And I follow "mapping_to_provider_button"
    Then I should be on the new realm mapping page
    When I press "realm_backend_target_submit"
    Then I should see a confirmation message

  Scenario: No 'add mapping to provider' if none exist
    Given I am on the realms page
    And there is a realm "testrealm1"
    And there is no provider
    When I follow "testrealm1"
    Then I should not see "Add mapping to provider"

  Scenario: Change the name
    Given I am on the realms page
    And there is a realm "testrealm1"
    When I follow "testrealm1"
    And I follow "edit_realm_button"
    Then I should see "Properties"
    When I fill in "frontend_realm_name" with "testrealm2"
    And I press "frontend_realm_submit"
    Then I should see a confirmation message

  Scenario: Show realm detials<commit_msg>Fixes failing test<commit_after>Feature: Manage Realms
  In order to manage realms
  As an admin
  I want to add/edit/remove realms

  Background:
    Given I am an authorised user
    And I am logged in
    And there's no realm
    And a realm "testrealm1" exists

  Scenario: Create new frontend realm
    Given I am on the realms page
    When I follow "new_realm_button"
    Then I should be on the new realm page
    When I fill in "frontend_realm_name" with "testrealm2"
    And I press "Save"
    Then I should see a confirmation message

  Scenario: Validate unique frontend realm name
    Given I am on the realms page
    And there is a realm "testrealm1"
    When I follow "new_realm_button"
    Then I should be on the new realm page
    When I fill in "frontend_realm_name" with "testrealm1"
    And I press "frontend_realm_submit"
    Then I should see an error message

  Scenario: Add realm mapping
    Given I am on the realms page
    And there is a realm "testrealm1"
    And a provider "provider1" exists
    When I follow "testrealm1"
    And I follow "mapping_to_provider_button"
    Then I should be on the new realm mapping page
    When I press "realm_backend_target_submit"
    Then I should see a confirmation message

  Scenario: No 'add mapping to provider' if none exist
    Given I am on the realms page
    And there is a realm "testrealm1"
    And there is no provider
    When I follow "testrealm1"
    Then I should not see "Add mapping to provider"

  Scenario: Change the name
    Given I am on the realms page
    And there is a realm "testrealm1"
    When I follow "testrealm1"
    And I follow "edit_realm_button"
    Then I should see "Properties"
    When I fill in "frontend_realm_name" with "testrealm2"
    And I press "frontend_realm_submit"
    Then I should see a confirmation message

  Scenario: Show realm detials
{'fraction_non_alphanumeric': 0.03553434102360117, 'fraction_numerical': 0.006364359586316627, 'mean_word_length': 3.0955483170466884, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2854283', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1123, 'n_words': 555}