feat(Cypress): Implemented test step GET CommunicationRequest
This commit is contained in:
parent
7a751125aa
commit
7e88cf0482
@ -3,7 +3,7 @@
|
|||||||
describe("it test the api", () => {
|
describe("it test the api", () => {
|
||||||
let jsonWebToken = "";
|
let jsonWebToken = "";
|
||||||
const apiUrl = "https://fhir-api.public.post-prod.lifen.fr";
|
const apiUrl = "https://fhir-api.public.post-prod.lifen.fr";
|
||||||
let documentReferenceId, communicationRequestId = "";
|
let documentReferenceId, communicationRequestId, patientId = "";
|
||||||
|
|
||||||
it("I have a JWT", () => {
|
it("I have a JWT", () => {
|
||||||
|
|
||||||
@ -24,13 +24,12 @@ describe("it test the api", () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip("I have a the document #1615660", () => {
|
it("I have a the document #1615660", () => {
|
||||||
cy.request({
|
cy.request({
|
||||||
url:`${apiUrl}/fhir/Binary/1615660`,
|
url:`${apiUrl}/fhir/Binary/1615660`,
|
||||||
method:'GET',
|
method:'GET',
|
||||||
headers: {
|
headers: {
|
||||||
"authorization" : `Bearer ${jsonWebToken}`,
|
"authorization" : `Bearer ${jsonWebToken}`,
|
||||||
"content-type": "application/json",
|
|
||||||
"Prefer": "return=representation"
|
"Prefer": "return=representation"
|
||||||
}
|
}
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
@ -165,6 +164,26 @@ describe("it test the api", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("I fetch the CommunicationRequest after waiting 10sec for the IA to process it", () => {
|
||||||
|
cy.wait(10000);
|
||||||
|
cy.request({
|
||||||
|
url: `${apiUrl}/fhir/CommunicationRequest/${communicationRequestId}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
authorization: `Bearer ${jsonWebToken}`
|
||||||
|
}
|
||||||
|
}).then((response) => {
|
||||||
|
expect(response.status).to.eq(200);
|
||||||
|
expect(response.headers["content-type"]).to.eq("application/fhir+json;charset=UTF-8");
|
||||||
|
expect(response.body).to.have.property("resourceType", "CommunicationRequest");
|
||||||
|
expect(response.body).to.have.property('id');
|
||||||
|
expect(response.body).to.have.property('status', 'suspended');
|
||||||
|
expect(response.body).to.have.property('subject');
|
||||||
|
expect(response.body).to.have.property('recipient');
|
||||||
|
expect(response.body.subject).to.have.property('reference');
|
||||||
|
patientId = response.body.subject.reference;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user