Skip to content

Commit

Permalink
fix(cypress): Add timeout for waiting on Nextcloud server
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Nov 3, 2023
1 parent 321ac31 commit cdfa566
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cypress/dockerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,15 @@ export const getContainerIP = async function(
// https://github.com/cypress-io/cypress/issues/22676
export const waitOnNextcloud = async function(ip: string) {
console.log('├─ Waiting for Nextcloud to be ready... ⏳')
await waitOn({ resources: [`http://${ip}/index.php`] })
await waitOn({
resources: [`http://${ip}/index.php`],
// wait for nextcloud to be up and return any non error status
validateStatus: (status) => status >= 200 && status < 400,
// timout in ms
timeout: 5 * 60 * 1000,
// timeout for a single HTTP request
httpTimeout: 60 * 1000,
})
console.log('└─ Done')
}

Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"@testing-library/vue": "^5.8.3",
"@types/dockerode": "^3.3.21",
"@types/jest": "^29.5.2",
"@types/wait-on": "^5.3.3",
"@vue/test-utils": "^1.3.5",
"@vue/tsconfig": "^0.4.0",
"@vue/vue2-jest": "^29.2.6",
Expand Down

0 comments on commit cdfa566

Please sign in to comment.