Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
4ead39b
upgrade webdriver
Yuyuutsu Nov 3, 2025
90b938f
update whole webdriver libary to 9.20.0
Yuyuutsu Nov 4, 2025
58f3796
Set getHTML prettify to false
Yuyuutsu Nov 4, 2025
89a9325
Set Prettify to false in getHTML
Yuyuutsu Nov 4, 2025
9ed2756
fix formatting error with getHTML prettify change
Yuyuutsu Nov 4, 2025
e74b924
fix formatting in funcitonal tests
Yuyuutsu Nov 4, 2025
2b0e71a
update getHTML tag inlcudeSelectorTag to equal false on svg tags
Yuyuutsu Nov 4, 2025
291924c
Remove unecessary brownser.open stratments and update wait check
Yuyuutsu Nov 4, 2025
613bde3
update list collector summary item html structure test
Yuyuutsu Nov 4, 2025
e2934a8
Add wait browser to load helper function to replace browser.wait(100)…
Yuyuutsu Nov 4, 2025
f4d1c61
fix linting errors in functional tests
Yuyuutsu Nov 4, 2025
b65d862
set includeselectortag to false for nhse spec
Yuyuutsu Nov 4, 2025
9d814e8
add includeselectortags for logo checks
Yuyuutsu Nov 5, 2025
62f545f
Add wait for questionnaire to load functions to tests to imporve robu…
Yuyuutsu Nov 5, 2025
a811342
Add wait for questionnaire to load functions to tests to imporve robu…
Yuyuutsu Nov 5, 2025
0e3e82f
fix linting and reformat tests
Yuyuutsu Nov 5, 2025
08afdeb
Add waitForQuestionniareToLoad functions to flakey tests due to race …
Yuyuutsu Nov 5, 2025
ed2fc10
Update tests to reduce flakinesses
Yuyuutsu Nov 5, 2025
9feb657
update newwindow to explictly use about:blank which used to be implic…
Yuyuutsu Nov 5, 2025
5710a2a
fix linting errors using make format
Yuyuutsu Nov 5, 2025
8e8d298
Fix race connditioning issues in supplementary data calculated questi…
Yuyuutsu Nov 5, 2025
28c423c
add waitForQuestionnaireToLoad to prevent flakiness
Yuyuutsu Nov 5, 2025
56ab8d9
add waits for questionnaires to load
Yuyuutsu Nov 5, 2025
ca7e110
add a wait function before checking for elements
Yuyuutsu Nov 5, 2025
d2115d3
update waitForQuestionnaireToload to waitFroPageToLoad because of sup…
Yuyuutsu Nov 6, 2025
0bd9170
update logic for waitForPageToLoad
Yuyuutsu Nov 6, 2025
02f65ba
update tests to use new helper function
Yuyuutsu Nov 6, 2025
156961c
add pagetoLoad before html checks
Yuyuutsu Nov 7, 2025
8990c3a
update supplementary data calcualted summary repeating section for GA…
Yuyuutsu Nov 7, 2025
a23e3d1
add more puases for supplementary data to load
Yuyuutsu Nov 7, 2025
8cc3a71
edit workflow temporary to test two failing tests in GA
Yuyuutsu Nov 7, 2025
e665922
Update YAML to test only two failing tests
Yuyuutsu Nov 7, 2025
5a587c8
add wait for listlabels to load to test
Yuyuutsu Nov 7, 2025
f9d61c7
add wait for page to loads
Yuyuutsu Nov 7, 2025
e97a165
update capatabilites in wdio config for ci
Yuyuutsu Nov 7, 2025
5093b86
revert changes to wdio config and tests/functional
Yuyuutsu Nov 7, 2025
512888b
add pauses to allow sds data to load
Yuyuutsu Nov 7, 2025
e17634a
add await to browserpause
Yuyuutsu Nov 7, 2025
4632795
update tests to wait after every page
Yuyuutsu Nov 7, 2025
8ad63a5
test all supplementary data specs
Yuyuutsu Nov 7, 2025
f1f807f
change log level to debug
Yuyuutsu Nov 7, 2025
0e93350
set a reponse_id
Yuyuutsu Nov 10, 2025
9f3f552
update test getRandomString function
Yuyuutsu Nov 10, 2025
4458827
fix import issue with helper function
Yuyuutsu Nov 10, 2025
a494659
update tests
Yuyuutsu Nov 10, 2025
9a6adf7
update open questionnaire command
Yuyuutsu Nov 10, 2025
f3f6d6f
remove empty white spcae
Yuyuutsu Nov 10, 2025
b049044
revert all changes but keep logging level to debug
Yuyuutsu Nov 10, 2025
dd32f6c
remove output fir
Yuyuutsu Nov 10, 2025
e838ae3
update debug log level
Yuyuutsu Nov 10, 2025
434d264
Add an await to browser.openquetionnaire command in wdio confs
Yuyuutsu Nov 10, 2025
95983f5
update browser.openquestionniare commands to use correct arguemnt lau…
Yuyuutsu Nov 10, 2025
056efba
update where we set resposneID value
Yuyuutsu Nov 10, 2025
642e31a
use headless when running tests
Yuyuutsu Nov 10, 2025
7de0aab
update responseId generation process
Yuyuutsu Nov 10, 2025
ae4790f
fix linting issues in functional tests
Yuyuutsu Nov 10, 2025
30a98b5
add log directory
Yuyuutsu Nov 10, 2025
4293472
remove headless
Yuyuutsu Nov 11, 2025
eb987ba
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Nov 11, 2025
76a15ff
revert window size change in conf.cjs
Yuyuutsu Nov 11, 2025
6192bf0
update token session method
Yuyuutsu Nov 11, 2025
4bc021c
update page load time
Yuyuutsu Nov 11, 2025
7a6c4f7
check if sds is loaded
Yuyuutsu Nov 11, 2025
13b4d92
check sds is loaded
Yuyuutsu Nov 12, 2025
6b66e3b
update sds load check
Yuyuutsu Nov 12, 2025
edcf8bf
update helper waitLoadFunction to wait for eveerything to render
Yuyuutsu Nov 12, 2025
77edd78
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Nov 12, 2025
d0d5b1d
update response id to be already set
Yuyuutsu Nov 12, 2025
096e932
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Nov 12, 2025
c669fbb
revert changes
Yuyuutsu Nov 13, 2025
8d82627
add supplementarydata test to check schemas open
Yuyuutsu Nov 13, 2025
ed7cfa1
fix linting issues
Yuyuutsu Nov 13, 2025
45cba9a
test failing schemas and add test to check if all schemas load with sds
Yuyuutsu Nov 13, 2025
1be390a
fix spec path
Yuyuutsu Nov 13, 2025
bfdc883
more specifc checks for tests
Yuyuutsu Nov 13, 2025
64e6187
remvoe double .json
Yuyuutsu Nov 13, 2025
e47218e
update tests for more specifc use
Yuyuutsu Nov 13, 2025
c9152d9
add hub and spoke to the tests
Yuyuutsu Nov 13, 2025
d6bbadf
add longer wait times for pages to render
Yuyuutsu Nov 13, 2025
20ab725
update so all tests run
Yuyuutsu Nov 13, 2025
8d70c49
clear session before each open questtionnaire
Yuyuutsu Nov 14, 2025
eae2f13
revert actions to original
Yuyuutsu Nov 14, 2025
b373ffa
change max instances to 1
Yuyuutsu Nov 14, 2025
7517e82
update funtional tests to seperate sds
Yuyuutsu Nov 14, 2025
d1f5f21
add load time before first sds schema test
Yuyuutsu Nov 14, 2025
f79c30e
remove browser refresh on the first sds test
Yuyuutsu Nov 14, 2025
a34ebc0
update order of tests
Yuyuutsu Nov 14, 2025
61a8b8f
revert test order in GA
Yuyuutsu Nov 17, 2025
bbc1c81
add a smoke test
Yuyuutsu Nov 17, 2025
e1e53f3
add rety spec funciton
Yuyuutsu Nov 17, 2025
b15a62a
fix linting issues
Yuyuutsu Nov 17, 2025
8f33f06
revert debugging configs
Yuyuutsu Nov 20, 2025
bbcebb1
remove accidental revert
Yuyuutsu Nov 20, 2025
e53b154
Revert back to 2 max instances
Yuyuutsu Nov 20, 2025
3ae1699
re-add updated chrome options
Yuyuutsu Nov 20, 2025
d3ed675
remove comment in pull request yml
Yuyuutsu Nov 20, 2025
9ac0e96
update tests to remove browser.wait()
Yuyuutsu Nov 24, 2025
e33d387
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Nov 26, 2025
6e2b298
Upgrade Babel to upgrade transistive dependency - baseline-browser-ma…
Yuyuutsu Nov 28, 2025
d60e135
upgrade glob in package.lock
Yuyuutsu Dec 3, 2025
a2ad69b
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Dec 3, 2025
7a91163
update basline-browser-mapping
Yuyuutsu Dec 4, 2025
5d7be77
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Dec 4, 2025
a61f60b
remove chromium-bidi
Yuyuutsu Dec 9, 2025
2614a09
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Dec 11, 2025
309f039
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 5, 2026
57b3617
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 6, 2026
a62b1b9
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 8, 2026
d33c2c3
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 15, 2026
1a4d987
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 19, 2026
66b1588
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Jan 28, 2026
b2dc844
Add getHTMLUnformatted method to Helper.js
Yuyuutsu Jan 30, 2026
7334710
Update functional tests to use new helper getHTML function
Yuyuutsu Feb 3, 2026
ba600f8
Update tests to use getInnerhtml
Yuyuutsu Feb 3, 2026
4853d36
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 4, 2026
0350d6d
update package.json to set babel core peer to true
Yuyuutsu Feb 4, 2026
4fbd540
update function name to getRawHTML
Yuyuutsu Feb 4, 2026
281e16e
fix badly formatted tests
Yuyuutsu Feb 4, 2026
31f6a4b
fix linting errors
Yuyuutsu Feb 5, 2026
c6e8364
update helper function to have optional input for includeselectortag
Yuyuutsu Feb 5, 2026
719650f
fix incorrect getRawHTML quotes
Yuyuutsu Feb 6, 2026
cd6d9e5
remove incorrect use of $
Yuyuutsu Feb 6, 2026
f65495d
Remove blank lines created by deleting browser.pause
Yuyuutsu Feb 6, 2026
5e0891e
Replace getHTML with getRawhtml helper funciton
Yuyuutsu Feb 9, 2026
7c9a7dc
update supplementary data test with getRawHTML
Yuyuutsu Feb 9, 2026
7537e3f
remove accidneatlly added import
Yuyuutsu Feb 9, 2026
885d056
remove $ selectors from supplementary data testt
Yuyuutsu Feb 9, 2026
1e87415
Fixing formatting issues when implementing getRawHTML
Yuyuutsu Feb 9, 2026
3a19db0
fix list collector selection
Yuyuutsu Feb 11, 2026
a2d4d08
Fix playback confirmation by removing $ selector
Yuyuutsu Feb 11, 2026
e06ea73
update list_collector_content spec to use correct getText function
Yuyuutsu Feb 11, 2026
6c4faff
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 11, 2026
83fe4b7
remove accidental file added
Yuyuutsu Feb 11, 2026
e45960f
revert const varianle for rows
Yuyuutsu Feb 12, 2026
87730b6
fix companiesListRowItem call in list collector section summary
Yuyuutsu Feb 13, 2026
c608b59
fix getRawHTML call in listcollector section summary
Yuyuutsu Feb 16, 2026
ec8d39e
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 16, 2026
277f955
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 16, 2026
324c2ab
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 17, 2026
ce0df32
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 17, 2026
b3ae866
update pakcagelock json
Yuyuutsu Feb 17, 2026
c34be4c
update getRawHTML call for companiesListRowItem
Yuyuutsu Feb 17, 2026
b128203
Add browser pause before verififcation assertion
Yuyuutsu Feb 19, 2026
de438bc
change click behavior to instant
Yuyuutsu Feb 19, 2026
d43a931
Remove blank line space
Yuyuutsu Feb 23, 2026
7a6eced
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 25, 2026
b1c68be
Merge branch 'main' into upgrade-webdriver-to-v9.20.0
Yuyuutsu Feb 27, 2026
c7bea19
update package-lock.json with merge conflicts
Yuyuutsu Feb 27, 2026
5e505d1
Update all WDIO packages to 9.24.0
Yuyuutsu Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ jobs:
timeout-minutes: 35
env:
EQ_RUN_FUNCTIONAL_TESTS_HEADLESS: True
# :TODO: Revisit & update when 2 instances can be used without adverse effects
EQ_FUNCTIONAL_TEST_MAX_INSTANCES: 2
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
Expand All @@ -173,8 +172,10 @@ jobs:
run: npm install
- name: Docker compose
run: docker compose --version && RUNNER_ENV_FILE=.functional-tests.env docker compose up --build -d
- name: Functional tests
run: make test-functional
- name: Functional tests (supplementary data)
run: make test-functional-sds
- name: Functional tests (main suite)
run: make test-functional-main
- name: Docker compose shutdown
run: RUNNER_ENV_FILE=.functional-tests.env docker compose kill
docker-push:
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ test:
test-unit:
poetry run ./scripts/run_tests_unit.sh

test-functional-main: generate-pages
npm run test_functional_main

test-functional-sds: generate-pages
EQ_FUNCTIONAL_TEST_MAX_INSTANCES=1 npm run test_functional_sds

test-functional: generate-pages
npm run test_functional
$(MAKE) test-functional-main
$(MAKE) test-functional-sds

test-functional-headless: generate-pages
EQ_RUN_FUNCTIONAL_TESTS_HEADLESS='True' make test-functional
Expand Down
6,923 changes: 1,602 additions & 5,321 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"lint:tests": "prettier --check \"tests/functional/**/*.js\" && eslint \"tests/functional/**/*.js\"",
"lint:test-schemas": "prettier --check \"schemas/test/*/*.json\" && eslint \"schemas/test/**/*.json\"",
"test_functional": "./node_modules/.bin/wdio tests/functional/wdio.conf.js",
"test_functional_main": "FUNCTIONAL_MODE=main npm run test_functional",
"test_functional_sds": "FUNCTIONAL_MODE=sds npm run test_functional",
"generate_pages": "rm -rf ./tests/functional/generated_pages && poetry run python -m tests.functional.generate_pages schemas/test/en/ ./tests/functional/generated_pages -r '../../base_pages'",
"format": "npm run format:tests && npm run format:test-schemas",
"format:tests": "prettier \"tests/functional/**/*.js\" --write && eslint --fix \"tests/functional/**/*.js\"",
Expand All @@ -29,10 +31,10 @@
"@babel/preset-env": "7.28.5",
"@babel/register": "7.28.3",
"@babel/runtime": "7.28.4",
"@wdio/cli": "9.21.1",
"@wdio/local-runner": "8.46.0",
"@wdio/mocha-framework": "9.21.0",
"@wdio/spec-reporter": "9.20.0",
"@wdio/local-runner": "9.24.0",
"@wdio/cli": "9.24.0",
"@wdio/mocha-framework": "9.24.0",
"@wdio/spec-reporter": "9.24.0",
"eslint": "8.57.1",
"eslint-cli": "1.1.1",
"eslint-config-standard": "17.1.0",
Expand All @@ -49,7 +51,7 @@
"prettier": "3.7.3",
"typescript": "5.9.3",
"uuid": "13.0.0",
"webdriverio": "9.21.0"
"webdriverio": "9.24.0"
},
"prettier": {}
}
30 changes: 29 additions & 1 deletion tests/functional/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const click = async (selector) => {
// but clicks down on the very top of the button which moves down and just below the mouse. When the mouse click is released
// it's no longer over the button and the click silently fails. This means that when the test comes to do assertions on the following page
// they fail, as we never navigated to that page.
await $(selector).scrollIntoView({ block: "center", inline: "center", behavior: "smooth" });
await $(selector).scrollIntoView({ block: "center", inline: "center", behavior: "instant" });
await $(selector).click();

// Allow time in case the click loads a new page.
Expand All @@ -67,3 +67,31 @@ export const verifyUrlContains = async (expectedUrlString) => {
export const verifyUrlContainsSyncMode = (expectedUrlString) => {
expect(browser).toHaveUrl(expect.stringContaining(expectedUrlString));
};

export async function openQuestionnaireWithRetry(schema, options, maxRetries = 1) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
await browser.openQuestionnaire(schema, options);

const bodyText = await $("body").getText();
const isServiceError = bodyText.includes("Sorry, there is a problem with this service");

if (!isServiceError) {
return;
}

if (attempt === maxRetries) {
throw new Error(`Service error page after ${maxRetries + 1} attempt(s) for schema="${schema}" with options=${JSON.stringify(options)}`);
}
await browser.reloadSession();
}
}

