From 4351833bc40b80c5890a5c84309db0dacc3fc162 Mon Sep 17 00:00:00 2001 From: Petr Zaparka Date: Wed, 28 Feb 2018 14:35:12 +0000 Subject: [PATCH 1/3] Updating Benefit questions for en and cy. --- app/views/questions/forms/_benefit.html.slim | 30 ++------- .../questions/headers/_benefit.html.slim | 49 ++++++++++---- config/locales/cy.yml | 67 +++++++------------ config/locales/en.yml | 67 +++++++------------ 4 files changed, 92 insertions(+), 121 deletions(-) diff --git a/app/views/questions/forms/_benefit.html.slim b/app/views/questions/forms/_benefit.html.slim index f88b1639a..be149f19c 100644 --- a/app/views/questions/forms/_benefit.html.slim +++ b/app/views/questions/forms/_benefit.html.slim @@ -12,31 +12,11 @@ = t('on_benefits_true', scope: @form.i18n_scope) .form-group - details - summary = t('summary', scope: "#{@form.i18n_scope}.details") + .text + h2.heading-small = t('heading', scope: "#{@form.i18n_scope}.details.section_2") + p = t('details', scope: "#{@form.i18n_scope}.details.section_2") - .panel-indent - .text - h2.heading-small = t('heading', scope: "#{@form.i18n_scope}.details.section_1") - p = t('details', scope: "#{@form.i18n_scope}.details.section_1") + h2.heading-small = t('heading', scope: "#{@form.i18n_scope}.details.section_1") + p = t('details', scope: "#{@form.i18n_scope}.details.section_1") - h2.heading-small = t('heading', scope: "#{@form.i18n_scope}.details.section_2") - p = t('details', scope: "#{@form.i18n_scope}.details.section_2") - ul.list.list-bullet - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_1") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.details.section_2.item_1")} - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_2") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.details.section_2.item_2")} - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_3") - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_4") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.details.section_2.item_4")} - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_5") - li - = t('name', scope: "#{@form.i18n_scope}.details.section_2.item_6") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.details.section_2.item_6")} diff --git a/app/views/questions/headers/_benefit.html.slim b/app/views/questions/headers/_benefit.html.slim index 034d58dbb..bd789c3e1 100644 --- a/app/views/questions/headers/_benefit.html.slim +++ b/app/views/questions/headers/_benefit.html.slim @@ -2,19 +2,40 @@ p = t('header', scope:"#{@form.i18n_scope}.list") ul.list.list-bullet li - = t('name', scope: "#{@form.i18n_scope}.list.item_1") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.list.item_1")} + = t('check_1', scope: "#{@form.i18n_scope}.list") li - = t('name', scope: "#{@form.i18n_scope}.list.item_2") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.list.item_2")} + = t('check_2', scope: "#{@form.i18n_scope}.list") li - = t('name', scope: "#{@form.i18n_scope}.list.item_3") - li - = t('name', scope: "#{@form.i18n_scope}.list.item_4") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.list.item_4")} - li - = t('name', scope: "#{@form.i18n_scope}.list.item_5") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.list.item_5")} - li - = t('name', scope: "#{@form.i18n_scope}.list.item_6") - span.hint   #{t('hint', scope: "#{@form.i18n_scope}.list.item_6")} + = t('check_3', scope: "#{@form.i18n_scope}.list") + +table + tr + th + = t('name', scope: "#{@form.i18n_scope}.list.column_1") + br + = t('header', scope: "#{@form.i18n_scope}.list.column_1") + + th + = t('name', scope: "#{@form.i18n_scope}.list.column_2") + br + = t('header', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_1', scope: "#{@form.i18n_scope}.list.column_1") + td = t('item_1', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_2', scope: "#{@form.i18n_scope}.list.column_1") + td = t('item_2', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_3', scope: "#{@form.i18n_scope}.list.column_1") + td = t('item_3', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_4', scope: "#{@form.i18n_scope}.list.column_1") + td = t('item_4', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_5', scope: "#{@form.i18n_scope}.list.column_1") + td = t('item_5', scope: "#{@form.i18n_scope}.list.column_2") + tr + td = t('item_6', scope: "#{@form.i18n_scope}.list.column_1") + td   + +br diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 56c62b0bb..199c5de56 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -297,52 +297,37 @@ cy: breadcrumb: Cam 6 o 20 details: section_1: - details: "(er enghraifft, yn y dyddiau diwethaf), mae'n bosibl na fydd ein staff yn gallu cadarnhau'ch bod yn gymwys gyda'r Adran Gwaith a Phensiynau. Os felly, dylech chi ddarparu llythyr oddi wrth y Ganolfan Waith." - heading: Os mai dim ond yn ddiweddar rydych chi wedi dechrau derbyn un o'r budd-daliadau hyn + details: "efallai na fydd ein staff yn gallu cadarnhau eich cymhwysedd gyda’r Adran Gwaith a Phensiynau. Yn yr achos hwn, dylech ddarparu llythyr gan y Ganolfan Waith." + heading: Os mai dim ond yn ddiweddar rydych chi wedi dechrau derbyn un o'r budd-daliadau hyn, section_2: - details: Mae rhai budd-daliadau ag enwau tebyg. Os ydych chi'n derbyn un o'r budd-daliadau yn y rhestr isod, dewiswch 'Na'. - heading: Budd-daliadau ag enwau tebyg - item_1: - hint: "(JSA)" - name: Lwfans Ceisio Gwaith yn Seiliedig ar Gyfraniadau - item_2: - hint: "(ESA)" - name: Lwfans Cyflogaeth a Chymorth yn Seiliedig ar Gyfraniadau - item_3: - hint: "" - name: Credyd Pensiwn a Chredyd Cynilion - item_4: - hint: "(a'ch bod yn ennill mwy na £6,000 y flwyddyn)" - name: Credyd Cynhwysol - item_5: - hint: "" - name: Scottish Legal Aid Advice and Assistance - item_6: - hint: "(ABWOR)" - name: Scottish Legal Aid Advice by Way of Representation + details: Byddwn yn cysylltu â’r Adran Gwaith a Phensiynau i gadarnhau eich bod (neu yr oeddech) yn cael un o’r budd-daliadau hyn. Efallai y byddwn hefyd yn cysylltu â chi os ydym angen gweld tystiolaeth bellach. + heading: Cymorth gyda budd-daliadau summary: Help gyda budd-daliadau list: - header: Byddwn ni'n cysylltu â'r Adran Gwaith a Phensiynau i gadarnhau eich bod (neu wedi bod) yn derbyn un o'r budd-daliadau hyn. - item_1: - hint: "(JSA)" - name: Lwfans Ceisio Gwaith yn Seiliedig ar Incwm - item_2: - hint: "(ESA)" - name: Lwfans Cyflogaeth a Chymorth yn Seiliedig ar Incwm - item_3: - name: Cymhorthdal Incwm - item_4: - hint: "(a'ch bod yn ennill llai na £6,000 y flwyddyn)" - name: Credyd Cynhwysol - item_5: - hint: "(Credyd Gwarant)" - name: Credyd Pensiwn - item_6: - hint: "(nid Advice and Assistance neu Advice by Way of Representation)" - name: Scottish Civil Legal Aid + header: "Gwiriwch y tabl isod yn ofalus i ganfod a ydych (neu a oeddech adeg talu’ch ffi) yn cael unrhyw un o’r budd-daliadau canlynol:" + check_1: "Os ydych yn cael un o’r budd-daliadau a restrir yng ngholofn 1, dewiswch ‘Ydw’." + check_2: "Mae yna rai budd-daliadau gydag enwau tebyg wedi’u rhestru yng ngholofn 2. Os ydych yn cael un o’r budd-daliadau hyn, dewiswch ‘Nac ydw’." + check_3: "Os nad ydych yn cael unrhyw un o’r budd-daliadau a restrir ar y dudalen hon, dewiswch ‘Nac ydw’." + column_1: + name: "Colofn 1:" + header: Dewiswch ‘Ydw’ os ydych yn cael un o'r budd-daliadau hyn + item_1: Lwfans Ceisio Gwaith yn seiliedig ar Incwm (JSA) + item_2: Lwfans Cyflogaeth a Chymorth yn seiliedig ar Incwm (ESA) + item_3: Credyd Pensiwn (Credyd Gwarant) + item_4: Credyd Cynhwysol (a’ch bod yn ennill llai na £6,000 y flwyddyn) + item_5: Cymorth Cyfreithiol Sifil Yr Alban (nid Cyngor a Chymorth neu Gyngor drwy Gynrychiolaeth) + item_6: Cymhorthdal Incwm + column_2: + name: "Colofn 2:" + header: Dewiswch ‘Nac ydw’ os ydych yn cael un o'r budd-daliadau hyn + item_1: Lwfans Ceisio Gwaith yn seiliedig ar Gyfraniadau (JSA) + item_2: Lwfans Cyflogaeth a Chymorth yn seiliedig ar Gyfraniadau (ESA) + item_3: Credyd Pensiwn a Chredyd Cynilion + item_4: Credyd Cynhwysol (a’ch bod yn ennill mwy na £6,000 y flwyddyn) + item_5: Cymorth Cyfreithiol Yr Alban (Cyngor a Chymorth neu Gyngor drwy Gynrychiolaeth ABWOR) on_benefits_false: Nac ydw on_benefits_true: Ydw, rydw i'n derbyn un o'r budd-daliadau yn y rhestr - text: Ydych chi'n derbyn unrhyw un o'r budd-daliadau isod? + text: A ydych chi’n cael unrhyw un o’r budd-daliadau canlynol? text_refund: Oeddech chi'n derbyn unrhyw un o'r budd-daliadau canlynol? title: Budd-daliadau claim/default: diff --git a/config/locales/en.yml b/config/locales/en.yml index 6b2575a75..0a67d1b6e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -298,51 +298,36 @@ en: breadcrumb: Step 6 of 20 details: section_1: - details: "(for example, in the last few days), our staff may not be able to confirm your eligibility with the Department for Work and Pensions. In this case you should provide a letter from the Jobcentre." - heading: If you’ve only recently started receiving one of these benefits + heading: If you’ve only recently started receiving one of these benefits, + details: "our staff may not be able to confirm your eligibility with the Department for Work and Pensions. In this case you should provide a letter from the Jobcentre." section_2: - details: There are some benefits with similar names. If you are receiving one of the benefits listed below, select 'No'. - heading: Benefits with similar names - item_1: - hint: "(JSA)" - name: Contribution-based Job Seekers Allowance - item_2: - hint: "(ESA)" - name: Contribution-based Employment and Support Allowance - item_3: - hint: '' - name: Pension Credit and Savings Credit - item_4: - hint: "(and you're earning more than £6,000 a year)" - name: Universal Credit - item_5: - hint: '' - name: Scottish Legal Aid Advice and Assistance - item_6: - hint: "(ABWOR)" - name: Scottish Legal Aid Advice by Way of Representation + heading: Help with benefits + details: "We’ll contact the Department for Work and Pensions to confirm that you are (or were) getting one of these benefits. We may also contact you if we need to see additional evidence." summary: Help with benefits list: - header: We’ll contact the Department for Work and Pensions to confirm that you are (or were) getting one of these benefits. - item_1: - hint: "(JSA)" - name: Income-based Jobseeker’s Allowance - item_2: - hint: "(ESA)" - name: Income-related Employment and Support Allowance - item_3: - name: Income Support - item_4: - hint: "(and you’re earning less than £6,000 a year)" - name: Universal Credit - item_5: - hint: "(Guarantee Credit)" - name: Pension Credit - item_6: - hint: "(not Advice and Assistance or Advice by Way of Representation)" - name: Scottish Civil Legal Aid + header: "Please carefully check the table below to identify if you are (or were at the time you paid your fee) receiving any of the following benefits:" + check_1: "If you are receiving one of the benefits listed in column 1, select ‘Yes’." + check_2: "There are some benefits with similar names listed in column 2. If you are receiving one of these benefits, select 'No'" + check_3: "If you are not receiving any of benefits listed on this page, select 'No'" + column_1: + name: "Column 1:" + header: Select ‘Yes’ if you are receiving one of these benefits + item_1: Income-based Jobseeker’s Allowance (JSA) + item_2: Income-related Employment and Support Allowance (ESA) + item_3: Pension Credit (Guarantee Credit) + item_4: Universal Credit (and you’re earning less than £6,000 a year) + item_5: Scottish Civil Legal Aid (not Advice and Assistance or Advice by Way of Representation) + item_6: Income Support + column_2: + name: "Column 2:" + header: "Select ‘No’ if you are receiving one of these benefits" + item_1: Contribution-based Job Seekers Allowance (JSA) + item_2: Contribution-based Employment and Support Allowance (ESA) + item_3: Pension Credit and Savings Credit + item_4: Universal Credit (and you're earning £6,000 or more a year) + item_5: Scottish Legal Aid (Advice and Assistance or Advice by Way of Representation ABWOR) on_benefits_false: 'No' - on_benefits_true: Yes, I am receiving one of the benefits listed + on_benefits_true: Yes, I am receiving one of the benefits listed in Column 1 text: Do you receive any of the following benefits? text_refund: Did you receive any of the following benefits? title: Benefits From c10121614704494ca1122352b1586138c39d41a7 Mon Sep 17 00:00:00 2001 From: Petr Zaparka Date: Wed, 28 Feb 2018 16:34:03 +0000 Subject: [PATCH 2/3] Fixing failing test. --- config/locales/en.yml | 4 +-- features/step_definitions/step_six_steps.rb | 8 ++++++ features/step_six.feature | 26 ++++++++++--------- .../support/page_objects/step_six_page.rb | 1 + 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a67d1b6e..8eb3aac2d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -307,8 +307,8 @@ en: list: header: "Please carefully check the table below to identify if you are (or were at the time you paid your fee) receiving any of the following benefits:" check_1: "If you are receiving one of the benefits listed in column 1, select ‘Yes’." - check_2: "There are some benefits with similar names listed in column 2. If you are receiving one of these benefits, select 'No'" - check_3: "If you are not receiving any of benefits listed on this page, select 'No'" + check_2: "There are some benefits with similar names listed in column 2. If you are receiving one of these benefits, select 'No'." + check_3: "If you are not receiving any of benefits listed on this page, select 'No'." column_1: name: "Column 1:" header: Select ‘Yes’ if you are receiving one of these benefits diff --git a/features/step_definitions/step_six_steps.rb b/features/step_definitions/step_six_steps.rb index 8089fd95a..c2024123e 100644 --- a/features/step_definitions/step_six_steps.rb +++ b/features/step_definitions/step_six_steps.rb @@ -30,6 +30,14 @@ def group_six(index) end end +Then(/^I should see the benefits table:$/) do |table| + table.raw.each_with_index do |item, index| + first = index * 2 + expect(step_six_page.content.td[first].text).to eq item[0] + expect(step_six_page.content.td[first + 1].text).to eq item[1] + end +end + Then(/^I should see help with benefits copy$/) do expect(group_six(1)).to have_help_with_benefits expect(group_six(1)).to have_recently_receiving_heading diff --git a/features/step_six.feature b/features/step_six.feature index 2c934c9cc..f335f816c 100644 --- a/features/step_six.feature +++ b/features/step_six.feature @@ -7,19 +7,25 @@ Feature: Step six page Scenario: Displays step number Then I should see step 6 of 20 - + Scenario: Displays header Then I should see 'Do you receive any of the following benefits?' header Scenario: Displays benefits list Then I should see the benefits list: - | benefit | - | Income-based Jobseeker’s Allowance (JSA) | - | Income-related Employment and Support Allowance (ESA) | - | Income Support | - | Universal Credit (and you’re earning less than £6,000 a year) | - | Pension Credit (Guarantee Credit) | - | Scottish Civil Legal Aid (not Advice and Assistance or Advice by Way of Representation) | + | benefit | + | If you are receiving one of the benefits listed in column 1, select ‘Yes’. | + | There are some benefits with similar names listed in column 2. If you are receiving one of these benefits, select 'No'. | + | If you are not receiving any of benefits listed on this page, select 'No'. | + + Then I should see the benefits table: + | Income-based Jobseeker’s Allowance (JSA) | Contribution-based Job Seekers Allowance (JSA) | + | Income-related Employment and Support Allowance (ESA) | Contribution-based Employment and Support Allowance (ESA) | + | Pension Credit (Guarantee Credit) | Pension Credit and Savings Credit | + | Universal Credit (and you’re earning less than £6,000 a year) | Universal Credit (and you're earning £6,000 or more a year) | + | Scottish Civil Legal Aid (not Advice and Assistance or Advice by Way of Representation) | Scottish Legal Aid (Advice and Assistance or Advice by Way of Representation ABWOR) | + | Income Support || + Scenario: No I am not receiving any benefits from list When I submit the form with no I do not receive one of the benefits listed @@ -32,7 +38,3 @@ Feature: Step six page Scenario: Displays error message When I click continue Then I should see 'Select whether you're receiving one of the benefits listed' error message - - Scenario: Help with benefits - When I click on 'Help with benefits' - Then I should see help with benefits copy diff --git a/features/support/page_objects/step_six_page.rb b/features/support/page_objects/step_six_page.rb index 125b958bb..e1b185aa3 100644 --- a/features/support/page_objects/step_six_page.rb +++ b/features/support/page_objects/step_six_page.rb @@ -3,6 +3,7 @@ class StepSixPage < BasePage element :benefits_text, '.text', text: 'contact the Department for Work and Pensions' element :benefit, '.text' elements :li, 'li' + elements :td, 'td' sections :form_group, '.form-group' do element :no, '.block-label', text: 'No' element :yes, '.block-label', text: 'Yes, I am receiving one of the benefits listed' From fbe8bd6a3244c87743605c0b6249f708c41f7b29 Mon Sep 17 00:00:00 2001 From: Petr Zaparka Date: Thu, 1 Mar 2018 11:38:30 +0000 Subject: [PATCH 3/3] Refactoring feature file. --- features/step_definitions/step_six_steps.rb | 2 +- features/step_six.feature | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/features/step_definitions/step_six_steps.rb b/features/step_definitions/step_six_steps.rb index c2024123e..eb31f4d92 100644 --- a/features/step_definitions/step_six_steps.rb +++ b/features/step_definitions/step_six_steps.rb @@ -23,7 +23,7 @@ def group_six(index) common_page.continue_button.click end -Then(/^I should see the benefits list:$/) do |benefits| +Then(/^I should see the instruction bullet points:$/) do |benefits| expect(step_six_page.content).to have_benefits_text benefits.rows.each_with_index do |benefit, index| expect(step_six_page.content.li[index].text).to eq benefit[0] diff --git a/features/step_six.feature b/features/step_six.feature index f335f816c..17613b56f 100644 --- a/features/step_six.feature +++ b/features/step_six.feature @@ -11,13 +11,14 @@ Feature: Step six page Scenario: Displays header Then I should see 'Do you receive any of the following benefits?' header - Scenario: Displays benefits list - Then I should see the benefits list: + Scenario: Displays instruction bullet points + Then I should see the instruction bullet points: | benefit | | If you are receiving one of the benefits listed in column 1, select ‘Yes’. | | There are some benefits with similar names listed in column 2. If you are receiving one of these benefits, select 'No'. | | If you are not receiving any of benefits listed on this page, select 'No'. | + Scenario: Displays benefits table Then I should see the benefits table: | Income-based Jobseeker’s Allowance (JSA) | Contribution-based Job Seekers Allowance (JSA) | | Income-related Employment and Support Allowance (ESA) | Contribution-based Employment and Support Allowance (ESA) |