Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scrollIntoView warnings #1544

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
66dc601
Fix scrollIntoView warnings
berroar Oct 22, 2024
5de7a5c
one instance
berroar Oct 22, 2024
6dd8bfd
Revert
berroar Oct 22, 2024
cdc87e3
Merge branch 'main' into func-test-investigation
berroar Oct 24, 2024
5d89508
Test observing logs
berroar Oct 25, 2024
3280504
Temporarily use one suite
berroar Oct 25, 2024
8af8f95
Disable shared memory usage
berroar Oct 25, 2024
bdcb71a
Remove logs
berroar Oct 25, 2024
6bc8ddf
Revert to all suites
berroar Oct 25, 2024
f26b397
Add additional line to helper function
berroar Oct 25, 2024
4bed562
Test larger window size
berroar Oct 25, 2024
58419c5
DDdebug logs
berroar Oct 25, 2024
591264b
Change suite
berroar Oct 28, 2024
99269ed
Add wait
berroar Oct 28, 2024
069f894
Add more waits
berroar Oct 28, 2024
124320a
Test wait for exists
berroar Oct 29, 2024
8fe5c7b
Bump timeout
berroar Oct 29, 2024
92f7baf
Bump timeout
berroar Oct 29, 2024
a6de534
Additional waits
berroar Oct 29, 2024
9272a60
Remove timeouts, test retries
berroar Oct 29, 2024
347f18e
Move to before hook
berroar Oct 29, 2024
6d4de57
Update retries
berroar Oct 29, 2024
bdb59b2
Isolate suite
berroar Oct 29, 2024
ecfc547
Merge branch 'main' into func-test-investigation
berroar Oct 30, 2024
05250b1
Move supp data suite
berroar Oct 30, 2024
f0ce14f
Investigate journeys suite
berroar Oct 30, 2024
1a1c020
Update test
berroar Oct 30, 2024
ad4b319
Move func test
berroar Oct 30, 2024
8a8342e
Lint
berroar Oct 30, 2024
710ffb0
All suites
berroar Oct 30, 2024
b1b77c8
New suite
berroar Oct 30, 2024
2146ca6
fix typo
berroar Oct 30, 2024
b2cb198
1 instance
berroar Oct 31, 2024
1d265de
Merge branch 'main' into func-test-investigation
berroar Oct 31, 2024
5b8c42f
Merge branch 'main' into func-test-investigation
berroar Nov 1, 2024
996c693
fix conflicts
berroar Nov 1, 2024
2806066
Bump wdio runner
berroar Nov 1, 2024
a611d79
Remove timeout suites
berroar Nov 1, 2024
f4118e8
Update babel runtime
berroar Nov 1, 2024
c4bb30e
Only summaries suite
berroar Nov 1, 2024
b743b41
Update wdio packages
berroar Nov 4, 2024
20abbd3
Fix merge conflict
berroar Nov 4, 2024
3e4fb56
Merge branch 'main' into func-test-investigation
berroar Nov 14, 2024
9cd8f06
Update wdio version and run all suites
berroar Nov 21, 2024
cca0ac7
Update packages
berroar Nov 21, 2024
e14fad3
Revert eslint
berroar Nov 21, 2024
0fd8d88
Remove timeout suites
berroar Nov 21, 2024
089ae6f
Remove components
berroar Nov 21, 2024
05b4be9
Remove general
berroar Nov 22, 2024
9751661
Only Summaries
berroar Nov 22, 2024
f55f0e4
Merge branch 'main' into func-test-investigation
berroar Nov 25, 2024
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
10 changes: 8 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ jobs:
needs: [python-dependencies, node-dependencies]
strategy:
matrix:
suite: [ timeout_modal_expired, timeout_modal_extended, timeout_modal_extended_new_window, features, summaries, general, journeys, components, list_collector]
suite: [summaries]
runs-on: ubuntu-22.04
timeout-minutes: 30
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
EQ_FUNCTIONAL_TEST_MAX_INSTANCES: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -152,6 +152,12 @@ jobs:
run: docker compose --version && RUNNER_ENV_FILE=.functional-tests.env docker compose up --build -d
- name: Functional tests
run: make test-functional-suite SUITE=${{ matrix.suite }}
- name: Upload wdio logs
if: always()
uses: actions/upload-artifact@v4
with:
name: Func test logs
path: tests/functional/logs
- name: Docker compose shutdown
run: RUNNER_ENV_FILE=.functional-tests.env docker compose kill
docker-push:
Expand Down
4,011 changes: 1,250 additions & 2,761 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"@babel/plugin-transform-runtime": "^7.25.7",
"@babel/preset-env": "^7.25.8",
"@babel/register": "^7.25.7",
"@babel/runtime": "^7.25.7",
"@wdio/cli": "^9.2.1",
"@wdio/local-runner": "^8.14.3",
"@wdio/mocha-framework": "^9.1.3",
"@wdio/spec-reporter": "^9.1.3",
"eslint": "^v8.57.1",
"@babel/runtime": "^7.26.0",
"@wdio/cli": "^9.3.0",
"@wdio/local-runner": "^9.3.0",
"@wdio/mocha-framework": "^9.2.8",
"@wdio/spec-reporter": "^9.2.14",
"eslint": "^v8.57.0",
"eslint-cli": "^1.1.1",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
Expand Down
11 changes: 7 additions & 4 deletions tests/functional/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ 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" });
await $(selector).click();

