Skip to content

Commit

Permalink
EES-4389 - breaking Next.js ISR time into distinct wait in the UI tes…
Browse files Browse the repository at this point in the history
…ts, to allow it to be fine-tuned for different environments
  • Loading branch information
duncan-at-hiveit committed Jul 7, 2023
1 parent 27246d0 commit 01da12f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/robot-tests/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ EXPIRED_INVITE_USER_EMAIL= # Expired Invite user email
EXPIRED_INVITE_USER_PASSWORD= # Expired Invite user password
RELEASE_COMPLETE_WAIT=120 # Time to wait for a release to publish (in seconds)
WAIT_CACHE_EXPIRY=2 # Time to wait for the environment's various caches to expire (in seconds. Local = 2, Dev = 10)
WAIT_NEXT_ISR=5 # Time for Next.js to perform Incremental Static Regeneration (generate a new version of a stale page in the background)
WAIT_MEDIUM=120 # Variable used throughout tests (in seconds)
WAIT_SMALL=45 # Variable used throughout tests (in seconds)
WAIT_LONG=180 # Variable used throughout tests (in seconds)
Expand Down
1 change: 1 addition & 0 deletions tests/robot-tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
"FAIL_TEST_SUITES_FAST",
"IDENTITY_PROVIDER",
"WAIT_CACHE_EXPIRY",
"WAIT_NEXT_ISR",
"EXPIRED_INVITE_USER_EMAIL",
"PUBLISHER_FUNCTIONS_URL",
]
Expand Down
7 changes: 3 additions & 4 deletions tests/robot-tests/tests/libs/public-common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ user checks methodology note
user waits until element contains css:#methodologyNotes li:nth-of-type(${number}) time ${displayDate}
user waits until element contains css:#methodologyNotes li:nth-of-type(${number}) p ${content}

# Next.js will have returned a stale cached page for the last request and will have created a new cached page in
# the background in the meantime, so request the page again.

user reloads the stale cached page
sleep 3
# Next.js will have returned a stale cached page for the last request and will have created a new cached page in
# the background in the meantime using Incremental Static Regeneration, so request the page again.
sleep %{WAIT_NEXT_ISR}
user reloads page

0 comments on commit 01da12f

Please sign in to comment.