-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TECH-1844: Added a method to wait until SAM returns green
- Loading branch information
1 parent
130a1c0
commit bf0440e
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
query($severity: GqlProbeSeverity) { | ||
admin { | ||
jahia { | ||
healthCheck(severity: $severity) { | ||
status { | ||
health | ||
message | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const waitUntilSAMStatusGreen = (severity = 'MEDIUM', timeout = 60000, interval = 1000) : void => { | ||
cy.waitUntil(() => | ||
cy.apollo({ | ||
fetchPolicy: 'no-cache', | ||
queryFile: 'graphql/sam/healthStatus.graphql', | ||
variables: { | ||
severity: severity | ||
}, | ||
Check failure on line 8 in src/utils/SAMHelper.ts GitHub Actions / Lint and build
|
||
}).then(result => { | ||
const healthStatus = result?.data?.admin?.jahia?.healthCheck?.status; | ||
if (healthStatus) { | ||
return healthStatus.health === 'GREEN'; | ||
} | ||
}), | ||
{ | ||
errorMsg: `Timeout waiting for SAM to be green for severity: ${severity}`, | ||
timeout: timeout, | ||
verbose: true, | ||
interval: interval | ||
}); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters