<commit_before>package pages.acquire

import helpers.webbrowser._
import org.openqa.selenium.WebDriver
import views.acquire.PrivateKeeperDetails._
import viewmodels.PrivateKeeperDetailsViewModel.Form._
import views.acquire.PrivateKeeperDetails.BackId

object PrivateKeeperDetailsPage extends Page with WebBrowserDSL {
  final val address = s"/$basePath/private-keeper-details"
  override val url: String = WebDriverFactory.testUrl + address.substring(1)
  final override val title: String = "Enter keeper details"

  final val TitleValid = "Mrs"
  final val TitleInvalid = ""
  final val OptionValid = "firstOption"
  final val FirstNameValid = "TestFirstName"
  final val FirstNameInvalid = ""
  final val SurnameValid = "TestSurname"
  final val SurnameInvalid = ""
  final val EmailValid = "<EMAIL>"
  final val EmailInvalid = "no_at_symbol.com"
  final val TitleInvalidError = "Please select a title from the drop down list."
  final val VehicleMakeValid = "Audi"
  final val ModelValid = "A6"

  def back(implicit driver: WebDriver): Element = find(id(BackId)).get

  def next(implicit driver: WebDriver): Element = find(id(SubmitId)).get

  def titleDropDown(implicit driver: WebDriver): SingleSel = singleSel(id(TitleId))

  def emailTextBox(implicit driver: WebDriver): EmailField = emailField(id(EmailId))

  def firstNameTextBox(implicit driver: WebDriver): TextField = textField(id(FirstNameId))

  def surnameTextBox(implicit driver: WebDriver): TextField = textField(id(SurnameId))


  def happyPath(title: String = OptionValid,
                firstName: String = FirstNameValid,
                surname: String = SurnameValid,
                email: String = EmailValid)(implicit driver: WebDriver) = {
    go to PrivateKeeperDetailsPage

    titleDropDown select title
    firstNameTextBox enter FirstNameValid
    surnameTextBox enter SurnameValid
    emailTextBox enter email

    click on next
  }

  def sadPath (title: String = TitleInvalid,
               firstName: String = FirstNameInvalid,
               surname: String = SurnameInvalid,<commit_msg>Tidied up code<commit_after>package pages.acquire

import helpers.webbrowser.{Page, WebBrowserDSL, WebDriverFactory, Element, SingleSel, EmailField, TextField}
import org.openqa.selenium.WebDriver
import views.acquire.PrivateKeeperDetails.{BackId, SubmitId}
import viewmodels.PrivateKeeperDetailsViewModel.Form.{TitleId, EmailId, FirstNameId, SurnameId}

object PrivateKeeperDetailsPage extends Page with WebBrowserDSL {
  final val address = s"/$basePath/private-keeper-details"
  override val url: String = WebDriverFactory.testUrl + address.substring(1)
  final override val title: String = "Enter keeper details"

  final val TitleValid = "Mrs"
  final val TitleInvalid = ""
  final val OptionValid = "firstOption"
  final val FirstNameValid = "TestFirstName"
  final val FirstNameInvalid = ""
  final val SurnameValid = "TestSurname"
  final val SurnameInvalid = ""
  final val EmailValid = "<EMAIL>"
  final val EmailInvalid = "no_at_symbol.com"
  final val TitleInvalidError = "Please select a title from the drop down list."
  final val VehicleMakeValid = "Audi"
  final val ModelValid = "A6"

  def back(implicit driver: WebDriver): Element = find(id(BackId)).get

  def next(implicit driver: WebDriver): Element = find(id(SubmitId)).get

  def titleDropDown(implicit driver: WebDriver): SingleSel = singleSel(id(TitleId))

  def emailTextBox(implicit driver: WebDriver): EmailField = emailField(id(EmailId))

  def firstNameTextBox(implicit driver: WebDriver): TextField = textField(id(FirstNameId))

  def surnameTextBox(implicit driver: WebDriver): TextField = textField(id(SurnameId))


  def happyPath(title: String = OptionValid,
                firstName: String = FirstNameValid,
                surname: String = SurnameValid,
                email: String = EmailValid)(implicit driver: WebDriver) = {
    go to PrivateKeeperDetailsPage

    titleDropDown select title
    firstNameTextBox enter firstName
    surnameTextBox enter surname
    emailTextBox enter email

    click on next
  }

  def sadPath (title: String = TitleInvalid,
               firstName: String = FirstNameInvalid,
               surname: String = SurnameInvalid,
{'fraction_non_alphanumeric': 0.08008504606661943, 'fraction_numerical': 0.0009449562957713206, 'mean_word_length': 4.332493702770781, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4733661', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1163, 'n_words': 347}