<commit_before>const {
  getSelectorForElementWithText,
  getButtonWithText,
  getMetaListItemValueSelector,
} = require('../../../helpers/selectors')

const getBadgeWithText = (text) => getSelectorForElementWithText(
  text,
  {
    el: '//span',
    className: 'c-meta-list__item-label',
    child: '/following-sibling::span',
  },
)

module.exports = {
  url: `${process.env.QA_HOST}/companies`,
  props: {},
  elements: {
    h1Element: '.c-local-header__heading',
    addCompanyButton: getButtonWithText('Add company'),
  },
  sections: {
    firstCompanyInList: {
      selector: '.c-entity-list li:first-child',
      elements: {
        header: {
          selector: '.c-entity__header a',
        },
        companySector: getMetaListItemValueSelector('Sector'),
        countryBadge: getBadgeWithText('Country'),
        ukRegionBadge: getBadgeWithText('UK region'),
      },
    },
    filters: {
      selector: '.c-collection-filters',
      elements: {
        company: '#field-name',
        sector: '#field-sector',
        country: '#field-country',
        ukRegion: '#field-uk_region',
      },
    },
    collectionHeader: {
      selector: '.c-collection__header',
      elements: {
        sortBy: '#field-sortby',
      },
    },
  },
}<commit_msg>add secondCompanyInList section and associated work<commit_after>const {
  getSelectorForElementWithText,
  getButtonWithText,
  getListItemMetaElementWithText,
} = require('../../../helpers/selectors')

const getBadgeWithText = (text) => getSelectorForElementWithText(
  text,
  {
    el: '//span',
    className: 'c-meta-list__item-label',
    child: '/following-sibling::span',
  },
)
const getFirstListItemMetaElementWithText = (text) => getListItemMetaElementWithText(text)
const getSecondListItemMetaElementWithText = (text) => getListItemMetaElementWithText(text, 2)

module.exports = {
  url: `${process.env.QA_HOST}/companies`,
  props: {},
  elements: {
    h1Element: '.c-local-header__heading',
    addCompanyButton: getButtonWithText('Add company'),
  },
  sections: {
    firstCompanyInList: {
      selector: '.c-entity-list li:first-child',
      elements: {
        header: {
          selector: '.c-entity__header a',
        },
        companySector: getFirstListItemMetaElementWithText('Sector'),
        updated: getFirstListItemMetaElementWithText('Updated'),
        countryBadge: getBadgeWithText('Country'),
        ukRegionBadge: getBadgeWithText('UK region'),
      },
    },
    secondCompanyInList: {
      selector: '.c-entity-list li:nth-child(2)',
      elements: {
        header: {
          selector: '.c-entity__header a',
        },
        companySector: getSecondListItemMetaElementWithText('Sector'),
        updated: getSecondListItemMetaElementWithText('Updated'),
        countryBadge: getBadgeWithText('Country'),
        ukRegionBadge: getBadgeWithText('UK region'),
      },
    },
    filters: {
      selector: '.c-collection-filters',
      elements: {
        company: '#field-name',
        sector: '#field-sector',
        country: '#field-country',
        ukRegion: '#field-uk_region',
      },
    },
    collectionHeader: {
      selector: '.c-collection__header',
      elements: {
        sortBy: '#field-sortby',
      },
    },
  },
}
{'fraction_non_alphanumeric': 0.1439509954058193, 'fraction_numerical': 0.001225114854517611, 'mean_word_length': 2.930204572803851, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3314580', 'n_tokens_mistral': 999, 'n_tokens_neox': 994, 'n_words': 156}