Skip to main content

Debug Panel Campaign Mock Improvements

In our debug panel, inside the Campaign tab, there is "Use Mock Campaign Form" button.


We have had made it locale dependent (for the locales supported by HAPI Backend, which are "en", "de" & "nl") so that it prefills with appropriate mock data for that locale such as Job Description, Target Group etc.


However we had an issue where the targetGroup inside campaignForm was being prefilled with wrong educationLevel and seniority in terms of the data structure thus leading to a runtime error in Target Group and/or Order Review step.


In order to fix this, we have had to make window.hapiQA.campaign.useMockCampaignForm() QA function an async function thus it is also responsible for getting the select options from backend in the specified locale.


That function is not documented however you may have stumbled upon this while navigating through the window object. If you have code depending on this, like for some test flows, you will need to adjust your code to await window.hapiQA.campaign.useMockCampaignForm()