// Allow time in case the click loads a new page.
const element = await $(selector);
await element.waitForDisplayed();
await browser.execute((el) => {
el.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
}, element);
await element.waitForClickable();
await element.click();
await browser.pause(100);
};

Expand Down
383 changes: 0 additions & 383 deletions tests/functional/spec/journeys/hub_and_spoke/hub_and_spoke.spec.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import HubPage from "../../../base_pages/hub.page.js";
import { click, verifyUrlContains } from "../../../helpers";
import LoadedSuccessfullyBlockPage from "../../../generated_pages/hub_section_required_with_repeat_supplementary/loaded-successfully-block.page";
import IntroductionBlockPage from "../../../generated_pages/hub_section_required_with_repeat_supplementary/introduction-block.page";
import ListCollectorEmployeesPage from "../../../generated_pages/hub_section_required_with_repeat_supplementary/list-collector-employees.page.js";
import LengthOfEmploymentPage from "../../../generated_pages/hub_section_required_with_repeat_supplementary/length-of-employment.page.js";
import Section3Page from "../../../generated_pages/hub_section_required_with_repeat_supplementary/section-3-summary.page.js";
import { getRandomString } from "../../../jwt_helper";

describe("Feature: Hub and Spoke with Supplementary Data", () => {
describe("Given a user opens a schema with hub required sections based on a repeating section using supplementary data", () => {
beforeEach("Load survey", async () => {
const responseId = getRandomString(16);
await browser.openQuestionnaire("test_hub_section_required_with_repeat_supplementary.json", {
version: "v2",
sdsDatasetId: "203b2f9d-c500-8175-98db-86ffcfdccfa3",
responseId,
});
});

it("When all the repeating sections are complete, Then the hub should be displayed", async () => {
await click(LoadedSuccessfullyBlockPage.submit());
await click(IntroductionBlockPage.submit());

// Complete the repeating sections using supplementary data
await click(ListCollectorEmployeesPage.submit());
await $(LengthOfEmploymentPage.day()).setValue(1);
await $(LengthOfEmploymentPage.month()).setValue(1);
await $(LengthOfEmploymentPage.year()).setValue(1930);
await click(LengthOfEmploymentPage.submit());
await click(Section3Page.submit());
await $(LengthOfEmploymentPage.day()).setValue(1);
await $(LengthOfEmploymentPage.month()).setValue(1);
await $(LengthOfEmploymentPage.year()).setValue(1930);
await click(LengthOfEmploymentPage.submit());
await click(Section3Page.submit());
await verifyUrlContains(HubPage.url());
});

it("When the repeating sections are incomplete. Then the hub should not be displayed", async () => {
await click(LoadedSuccessfullyBlockPage.submit());
await click(IntroductionBlockPage.submit());

// Don't complete the repeating sections that use supplementary data
await click(ListCollectorEmployeesPage.submit());
await $(LengthOfEmploymentPage.day()).setValue(1);
await $(LengthOfEmploymentPage.month()).setValue(1);
await $(LengthOfEmploymentPage.year()).setValue(1930);
await click(LengthOfEmploymentPage.submit());
await click(Section3Page.submit());

await browser.url(HubPage.url());
await verifyUrlContains("length-of-employment");
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe("Using supplementary data", () => {
});
});
it("Given I launch a survey using supplementary data, When I am outside a repeating section, Then I am able to see the list of items relating to a given supplementary data list item on the page", async () => {
await expect(await $("#main-content #guidance-1").getText()).toContain("The surnames of the employees are: Potter, Kent.");
await expect(await $("#main-content #guidance-1").getText()).toContain("The surnames of the employees are: Potter, Kent.");
await expect(await $$("#main-content li")[0].getText()).toBe("Articles and equipment for sports or outdoor games");
await expect(await $$("#main-content li")[1].getText()).toBe("Kitchen Equipment");
Expand Down
6 changes: 4 additions & 2 deletions tests/functional/wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ exports.config = {
timeout_modal_extended_new_window: ["./spec/timeout/timeout_modal_extended_new_window/*.js"],
components: ["./spec/components/**/*.js"],
features: ["./spec/features/**/*.js"],
supplementary_data: ["./spec/supplementary_data/supplementary_data/*.js"],
supplementary_data_hub_and_spoke: ["./spec/supplementary_data/hub_and_spoke_supplementary_data/*.js"],
summaries: ["./spec/summaries/**/*.js"],
journeys: ["./spec/journeys/**/*.js"],
list_collector: ["./spec/list_collector/**/*.js"],
Expand Down Expand Up @@ -79,7 +81,7 @@ exports.config = {
// Define all options that are relevant for the WebdriverIO instance here
//
// Level of logging verbosity: trace | debug | info | warn | error | silent
logLevel: "error",
logLevel: "debug",
outputDir: "tests/functional/logs/",
//
// Set specific log levels per logger
Expand Down Expand Up @@ -114,7 +116,7 @@ exports.config = {
connectionRetryTimeout: 120000,
//
// Default request retries count
connectionRetryCount: 3,
connectionRetryCount: 5,
//
// Test runner services
// Services take over a specific job you don't want to take care of. They enhance
Expand Down
Loading