<commit_before>package controllers.preview

import org.specs2.mutable.{Tags, Specification}
import utils.WithBrowser
import utils.pageobjects.{PageObjectsContext, PageObjects}
import utils.pageobjects.preview.PreviewPage
import utils.pageobjects.s_claim_date.GClaimDatePage
import controllers.ClaimScenarioFactory
import utils.pageobjects.s_employment.GEmploymentPage


class PreviewPageEmploymentContentSpec extends Specification with Tags {

  "Preview Page" should {
    "display employment data" in new WithBrowser with PageObjects{

      fillEmploymentSection(context)
      val page =  PreviewPage(context)
      page goToThePage()
      val source = page.source

      source must contain("Employment and Self Employment")
      source must contain("Have you been employed at any time since 10 April 2016")
      source must contain("Yes")
      source must contain("Employment")
      source must contain("Details provided for Tesco's, including expenses")
      source must contain("Have you been self employed at any time since 3 October 2016")
      source must contain("Yes - Details provided including expenses")
      source must contain("Type of work or business?")
      source must contain("Some type of business")
    }
  } section "preview"

  def fillEmploymentSection (context:PageObjectsContext) = {

    val employmentData = ClaimScenarioFactory.s7Employment()
    val selfEmploymentData = ClaimScenarioFactory.s9SelfEmployment

    val claimDatePage = GClaimDatePage(context)
    claimDatePage goToThePage()
    val claimDate = ClaimScenarioFactory.s12ClaimDate()
    claimDatePage fillPageWith claimDate
    claimDatePage submitPage()
<commit_msg>CADS-251 - Claim. Both emp guard questions are missing '?' on CYA page<commit_after>package controllers.preview

import org.specs2.mutable.{Tags, Specification}
import utils.WithBrowser
import utils.pageobjects.{PageObjectsContext, PageObjects}
import utils.pageobjects.preview.PreviewPage
import utils.pageobjects.s_claim_date.GClaimDatePage
import controllers.ClaimScenarioFactory
import utils.pageobjects.s_employment.GEmploymentPage


class PreviewPageEmploymentContentSpec extends Specification with Tags {

  "Preview Page" should {
    "display employment data" in new WithBrowser with PageObjects{

      fillEmploymentSection(context)
      val page =  PreviewPage(context)
      page goToThePage()
      val source = page.source

      source must contain("Employment and Self Employment")
      source must contain("Have you been employed at any time since 10 April 2016?")
      source must contain("Yes")
      source must contain("Employment")
      source must contain("Details provided for Tesco's, including expenses")
      source must contain("Have you been self employed at any time since 3 October 2016?")
      source must contain("Yes - Details provided including expenses")
      source must contain("Type of work or business?")
      source must contain("Some type of business")
    }
  } section "preview"

  def fillEmploymentSection (context:PageObjectsContext) = {

    val employmentData = ClaimScenarioFactory.s7Employment()
    val selfEmploymentData = ClaimScenarioFactory.s9SelfEmployment

    val claimDatePage = GClaimDatePage(context)
    claimDatePage goToThePage()
    val claimDate = ClaimScenarioFactory.s12ClaimDate()
    claimDatePage fillPageWith claimDate
    claimDatePage submitPage()

{'fraction_non_alphanumeric': 0.0657856093979442, 'fraction_numerical': 0.010279001468428781, 'mean_word_length': 4.529220779220779, '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': '3315809', 'n_tokens_mistral': 912, 'n_tokens_neox': 862, 'n_words': 280}