<commit_before>@admin
Feature: Search by registered supplier name

@search-supplier-name
Scenario Outline: Correct users search for a supplier by registered name
  Given I am logged in as the existing <role> user
  And I have a supplier with:
    | name           | DM Functional Test Supplier - Search supplier name feature |
    | registeredName | DM Functional Test Supplier - Search registered supplier name |
  And I click the '<link-name>' link
  And I enter 'Functional Test Supplier - Search registered' in the 'Find a supplier by name' field
  And I click the 'find_supplier_by_name_search' button
  Then I see an entry in the 'Suppliers' table with:
    | Name                                                       | Users | Services |
    | DM Functional Test Supplier - Search supplier name feature | Users | Services |

  Examples:
    | role                      | link-name                               |
    | admin                     | Edit supplier accounts or view services |
    | admin-ccs-category        | Edit suppliers and services             |


@search-supplier-name @with-admin-ccs-data-controller-user
Scenario: Admin data controller user can search for a supplier by registered name
  Given I am logged in as the existing admin-ccs-data-controller user
  And I have a supplier with:
    | name           | DM Functional Test Supplier - Search supplier name feature |
    | registeredName | DM Functional Test Supplier - Search registered supplier name |
  And I click the 'View and edit suppliers' link
  And I enter 'Functional Test Supplier - Search registered' in the 'Find a supplier by name' field
  And I click the 'find_supplier_by_name_search' button
  Then I see an entry in the 'Suppliers' table with:
    | Name                                                       | Users | Services |
    | DM Functional Test Supplier - Search supplier name feature | Users | Services |


@search-supplier-duns @with-admin-ccs-data-controller-user
Scenario: Admin data controller user can search for a supplier by DUNS number
  Given I am logged in as the existing admin-ccs-data-controller user
  And I have a random supplier from the API
  And I click the 'View and edit suppliers' link
  And I click the 'DUNS Number' link
  When I enter that supplier.dunsNumber in the 'Find a supplier by DUNS number' field
  And I click the 'find_supplier_by_duns_number_search' button
  And I see that supplier in the list of suppliers
<commit_msg>Consolidate search scenarios for admin roles<commit_after>@admin
Feature: Search for suppliers by registered name, DUNS number and companies house number

@search-supplier-name
Scenario Outline: Correct users search for a supplier by registered name
  Given I am logged in as the existing <role> user
  And I have a supplier with:
    | name           | DM Functional Test Supplier - Search supplier name feature |
    | registeredName | DM Functional Test Supplier - Search registered supplier name |
  And I click the '<link-name>' link
  And I enter 'Functional Test Supplier - Search registered' in the 'Find a supplier by name' field
  And I click the 'find_supplier_by_name_search' button
  Then I see an entry in the 'Suppliers' table with:
    | Name                                                       | Users | Services |
    | DM Functional Test Supplier - Search supplier name feature | Users | Services |

  Examples:
    | role                      | link-name                               |
    | admin                     | Edit supplier accounts or view services |
    | admin-ccs-category        | Edit suppliers and services             |
    | admin-ccs-data-controller | View and edit suppliers                 |


@search-supplier-duns @with-admin-ccs-data-controller-user
Scenario: Admin data controller user can search for a supplier by DUNS number
  Given I am logged in as the existing admin-ccs-data-controller user
  And I have a random supplier from the API
  And I click the 'View and edit suppliers' link
  And I click the 'DUNS Number' link
  When I enter that supplier.dunsNumber in the 'Find a supplier by DUNS number' field
  And I click the 'find_supplier_by_duns_number_search' button
  And I see that supplier in the list of suppliers

{'fraction_non_alphanumeric': 0.049010367577756835, 'fraction_numerical': 0.0, 'mean_word_length': 2.5523012552301254, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '359112', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1035, 'n_words': 518}