<commit_before>@not-production @functional-test
Feature: Admin user journey through Digital Marketplace

Scenario: Setup for tests
  Given I have a test supplier
  And The test supplier has a service

Scenario: As an admin user I wish be able to log in and to log out of Digital Marketplace
  Given I am on the 'Administrator' login page
  When I login as a 'Administrator' user
  Then I am presented with the 'Admin' page
  When I click 'Log out'
  Then I am logged out of Digital Marketplace as a 'Administrator' user

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for a service by service ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '1123456789012346' in the 'service_id' field
  And I click the search button for 'service_id'
  Then I am presented with the summary page for that service

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for services by supplier ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '11111' in the 'supplier_id_for_services' field
  And I click the search button for 'supplier_id_for_services'
  Then I am presented with the 'Services' page for the supplier 'DM Functional Test Supplier'

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for services by supplier ID and view a specific service
  Given I am logged in as a 'Administrator' and navigated to the 'Services' page by searching on supplier ID '11111'
  When I select the second listing on the page
  Then I am presented with the service page for that specific listing

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for users by supplier ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '11111' in the 'supplier_id_for_users' field
  And I click the search button for 'supplier_id_for_users'
  Then I am presented with the 'Users' page for the supplier 'DM Functional Test Supplier'

Scenario: Admin user should be able to abort an edit and be returned to the service summary page
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I click the 'Edit' link for 'Description'
  And I click 'Return without saving'
  Then I am presented with the summary page with no changes made to the 'Description'

Scenario: As an admin user I wish to edit the features and benefits of a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Features and benefits' page
  And I change 'serviceFeatures-3' to 'Service feature changed'
  And I remove service benefit number 2
  And I add 'New service feature' as a 'serviceFeatures'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Feature and benefits'

Scenario: As an admin user I wish to edit the pricing of a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Pricing' page
  And I change 'priceMin' to '100'
  And I change 'priceMax' to '1234'
  And I set 'priceUnit' as 'Person'
  And I set 'priceInterval' as 'Week'
  And I choose 'No' for 'vatIncluded'
  And I choose 'No' for 'educationPricing'
  And I choose 'Yes' for 'terminationCost'
  And I choose 'Yes' for 'trialOption'
  And I choose 'No' for 'freeOption'
  And I choose 'Other' for 'minimumContractPeriod'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Pricing'

Scenario: As an admin user I wish to edit the description of a service. Service selected via supplier ID search.
  Given I am logged in as a 'Administrator' and navigated to the 'Services' page by searching on supplier ID '11111'
  When I click Edit for the service '1123456789012346'
  Then I am presented with the summary page for that service
  When I navigate to the 'edit' 'Documents' page
  And I change 'serviceDefinitionDocumentURL' file to '12345-test-new-service-definition-document.pdf'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Documents'

Scenario: As an admin user I wish to change a document of a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Documents' page
  And I change 'pricingDocumentURL' file to '12345-test-new-pricing-document.pdf'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Documents'

Scenario: Admin user is able to view service details page for a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I click 'View service'
  Then I am presented with the service details page for that service

Scenario: Admin changes service status to 'Removed'. The change is reflected in the supplier and/or buyer app<commit_msg>new admin scenarios added and implemented, some refactoring and some house keeping<commit_after>@not-production @functional-test
Feature: Admin user journey through Digital Marketplace

Scenario: Setup for tests
  Given I have a test supplier
  And The test supplier has a service

Scenario: As an admin user I wish be able to log in and to log out of Digital Marketplace
  Given I am on the 'Administrator' login page
  When I login as a 'Administrator' user
  Then I am presented with the 'Admin' page
  When I click 'Log out'
  Then I am logged out of Digital Marketplace as a 'Administrator' user

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for a service by service ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '1123456789012346' in the 'service_id' field
  And I click the search button for 'service_id'
  Then I am presented with the summary page for that service

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for services by supplier ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '11111' in the 'supplier_id_for_services' field
  And I click the search button for 'supplier_id_for_services'
  Then I am presented with the 'Services' page for the supplier 'DM Functional Test Supplier'

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for services by supplier ID and view a specific service
  Given I am logged in as a 'Administrator' and navigated to the 'Services' page by searching on supplier ID '11111'
  When I select the second listing on the page
  Then I am presented with the service page for that specific listing

Scenario: As an admin user who has logged in to Digital Marketplace, I wish to search for users by supplier ID
  Given I have logged in to Digital Marketplace as a 'Administrator' user
  When I enter '11111' in the 'supplier_id_for_users' field
  And I click the search button for 'supplier_id_for_users'
  Then I am presented with the 'Users' page for the supplier 'DM Functional Test Supplier'

Scenario: Admin user should be able to abort an edit and be returned to the service summary page
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I click the 'Edit' link for 'Description'
  And I click 'Return without saving'
  Then I am presented with the summary page with no changes made to the 'Description'

Scenario: As an admin user I wish to edit the features and benefits of a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Features and benefits' page
  And I change 'serviceFeatures-3' to 'Service feature changed'
  And I remove service benefit number 2
  And I add 'New service feature' as a 'serviceFeatures'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Feature and benefits'

Scenario: As an admin user I wish to edit the pricing of a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Pricing' page
  And I change 'priceMin' to '100'
  And I change 'priceMax' to '1234'
  And I set 'priceUnit' as 'Person'
  And I set 'priceInterval' as 'Week'
  And I choose 'No' for 'vatIncluded'
  And I choose 'No' for 'educationPricing'
  And I choose 'Yes' for 'terminationCost'
  And I choose 'Yes' for 'trialOption'
  And I choose 'No' for 'freeOption'
  And I choose 'Other' for 'minimumContractPeriod'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Pricing'

Scenario: As an admin user I wish to change a document for a service. Service selected via supplier ID search.
  Given I am logged in as a 'Administrator' and navigated to the 'Services' page by searching on supplier ID '11111'
  When I click Edit for the service '1123456789012346'
  Then I am presented with the summary page for that service
  When I navigate to the 'edit' 'Documents' page
  And I change 'serviceDefinitionDocumentURL' file to '12345-test-new-service-definition-document.pdf'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Documents'

Scenario: As an admin user I wish to change a document for a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I navigate to the 'edit' 'Documents' page
  And I change 'pricingDocumentURL' file to '12345-test-new-pricing-document.pdf'
  And I click 'Save and return to summary'
  Then I am presented with the summary page with the changes that were made to the 'Documents'

Scenario: Admin user is able to view service details page for a service
  Given I am logged in as a 'Administrator' and am on the '1123456789012346' service summary page
  When I click 'View service'
  Then I am presented with the service details page for that service

Scenario: Admin changes service status to 'Removed'. The change is reflected in the supplier and/or buyer app
{'fraction_non_alphanumeric': 0.04161882893226177, 'fraction_numerical': 0.028893991580558744, 'mean_word_length': 4.1645256916996045, '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': '3078058', 'n_tokens_mistral': 3011, 'n_tokens_neox': 2756, 'n_words': 1714}