-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4141 from communitybridge/cypress-version
Cypress version
- Loading branch information
Showing
4 changed files
with
153 additions
and
0 deletions.
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,32 @@ | ||
import {validateApiResponse,validate_200_Status,getTokenKey} from '../support/commands' | ||
|
||
describe("To Validate & get health status via API call", function () { | ||
|
||
//Reference api doc: https://api-gw.dev.platform.linuxfoundation.org/cla-service/v4/api-docs#tag/health/operation/healthCheck | ||
const claEndpoint = `${Cypress.env("APP_URL")}cla-service/v4`; | ||
|
||
let bearerToken: string = null; | ||
before(() => { | ||
if(bearerToken==null){ | ||
getTokenKey(bearerToken); | ||
cy.window().then((win) => { | ||
bearerToken = win.localStorage.getItem('bearerToken'); | ||
}); | ||
} | ||
}); | ||
|
||
it("Returns the Health of the application- Record should Returns 200 Response", function () { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${claEndpoint}/ops/health`, | ||
auth: { | ||
'bearer': bearerToken, | ||
} | ||
}).then((response) => { | ||
validate_200_Status(response); | ||
//To validate schema of response | ||
validateApiResponse("health/healthCheck.json",response) | ||
}); | ||
}); | ||
|
||
}) |
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,32 @@ | ||
import {validateApiResponse,validate_200_Status,getTokenKey} from '../support/commands' | ||
|
||
describe("To Validate & check cla version via API call", function () { | ||
|
||
//Reference api doc: https://api-gw.dev.platform.linuxfoundation.org/cla-service/v4/api-docs#tag/version | ||
const claEndpoint = `${Cypress.env("APP_URL")}cla-service/v4`; | ||
|
||
let bearerToken: string = null; | ||
before(() => { | ||
if(bearerToken==null){ | ||
getTokenKey(bearerToken); | ||
cy.window().then((win) => { | ||
bearerToken = win.localStorage.getItem('bearerToken'); | ||
}); | ||
} | ||
}); | ||
|
||
it("Returns the application version information- Record should Returns 200 Response", function () { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${claEndpoint}/ops/version`, | ||
auth: { | ||
'bearer': bearerToken, | ||
} | ||
}).then((response) => { | ||
validate_200_Status(response); | ||
//To validate schema of response | ||
validateApiResponse("version/getVersion.json",response) | ||
}); | ||
}); | ||
|
||
}) |
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,65 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"properties": { | ||
"Branch": { | ||
"type": "string" | ||
}, | ||
"BuildTimeStamp": { | ||
"type": "string" | ||
}, | ||
"Githash": { | ||
"type": "string" | ||
}, | ||
"Healths": { | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"Duration": { | ||
"type": "string" | ||
}, | ||
"Error": { | ||
"type": "string" | ||
}, | ||
"Healthy": { | ||
"type": "boolean" | ||
}, | ||
"Name": { | ||
"type": "string" | ||
}, | ||
"TimeStamp": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"Duration", | ||
|
||
"Healthy", | ||
"Name", | ||
"TimeStamp" | ||
] | ||
} | ||
] | ||
}, | ||
"Status": { | ||
"type": "string" | ||
}, | ||
"TimeStamp": { | ||
"type": "string" | ||
}, | ||
"Version": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"Branch", | ||
"BuildTimeStamp", | ||
"Githash", | ||
"Healths", | ||
"Status", | ||
"TimeStamp", | ||
"Version" | ||
] | ||
} |
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,24 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"properties": { | ||
"branch": { | ||
"type": "string" | ||
}, | ||
"buildDate": { | ||
"type": "string" | ||
}, | ||
"commit": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"branch", | ||
"buildDate", | ||
"commit", | ||
"version" | ||
] | ||
} |