export async function getRawHTML(selector, options = {}) {
const { includeSelectorTag = true } = options;
const element = await $(selector);

return element.getHTML({
prettify: false,
includeSelectorTag,
});
}
4 changes: 2 additions & 2 deletions tests/functional/spec/checkbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MandatoryCheckboxPage from "../generated_pages/checkbox/mandatory-checkbo
import NonMandatoryCheckboxPage from "../generated_pages/checkbox/non-mandatory-checkbox.page";
import singleCheckboxPage from "../generated_pages/checkbox/single-checkbox.page";
import SubmitPage from "../generated_pages/checkbox/submit.page";
import { click, verifyUrlContains } from "../helpers";
import { click, verifyUrlContains, getRawHTML } from "../helpers";

describe('Checkbox with "other" option', () => {
beforeEach("Load the survey", async () => {
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('Checkbox with "other" option', () => {
// When
await click(MandatoryCheckboxPage.submit());
// Then
await expect(await $(MandatoryCheckboxPage.error()).getHTML()).toContain(
await expect(await getRawHTML(MandatoryCheckboxPage.error())).toContain(
'Select at least one answer <span class="ons-u-vh">to ‘Which pizza toppings would you like?’</span></a>',
);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/spec/components/address/address.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import AddressConfirmation from "../../../generated_pages/address/address-confir
import AddressMandatory from "../../../generated_pages/address/address-block-mandatory.page";
import AddressOptional from "../../../generated_pages/address/address-block-optional.page";
import SubmitPage from "../../../generated_pages/address/submit.page";
import { click, verifyUrlContains } from "../../../helpers";
import { click, verifyUrlContains, getRawHTML } from "../../../helpers";

describe("Address Answer Type", () => {
beforeEach("Launch survey", async () => {
Expand All @@ -21,7 +21,7 @@ describe("Address Answer Type", () => {
await click(AddressConfirmation.submit());
await verifyUrlContains(SubmitPage.pageName);
await expect(await $(SubmitPage.addressMandatory()).getText()).toBe("Evelyn Street\nApt 7\nBarry\nCF63 4JG");
await expect(await $(SubmitPage.addressMandatory()).getHTML()).toContain("Evelyn Street<br>Apt 7<br>Barry<br>CF63 4JG");
await expect(await getRawHTML(SubmitPage.addressMandatory())).toContain("Evelyn Street<br>Apt 7<br>Barry<br>CF63 4JG");
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Currency With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-currency");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Day Month Year Date With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-date");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Duration With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-duration");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Month Year Date With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-month-year-date");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Day Month Year Date With Multiple Radio Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive_multiple.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-date");
});
describe("Given the user has entered a value for the non-exclusive month year date answer", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Textfield With Multiple Radio Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive_multiple.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-textfield");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Number With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-number");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Percentage With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-percentage");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive TextArea With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-textarea");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Textfield With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-textfield");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Unit With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-unit");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { click } from "../../../../helpers";
describe("Component: Mutually Exclusive Year Date With Single Checkbox Override", () => {
beforeEach(async () => {
await browser.openQuestionnaire("test_mutually_exclusive.json");
await browser.pause(100);
await browser.url("/questionnaire/mutually-exclusive-year-date");
});

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/spec/components/radio/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import RadioNonMandatoryDetailAnswerOverriddenPage from "../../../generated_page

import RadioNonMandatoryDetailAnswerPage from "../../../generated_pages/radio_optional_with_detail_answer_mandatory/radio-non-mandatory.page";
import RadioNonMandatoryDetailAnswerSummary from "../../../generated_pages/radio_optional_with_detail_answer_mandatory/submit.page";
import { click, verifyUrlContains } from "../../../helpers";
import { click, verifyUrlContains, getRawHTML } from "../../../helpers";
describe("Component: Radio", () => {
describe("Given I start a Mandatory Radio survey", () => {
before(async () => {
Expand Down Expand Up @@ -50,7 +50,7 @@ describe("Component: Radio", () => {

it("When I have submitted the page without any option, Then the question text is hidden in the error message using a span element", async () => {
await click(RadioMandatoryOverriddenPage.submit());
await expect(await $(RadioMandatoryOverriddenPage.errorNumber(1)).getHTML()).toContain(
await expect(await getRawHTML(RadioMandatoryOverriddenPage.errorNumber(1))).toContain(
'Select an answer <span class="ons-u-vh">to ‘What do you prefer for breakfast?’</span></a>',
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("Last viewed question guidance", () => {
it("When the respondent resumes on the first block of a section, then last question guidance is not shown", async () => {
await $(HouseholdInterstitialPage.saveSignOut()).click();
await browser.openQuestionnaire("test_last_viewed_question_guidance.json", resumableLaunchParams);
await browser.pause(100);

await verifyUrlContains(HouseholdInterstitialPage.url());
await expect(await $(HouseholdInterstitialPage.lastViewedQuestionGuidance()).isExisting()).toBe(false);
});
Expand All @@ -31,7 +31,7 @@ describe("Last viewed question guidance", () => {
await click(HouseholdInterstitialPage.submit());
await $(AddressConfirmationPage.saveSignOut()).click();
await browser.openQuestionnaire("test_last_viewed_question_guidance.json", resumableLaunchParams);
await browser.pause(100);

await verifyUrlContains(AddressConfirmationPage.url());
await expect(await $(AddressConfirmationPage.lastViewedQuestionGuidanceLink()).getAttribute("href")).toContain(HouseholdInterstitialPage.url());
await expect(await $(AddressConfirmationPage.lastViewedQuestionGuidance()).isExisting()).toBe(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("Last viewed question guidance", () => {
it("When the respondent saves and resumes from a section which is not started, then last question guidance is not shown", async () => {
await $(WorkInterstitialPage.saveSignOut()).click();
await browser.openQuestionnaire("test_last_viewed_question_guidance_hub.json", resumableLaunchParams);
await browser.pause(100);

await verifyUrlContains(WorkInterstitialPage.url());
await expect(await $(WorkInterstitialPage.lastViewedQuestionGuidance()).isExisting()).toBe(false);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MandatoryCheckboxPage from "../../../generated_pages/placeholder_playback_list/mandatory-checkbox.page";
import { click } from "../../../helpers";
import { click, getRawHTML } from "../../../helpers";
describe("Feature: Playback Confirmation", () => {
beforeEach("Open the schema", async () => {
await browser.openQuestionnaire("test_placeholder_playback_list.json");
Expand All @@ -10,7 +10,7 @@ describe("Feature: Playback Confirmation", () => {
await $(MandatoryCheckboxPage.ham()).click();
await click(MandatoryCheckboxPage.submit());

await expect(await $("#confirm-answers-question ul").getHTML()).toContain("Ham");
await expect(await $("#confirm-answers-question ul").getHTML()).toContain("Cheese");
await expect(await getRawHTML("#confirm-answers-question ul")).toContain("Ham");
await expect(await getRawHTML("#confirm-answers-question ul")).toContain("Cheese");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import DependencyQuestionSectionTwo from "../../../generated_pages/view_submitte
import SkippableBlockSectionTwo from "../../../generated_pages/view_submitted_response_repeating_sections/skippable-block.page";
import SectionSummarySectionTwo from "../../../generated_pages/new_calculated_summary_cross_section_dependencies_repeating/calculated-summary-section-summary.page";
import ListCollectorAddPage from "../../../generated_pages/view_submitted_response_repeating_sections//list-collector-add.page";
import { click, verifyUrlContains } from "../../../helpers";
import { click, verifyUrlContains, getRawHTML } from "../../../helpers";

describe("View Submitted Response", () => {
beforeEach("Load the questionnaire", async () => {
Expand All @@ -31,7 +31,7 @@ describe("View Submitted Response", () => {
await click(AddressBlockPage.submit());
await click(SubmitPage.submit());
await verifyUrlContains(ThankYouPage.pageName);
await expect(await $(ThankYouPage.title()).getHTML()).toContain("Thank you for completing the Test");
await expect(await getRawHTML(ThankYouPage.title())).toContain("Thank you for completing the Test");
await $(ThankYouPage.savePrintAnswersLink()).click();
await verifyUrlContains(ViewSubmittedResponsePage.pageName);
});
Expand All @@ -55,7 +55,7 @@ describe("View Submitted Response", () => {
await browser.pause(40000); // Waiting 40 seconds for the timeout to expire (45 minute timeout changed to 35 seconds by overriding VIEW_SUBMITTED_RESPONSE_EXPIRATION_IN_SECONDS for the purpose of the functional test)
await $(ViewSubmittedResponsePage.downloadButton()).click();
await expect(await $(ViewSubmittedResponsePage.informationPanel()).isDisplayed()).toBe(true);
await expect(await $(ViewSubmittedResponsePage.informationPanel()).getHTML()).toContain(
await expect(await getRawHTML(ViewSubmittedResponsePage.informationPanel())).toContain(
"For security, you can no longer view or get a copy of your answers",
);
});
Expand Down Expand Up @@ -124,7 +124,7 @@ describe("View Submitted Response Summary Page With Repeating Sections", () => {

await click(HubPage.submit());
await verifyUrlContains(ThankYouPage.pageName);
await expect(await $(ThankYouPage.title()).getHTML()).toContain("Thank you for completing the Test");
await expect(await getRawHTML(ThankYouPage.title())).toContain("Thank you for completing the Test");
await $(ThankYouPage.savePrintAnswersLink()).click();
await verifyUrlContains(ViewSubmittedResponsePage.pageName);
});
Expand All @@ -141,14 +141,14 @@ describe("View Submitted Response Summary Page With Repeating Sections", () => {
await expect(await $(ViewSubmittedResponseRepeatingPage.addressDetailsGroupTitle()).getText()).toBe("Address Details");
await expect(await $(ViewSubmittedResponseRepeatingPage.addressQuestion()).getText()).toBe("What is your address?");
await expect(await $(ViewSubmittedResponseRepeatingPage.addressAnswer()).getText()).toBe("NP10 8XG");
await expect(await $("body").getHTML()).toContain("Marcus Twin");
await expect(await getRawHTML("body")).toContain("Marcus Twin");
await expect(await $(firstGroup).$$(groupTitle)[0].getText()).toBe("Calculated Summary Group");
await expect(await $(firstGroup).$$(repeatingSectionAnswer)[0].getText()).toBe("40 - calculated summary answer (current section)");
await expect(await $("body").getHTML()).toContain("How much did Marcus Twin spend on fruit?");
await expect(await getRawHTML("body")).toContain("How much did Marcus Twin spend on fruit?");
await expect(await $(firstGroup).$$(skippableRepeatingSectionAnswer)[0].getText()).toBe("£100");
await expect(await $("body").getHTML()).toContain("John Doe");
await expect(await getRawHTML("body")).toContain("John Doe");
await expect(await $(secondGroup).$$(groupTitle)[0].getText()).toBe("Calculated Summary Group");
await expect(await $(secondGroup).$$(repeatingSectionAnswer)[0].getText()).toBe("80 - calculated summary answer (current section)");
await expect(await $("body").getHTML()).not.toContain("How much did John Doe spend on fruit?");
await expect(await getRawHTML("body")).not.toContain("How much did John Doe spend on fruit?");
});
});
Loading
Loading