<commit_before>/* eslint-disable cypress/no-unnecessary-waiting */

function setCustom(settingKey, newValue, scenario = 'primary') {
  // sets a value in the "Customize Profile Request" box
  let newConfig = {}
  cy.get(`@${scenario}`)
    .findByRole('tab', {name: /Custom JSON editor/i})
    .click()

  cy.get(`@${scenario}`)
    .findByLabelText(/Customize Profile Request/i)
    .as('profile')
    .invoke('val')
    .then((currentConfig) => {
      newConfig = JSON.parse(currentConfig)
      newConfig[settingKey] = newValue

      return cy
        .get('@profile')<commit_msg>Update selector to match label name<commit_after>/* eslint-disable cypress/no-unnecessary-waiting */

/**
 * Sets a value in the custom JSON editor
 */
function setCustom(settingKey, newValue, scenario = 'primary') {
  let newConfig = {}
  cy.get(`@${scenario}`)
    .findByRole('tab', {name: /Custom JSON editor/i})
    .click()

  cy.get(`@${scenario}`)
    .findByLabelText(/Customize analysis request/i)
    .as('profile')
    .invoke('val')
    .then((currentConfig) => {
      newConfig = JSON.parse(currentConfig)
      newConfig[settingKey] = newValue

      return cy
        .get('@profile')
{'fraction_non_alphanumeric': 0.15851602023608768, 'fraction_numerical': 0.0, 'mean_word_length': 3.3800738007380073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6064585', 'n_tokens_mistral': 381, 'n_tokens_neox': 376, 'n_words': 83}