diff --git a/scripts/all_questions/README.md b/scripts/all_questions/README.md
index abd3792c..3502a33f 100644
--- a/scripts/all_questions/README.md
+++ b/scripts/all_questions/README.md
@@ -1,9 +1,11 @@
# All Questions Generation
The scripts in this folder are used to generate the 'all questions' page for a fund. They take the section information from the fund-store database, combine it with the question flow from the form jsons, to generate a single HTML page containing all questions and all possible branches for a particular round.
+Instructions on running the script and what to do with the outputs are in confluence: https://dluhcdigital.atlassian.net/wiki/spaces/FS/pages/45580513/Generating+the+All+Questions+page+and+Assessment+Field+Display+info
+
## Generating test data
-This is for testing [generate_index](./metadata_utils.py).
+This is for testing [build_hierarchy_levels_for_page](./metadata_utils.py), or anything that takes in the full form json. You can use the full form json, or if you want to use a subset of the form json to make debugging easier, these instructions allow you to extract a small portion of the form for easier testing.
These steps are to help with debugging by separating out the steps or just extracting a subset of the form.
@@ -23,5 +25,5 @@ If you are testing against metadata for the whole form, you don't need this bit,
1. Update the `files_to_generate` path to use the dict you defined above.
1. Execute this single test
-### Testing generate_index
-You can now write a test using `generate_index` with either a whole form of metadata, or just a subset. Use the output paths above as input to your test.
+### Testing build_hierarchy_levels_for_page
+You can now write a test using `build_hierarchy_levels_for_page` with either a whole form of metadata, or just a subset. Use the output paths above as input to your test.
diff --git a/tests/test_data/all_questions/forms/about-your-organisation-cyp.json b/tests/test_data/all_questions/forms/about-your-organisation-cyp.json
new file mode 100644
index 00000000..e8020cd2
--- /dev/null
+++ b/tests/test_data/all_questions/forms/about-your-organisation-cyp.json
@@ -0,0 +1,952 @@
+{
+ "metadata": {},
+ "startPage": "/intro-about-your-organisation",
+ "backLinkText": "Go back to application overview",
+ "pages": [
+ {
+ "title": "Organisation details",
+ "path": "/organisation-details",
+ "components": [
+ {
+ "name": "JbmcJE",
+ "options": {
+ "classes": "govuk-input"
+ },
+ "type": "TextField",
+ "title": "Organisation name",
+ "hint": "This must match your registered legal organisation name",
+ "schema": {}
+ },
+ {
+ "name": "KUdOhN",
+ "options": {},
+ "type": "YesNoField",
+ "title": "Does your organisation use any other names?",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/alternative-organisation-name",
+ "condition": "GZIoHg"
+ },
+ {
+ "path": "/tell-us-about-your-organisations-main-activities",
+ "condition": "dfsBce"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "title": "Tell us about your organisation's main activities",
+ "path": "/tell-us-about-your-organisations-main-activities",
+ "components": [
+ {
+ "name": "jcjKhe",
+ "options": {},
+ "type": "Para",
+ "content": "
\n
Include any activities you undertake in order to achieve the organisation's purpose.
\n\n
You must list at least one, and can include up to three
"
+ },
+ {
+ "name": "kxgOne",
+ "options": {
+ "maxWords": "500",
+ "hideTitle": true
+ },
+ "type": "FreeTextField",
+ "title": "Activity 1",
+ "hint": "Activity 1 "
+ },
+ {
+ "name": "kxgTwo",
+ "options": {
+ "maxWords": "500",
+ "required": false,
+ "hideTitle": true
+ },
+ "type": "FreeTextField",
+ "title": "Activity 2 (optional)",
+ "hint": "Activity 2 (optional) "
+ },
+ {
+ "name": "kxgThr",
+ "options": {
+ "maxWords": "500",
+ "required": false,
+ "hideTitle": true
+ },
+ "type": "FreeTextField",
+ "title": "Activity 3 (optional)",
+ "hint": "Activity 3 (optional) "
+ }
+ ],
+ "next": [
+ {
+ "path": "/how-is-your-organisation-classified"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "title": "How is your organisation classified?",
+ "path": "/how-is-your-organisation-classified",
+ "components": [
+ {
+ "name": "GNpQfE",
+ "options": {},
+ "type": "Details",
+ "title": "Help with organisation types",
+ "content": "A registered community interest company is a special type of limited company. It exists to benefit the community rather than private shareholders.
\nA social enterprise is a business with social objectives. It reinvests its surpluses in the business or community, rather than driving the need to maximise profit for shareholders and owners.
\n\nCommunity groups must:\n
\nbe established for charitable, benevolent, or philanthropic purposes \nhave a governing body with at least 3 members \nhave a governing document they can produce \nprovide accounts for the last 2 financial years \n "
+ },
+ {
+ "name": "jcmcJE",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "RadiosField",
+ "title": "Organisation classification",
+ "hint": "Select one option
",
+ "list": "jcXaBR"
+ }
+ ],
+ "next": [
+ {
+ "path": "/how-is-your-organisation-classified-other",
+ "condition": "aJJVVz"
+ },
+ {
+ "path": "/charity-number",
+ "condition": "aVVJJz"
+ },
+ {
+ "path": "/company-registration-number"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "title": "How is your organisation classified? (other)",
+ "path": "/how-is-your-organisation-classified-other",
+ "components": [
+ {
+ "name": "jemcJE",
+ "options": {
+ "classes": "govuk-input",
+ "hideTitle": true
+ },
+ "type": "TextField",
+ "title": "How is your organisation classified?",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/organisation-address"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "title": "Company registration number (optional)",
+ "path": "/company-registration-number",
+ "components": [
+ {
+ "name": "jcjKhd",
+ "options": {},
+ "type": "Para",
+ "content": "If you have a registration number, you can find this by searching Companies House.
It is usually 8 numbers, or 2 letters followed by 6 numbers
"
+ },
+ {
+ "name": "jencJE",
+ "options": {
+ "hideTitle": true,
+ "required":false
+ },
+ "type": "TextField",
+ "title": "Company registration number",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/organisation-address"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "title": "Charity number",
+ "path": "/charity-number",
+ "components": [
+ {
+ "name": "jcjKhc",
+ "options": {},
+ "type": "Para",
+ "content": "\n
You can find this by searching the register of charities on the Charity Commission website.
It is usually 7 numbers, or 8 numbers if your charity is recently registered
"
+ },
+ {
+ "name": "jeocJE",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "TextField",
+ "title": "Charity number",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/organisation-address"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/alternative-organisation-name",
+ "title": "Alternative names of your organisation",
+ "components": [
+ {
+ "name": "NcnYCn",
+ "options": {
+ "classes": "govuk-input"
+ },
+ "type": "TextField",
+ "title": "Alternative name 1",
+ "schema": {}
+ },
+ {
+ "name": "rtFyqT",
+ "options": {
+ "required": false,
+ "classes": "govuk-input"
+ },
+ "type": "TextField",
+ "title": "Alternative name 2",
+ "schema": {}
+ },
+ {
+ "name": "DYUbGM",
+ "options": {
+ "required": false,
+ "classes": "govuk-input"
+ },
+ "type": "TextField",
+ "title": "Alternative name 3",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/tell-us-about-your-organisations-main-activities"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/organisation-address",
+ "title": "Registered organisation address",
+ "components": [
+ {
+ "name": "rmBPvK",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "UkAddressField",
+ "title": "Registered organisation address",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/alternative-organisation-address"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/alternative-organisation-address",
+ "title": "Alternative organisation address (optional)",
+ "components": [
+ {
+ "name": "smBPvK",
+ "options": {
+ "hideTitle": true,
+ "required": false
+ },
+ "type": "UkAddressField",
+ "title": "Alternative organisation address",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/joint-bid"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/joint-bid",
+ "title": "Is your application a joint bid in partnership with other organisations?",
+ "components": [
+ {
+ "name": "MRdGKt",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "YesNoField",
+ "title": "Is your application a joint bid in partnership with other organisations?",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/partner-organisation-details",
+ "condition": "nMJAdu"
+ },
+ {
+ "path": "/website-and-social-media",
+ "condition": "MbgmFQ"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/partner-organisation-details",
+ "title": "Partner organisation details",
+ "options": {
+ "summaryDisplayMode": {
+ "samePage": false,
+ "separatePage": true,
+ "hideRowTitles": false
+ },
+ "customText": {
+ "separatePageTitle": "Your partner organisation details",
+ "samePageTitle": "",
+ "removeText": "Delete"
+ }
+ },
+ "components": [
+ {
+ "name": "jcjKhd",
+ "options": {},
+ "type": "Para",
+ "content": "\n
You can add more partner organisations on the next step
"
+ },
+ {
+ "name": "tZoOKx",
+ "options": {
+ "columnTitles": [
+ "Organisation name",
+ "Address",
+ "Website and social media link 1",
+ "Website and social media link 2",
+ "Website and social media link 3",
+ "Action"
+ ]
+ },
+ "type": "MultiInputField",
+ "title": "Partner organisation details",
+ "hint": "The MultiInputField needed",
+ "schema": {},
+ "children": [
+ {
+ "name": "GpLJDu",
+ "options": {
+ "classes": "govuk-!-width-full"
+ },
+ "type": "TextField",
+ "title": "Partner organisation name"
+ },
+ {
+ "name": "IXjMWp",
+ "options": {},
+ "type": "UkAddressField",
+ "title": "Partner organisation address",
+ "hint": "Partner organisation address"
+ },
+ {
+ "name": "MKbOlA",
+ "options": {
+ "classes": "govuk-!-width-full"
+ },
+ "type": "WebsiteField",
+ "title": "Website and social media links",
+ "hint": "Link 1",
+ "schema": {}
+ },
+ {
+ "name": "OghGGr",
+ "options": {
+ "classes": "govuk-!-width-full",
+ "hideTitle": true,
+ "required": false
+ },
+ "type": "WebsiteField",
+ "title": "Website and social media",
+ "hint": "Link 2 (optional)",
+ "schema": {}
+ },
+ {
+ "name": "RphKTp",
+ "options": {
+ "classes": "govuk-!-width-full",
+ "hideTitle": true,
+ "required": false
+ },
+ "type": "WebsiteField",
+ "title": "Website and social media",
+ "hint": "Link 3 (optional)",
+ "schema": {}
+ }
+ ]
+ }
+ ],
+ "next": [
+ {
+ "path": "/work-with-partner-organisations"
+ }
+ ],
+ "controller": "RepeatingFieldPageController",
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/website-and-social-media",
+ "title": "Website and social media",
+ "options": {
+ "summaryDisplayMode": {
+ "samePage": false,
+ "separatePage": true,
+ "hideRowTitles": false
+ },
+ "customText": {
+ "separatePageTitle": "Your links",
+ "samePageTitle": ""
+ }
+ },
+ "components": [
+ {
+ "name": "tYoOqx",
+ "options": { "columnTitles": ["Link", "Action"] },
+ "type": "MultiInputField",
+ "title": "Website and social media",
+ "schema": {},
+ "children": [
+ {
+ "name": "EShKlA",
+ "options": {
+ "classes": "govuk-!-width-full"
+ },
+ "type": "WebsiteField",
+ "title": "Link",
+ "hint": "For example, your company's Facebook, Instagram or Twitter accounts (if applicable)
You can add more links on the next step
",
+ "schema": {}
+ }
+ ]
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary"
+ }
+ ],
+ "controller": "RepeatingFieldPageController",
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/summary",
+ "title": "Check your answers",
+ "components": [],
+ "next": [],
+ "section": "uLwBuz",
+ "controller": "./pages/summary.js"
+ },
+ {
+ "path": "/intro-about-your-organisation",
+ "title": "2.1 About your organisation",
+ "section": "uLwBuz",
+ "components": [
+ {
+ "name": "sPbqXm",
+ "options": {},
+ "type": "Html",
+ "content": "In this section, we'll ask about:
\n organisation name \n alternative organisation names (if applicable) \n organisation address \n alternative organisation address (if applicable) \n the organisation's main activities \n organisation type \n charity registration number (if applicable) \n company registration number (if applicable) \n joint bids with partner organisations (if applicable) \n partner organisation addresses (if applicable) \n partner organisations website and social media links (if applicable) \n how you plan to work with partner organisations (if applicable) \n if an agreement currently exist between your organisations and the partnership organisations \n organisation website and social media details \n ",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/organisation-details"
+ }
+ ],
+ "controller": "./pages/start.js"
+ },
+ {
+ "path": "/work-with-partner-organisations",
+ "title": "Tell us about how you plan to work with the partner organisations",
+ "components": [
+ {
+ "name": "xPcbJX",
+ "options": {
+ "maxWords": "500",
+ "hideTitle": true
+ },
+ "type": "FreeTextField",
+ "title": "Tell us about how you plan to work with the partner organisations",
+ "hint": "Explain what their role is in the delivery of the project and how they'll assist with delivery
"
+ }
+ ],
+ "next": [
+ {
+ "path": "/agreement-exists"
+ }
+ ],
+ "section": "uLwBuz"
+ },
+ {
+ "path": "/agreement-exists",
+ "title": "Does an agreement currently exist between your organisation and the partnership organisations?",
+ "components": [
+ {
+ "name": "RUdOhN",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "YesNoField",
+ "title": "Does an agreement currently exist between your organisation and the partnership organisations?",
+ "hint": "We may ask for a copy of the agreement if your application is successful
",
+ "schema": {}
+ }
+ ],
+ "next": [
+ {
+ "path": "/website-and-social-media"
+ }
+ ],
+ "section": "uLwBuz"
+ }
+ ],
+ "lists": [
+ {
+ "title": "Organisation classification",
+ "name": "jcXaBR",
+ "type": "string",
+ "items": [
+ {
+ "text": "Upper or lower tier local authority",
+ "value": "upper-or-lower-tier-local-authority"
+ },
+ {
+ "text": "Charity with a registered charity number",
+ "value": "charity-with-a-registered-charity-number"
+ },
+ {
+ "text": "Registered community interest company",
+ "value": "registered-community-interest-company"
+ },
+ {
+ "text": "Social enterprise",
+ "value": "social-enterprise"
+ },
+ {
+ "text": "Community group",
+ "value": "community-group"
+ },
+ {
+ "text": "Other",
+ "value": "other"
+ }
+ ]
+ },
+ {
+ "title": "Focus of the project",
+ "name": "hfQISg",
+ "type": "string",
+ "items": [
+ {
+ "text": "Trauma support",
+ "value": "trauma-support"
+ },
+ {
+ "text": "Mental health and wellbeing",
+ "value": "mental-health-and-wellbeing"
+ },
+ {
+ "text": "Teaching English as a language",
+ "value": "teaching-english-as-a-language"
+ },
+ {
+ "text": "Peer groups and befriending",
+ "value": "peer-groups-and-befriending"
+ },
+ {
+ "text": "Supporting hosts and sponsors",
+ "value": "supporting-hosts-and-sponsors"
+ },
+ {
+ "text": "Maintaining links to culture",
+ "value": "maintaining-links-to-culture"
+ }
+ ]
+ },
+ {
+ "title": "Cohort focus",
+ "name": "YSgfSN",
+ "type": "string",
+ "items": [
+ {
+ "text": "Ukrainian schemes",
+ "value": "ukrainian-schemes"
+ },
+ {
+ "text": "Hong Kong British Nationals (Overseas)",
+ "value": "hong-kong-british-nationals"
+ },
+ {
+ "text": "Afghan citizens resettlement scheme",
+ "value": "afghan-citizens-resettlement-scheme"
+ }
+ ]
+ },
+ {
+ "title": "Eligibility",
+ "name": "qwnTyS",
+ "type": "string",
+ "items": [
+ {
+ "text": "Upper or lower tier local authority",
+ "value": "1"
+ },
+ {
+ "text": "Charity with a registered charity number",
+ "value": "2"
+ },
+ {
+ "text": "Registered community interest company",
+ "value": "3"
+ },
+ {
+ "text": "Social enterprise",
+ "value": "4"
+ },
+ {
+ "text": "Community group",
+ "value": "5"
+ },
+ {
+ "text": "None of these",
+ "value": "6",
+ "description": ""
+ }
+ ]
+ }
+ ],
+ "sections": [
+ {
+ "name": "uLwBuz",
+ "title": "2.1 About your organisation"
+ }
+ ],
+ "conditions": [
+ {
+ "displayName": "org other name yes",
+ "name": "aHJVVz",
+ "value": {
+ "name": "org other name yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "KUdOhN",
+ "type": "YesNoField",
+ "display": "Does your organisation use any other names?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "org other yes",
+ "name": "aJJVVz",
+ "value": {
+ "name": "org other yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "jcmcJE",
+ "type": "RadiosField",
+ "display": "How is your organisation classified?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "other",
+ "display": "other"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "org charity yes",
+ "name": "aVVJJz",
+ "value": {
+ "name": "org charity yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "jcmcJE",
+ "type": "RadiosField",
+ "display": "How is your organisation classified?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "charity-with-a-registered-charity-number",
+ "display": "charity"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "org company yes",
+ "name": "aVJVJz",
+ "value": {
+ "name": "org company yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "jcmcJE",
+ "type": "RadiosField",
+ "display": "How is your organisation classified?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "registered-community-interest-company",
+ "display": "company"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Org other name no",
+ "name": "tOevBV",
+ "value": {
+ "name": "Org other name no",
+ "conditions": [
+ {
+ "field": {
+ "name": "KUdOhN",
+ "type": "YesNoField",
+ "display": "Does your organisation use any other names?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "joint bid yes",
+ "name": "nMJAdu",
+ "value": {
+ "name": "joint bid yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "MRdGKt",
+ "type": "YesNoField",
+ "display": "Is your application a joint bid in partnership with other organisations?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "joint bid no",
+ "name": "ZhSWyC",
+ "value": {
+ "name": "joint bid no",
+ "conditions": [
+ {
+ "field": {
+ "name": "MRdGKt",
+ "type": "YesNoField",
+ "display": "Is your application a joint bid in partnership with other organisations?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Ukraine support",
+ "name": "btRdYE",
+ "value": {
+ "name": "Ukraine support",
+ "conditions": [
+ {
+ "field": {
+ "name": "vYYoAC",
+ "type": "CheckboxesField",
+ "display": "Which cohort will your project focus on?"
+ },
+ "operator": "contains",
+ "value": {
+ "type": "Value",
+ "value": "ukrainian-schemes",
+ "display": "ukrainian-schemes"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Organisation no",
+ "name": "dfsBce",
+ "value": {
+ "name": "Organisation no",
+ "conditions": [
+ {
+ "field": {
+ "name": "KUdOhN",
+ "type": "YesNoField",
+ "display": "Does your organisation use any other names?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Organisation yes",
+ "name": "GZIoHg",
+ "value": {
+ "name": "Organisation yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "KUdOhN",
+ "type": "YesNoField",
+ "display": "Does your organisation use any other names?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Not a joint bid",
+ "name": "MbgmFQ",
+ "value": {
+ "name": "Not a joint bid",
+ "conditions": [
+ {
+ "field": {
+ "name": "MRdGKt",
+ "type": "YesNoField",
+ "display": "Is your application a joint bid in partnership with other organisations?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Based in england no",
+ "name": "JZGvHK",
+ "value": {
+ "name": "Based in england no",
+ "conditions": [
+ {
+ "field": {
+ "name": "qGbSWS",
+ "type": "YesNoField",
+ "display": "Is your organisation based in England?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Take place in England no",
+ "name": "LOPfHT",
+ "value": {
+ "name": "Take place in England no",
+ "conditions": [
+ {
+ "field": {
+ "name": "mknqUV",
+ "type": "YesNoField",
+ "display": "Will the project take place in England?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "fees": [],
+ "outputs": [
+ {
+ "name": "update-form",
+ "title": "Update form in application store",
+ "type": "savePerPage",
+ "outputConfiguration": {
+ "savePerPageUrl": "True"
+ }
+ }
+ ],
+ "version": 2,
+ "skipSummary": false,
+ "name": "Apply for funding to support children and young people on pathways to the UK from Ukraine, Hong Kong and Afghanistan"
+}
diff --git a/tests/test_data/all_questions/forms/name-your-application.json b/tests/test_data/all_questions/forms/name-your-application.json
new file mode 100644
index 00000000..fc203e4b
--- /dev/null
+++ b/tests/test_data/all_questions/forms/name-your-application.json
@@ -0,0 +1,59 @@
+{
+ "metadata": {},
+ "startPage": "/11-name-your-application",
+ "pages": [
+ {
+ "title": "1.1 Name your application",
+ "path": "/11-name-your-application",
+ "components": [
+ {
+ "name": "JAAhRP",
+ "options": {
+ "hideTitle": true,
+ "classes": "govuk-!-width-full"
+ },
+ "type": "TextField",
+ "title": "Name your application",
+ "hint": "This is what your application will be called and will help you find it when you save and return.
\nChoose a memorable name that describes your application.
"
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary"
+ }
+ ],
+ "section": "ScxYon"
+ },
+ {
+ "title": "Check your answers",
+ "path": "/summary",
+ "controller": "./pages/summary.js",
+ "components": [],
+ "next": [],
+ "section": "ScxYon"
+ }
+ ],
+ "lists": [],
+ "sections": [
+ {
+ "name": "ScxYon",
+ "title": "Name your application"
+ }
+ ],
+ "conditions": [],
+ "fees": [],
+ "outputs": [
+ {
+ "name": "update-form",
+ "title": "Update form in application store",
+ "type": "savePerPage",
+ "outputConfiguration": {
+ "savePerPageUrl": "True"
+ }
+ }
+ ],
+ "version": 2,
+ "skipSummary": false,
+ "markAsComplete": false,
+ "name":"Apply for funding to begin your digital planning improvement journey"
+}
diff --git a/tests/test_data/all_questions/forms/your-skills-and-experience-dpi.json b/tests/test_data/all_questions/forms/your-skills-and-experience-dpi.json
new file mode 100644
index 00000000..1e4abd59
--- /dev/null
+++ b/tests/test_data/all_questions/forms/your-skills-and-experience-dpi.json
@@ -0,0 +1,147 @@
+{
+ "metadata": {},
+ "startPage": "/31-your-skills-and-experience",
+ "pages": [
+ {
+ "title": "3.1 Your skills and experience",
+ "path": "/31-your-skills-and-experience",
+ "components": [
+ {
+ "name": "MbtXtU",
+ "options": {},
+ "type": "Html",
+ "content": "In this section, we'll ask about:
\n\nwhether your organisation has delivered projects like this before \ninformation about the projects you've delivered before (if applicable) \n "
+ }
+ ],
+ "next": [
+ {
+ "path": "/has-your-organisation-delivered-projects-like-this-before"
+ }
+ ],
+ "controller": "./pages/start.js"
+ },
+ {
+ "path": "/has-your-organisation-delivered-projects-like-this-before",
+ "title": "Has your organisation delivered projects like this before?",
+ "components": [
+ {
+ "name": "rGADMs",
+ "options": {
+ "hideTitle": true
+ },
+ "type": "YesNoField",
+ "title": "Has your organisation delivered projects like this before?"
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary",
+ "condition": "QOCrNa"
+ },
+ {
+ "path": "/similar-previous-projects",
+ "condition": "MAfLtk"
+ }
+ ],
+ "section": "akREtH"
+ },
+ {
+ "title": "Check your answers",
+ "path": "/summary",
+ "controller": "./pages/summary.js",
+ "components": [],
+ "next": [],
+ "section": "akREtH"
+ },
+ {
+ "path": "/similar-previous-projects",
+ "title": "Tell us about how your organisation has worked on similar previous projects",
+ "components": [
+ {
+ "name": "zHgZBx",
+ "options": {
+ "hideTitle": true,
+ "maxWords": "250"
+ },
+ "type": "FreeTextField",
+ "title": "Tell us about how your organisation has worked on similar previous projects",
+ "hint": "Tell us about:\n
\n the scale of the project \n the value of the project \n who was involved \n \n
"
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary"
+ }
+ ],
+ "section": "akREtH"
+ }
+ ],
+ "lists": [],
+ "sections": [
+ {
+ "name": "akREtH",
+ "title": "Your skills and experience"
+ }
+ ],
+ "conditions": [
+ {
+ "displayName": "previous projects",
+ "name": "MAfLtk",
+ "value": {
+ "name": "previous projects",
+ "conditions": [
+ {
+ "field": {
+ "name": "rGADMs",
+ "type": "YesNoField",
+ "display": "Has your organisation delivered projects like this before?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Previous project no",
+ "name": "QOCrNa",
+ "value": {
+ "name": "Previous project no",
+ "conditions": [
+ {
+ "field": {
+ "name": "rGADMs",
+ "type": "YesNoField",
+ "display": "Has your organisation delivered projects like this before?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "fees": [],
+ "outputs": [
+ {
+ "name": "update-form",
+ "title": "Update form in application store",
+ "type": "savePerPage",
+ "outputConfiguration": {
+ "savePerPageUrl": "True"
+ }
+ }
+ ],
+ "version": 2,
+ "skipSummary": false,
+ "markAsComplete": false,
+ "name": "Apply for funding to begin your digital planning improvement journey"
+}
diff --git a/tests/test_generate_all_questions.py b/tests/test_generate_all_questions.py
index 2c4068f1..feb6381a 100644
--- a/tests/test_generate_all_questions.py
+++ b/tests/test_generate_all_questions.py
@@ -18,14 +18,15 @@
TEST_METADATA_FOLDER = "./tests/test_data/all_questions/metadata/"
+TEST_FORMS_FOLDER = "./tests/test_data/all_questions/forms/"
@pytest.mark.skip(reason="Generates test data")
def test_generate_metadata():
+ """Used to save generated metadata to a file, so taht file can be used for static test data"""
filename = "organisation-information-cof-r3-w2.json"
path_to_form = os.path.join(
- "/Users/sarahsloan/dev/CommunitiesUkWorkspace/digital-form-builder/"
- "fsd_config/form_jsons/cof_r3w2/en/",
+ "/path/to/digital-form-builder/fsd_config/form_jsons/cof_r3w2/en/",
filename,
)
with open(path_to_form, "r") as f:
@@ -37,14 +38,14 @@ def test_generate_metadata():
@pytest.mark.skip(reason="Generates test data")
def test_generate_test_data():
- output_folder = "/Users/sarahsloan/dev/temp/"
+ """Used to extract a small part of metadata for easier testing."""
+ output_folder = "/some/temp/folder"
files_to_generate = [START_TO_MAIN_ACTIVITIES, HOW_IS_ORG_CLASSIFIED, JOINT_BID]
generate_test_data(
target_test_files=files_to_generate,
in_path=os.path.join(TEST_METADATA_FOLDER, "some_file_name.json"),
out_folder=output_folder,
)
- "/Users/sarahsloan/dev/temp/metadata_applicant_ns.json"
def test_generate_index_org_info_cof_r3w2():
@@ -329,8 +330,7 @@ def test_find_forms_dir_with_lang(tmp_path):
def test_generate_component_display_name_your_app():
with open(
- "/Users/sarahsloan/dev/CommunitiesUkWorkspace/digital-form-builder/"
- "fsd_config/form_jsons/generic/name-your-application.json",
+ os.path.join(TEST_FORMS_FOLDER, "name-your-application.json"),
"r",
) as f:
form_json = json.load(f)
@@ -344,8 +344,7 @@ def test_generate_component_display_name_your_app():
def test_build_components_empty_text_and_title():
with open(
- "/Users/sarahsloan/dev/CommunitiesUkWorkspace/digital-form-builder/"
- "fsd_config/form_jsons/cyp_r1/about-your-organisation-cyp.json",
+ os.path.join(TEST_FORMS_FOLDER, "about-your-organisation-cyp.json"),
"r",
) as f:
form_json = json.load(f)
@@ -362,8 +361,7 @@ def test_build_components_empty_text_and_title():
def test_build_components_include_options_from_radios_and_branching_text():
with open(
- "/Users/sarahsloan/dev/CommunitiesUkWorkspace/digital-form-builder/"
- "fsd_config/form_jsons/cyp_r1/about-your-organisation-cyp.json",
+ os.path.join(TEST_FORMS_FOLDER, "about-your-organisation-cyp.json"),
"r",
) as f:
form_json = json.load(f)
@@ -397,8 +395,7 @@ def test_build_components_include_options_from_radios_and_branching_text():
def test_build_components_bullets_in_hint():
with open(
- "/Users/sarahsloan/dev/CommunitiesUkWorkspace/digital-form-builder/"
- "fsd_config/form_jsons/dpif_r2/your-skills-and-experience-dpi.json",
+ os.path.join(TEST_FORMS_FOLDER, "your-skills-and-experience-dpi.json"),
"r",
) as f:
form_json = json.load(f)