-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
2,097 additions
and
18 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
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,63 @@ | ||
import { METHOD, STATUS_CODE } from "../../../support/api/api-const"; | ||
import API from "../../../support/ApiUrls"; | ||
|
||
context("Policy autotest", { tags: ['policyAT'] }, () => { | ||
const authorization = Cypress.env("authorization"); | ||
var policyId, testId; | ||
|
||
it("Run test for CDM ACM0001", () => { | ||
//import policy with tests | ||
cy.readFile("../Methodology Library/CDM/CDM ACM0001/ACM0001.policy", "binary") | ||
.then((binary) => Cypress.Blob.binaryStringToBlob(binary)) | ||
.then((file) => { | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + 'policies/import/file?demo=true', | ||
body: file, | ||
headers: { | ||
"content-type": "binary/octet-stream", | ||
authorization, | ||
}, | ||
timeout: 180000, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.SUCCESS); | ||
}); | ||
}) | ||
|
||
//get policy id and test id | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
policyId = response.body.at(0).id; | ||
testId = response.body.at(0).tests.at(0).id; | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + API.Policies + policyId + "/test/" + testId + "/start", | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
}) | ||
cy.wait(90000); | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
expect(response.body.at(0).tests.at(0).status).to.eq("Success"); | ||
}) | ||
}) | ||
|
||
//get policy id and test id | ||
|
||
}) | ||
}); |
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,63 @@ | ||
import { METHOD, STATUS_CODE } from "../../../support/api/api-const"; | ||
import API from "../../../support/ApiUrls"; | ||
|
||
context("Policy autotest", { tags: ['policyAT'] }, () => { | ||
const authorization = Cypress.env("authorization"); | ||
var policyId, testId; | ||
|
||
it("Run test for CDM ACM0018", () => { | ||
//import policy with tests | ||
cy.readFile("../Methodology Library/CDM/CDM ACM0018/ACM0018.policy", "binary") | ||
.then((binary) => Cypress.Blob.binaryStringToBlob(binary)) | ||
.then((file) => { | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + 'policies/import/file?demo=true', | ||
body: file, | ||
headers: { | ||
"content-type": "binary/octet-stream", | ||
authorization, | ||
}, | ||
timeout: 180000, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.SUCCESS); | ||
}); | ||
}) | ||
|
||
//get policy id and test id | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
policyId = response.body.at(0).id; | ||
testId = response.body.at(0).tests.at(0).id; | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + API.Policies + policyId + "/test/" + testId + "/start", | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
}) | ||
|
||
cy.wait(90000); | ||
|
||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
expect(response.body.at(0).tests.at(0).status).to.eq("Success"); | ||
}) | ||
}) | ||
|
||
}) | ||
}); |
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,63 @@ | ||
import { METHOD, STATUS_CODE } from "../../../support/api/api-const"; | ||
import API from "../../../support/ApiUrls"; | ||
|
||
context("Policy autotest", { tags: ['policyAT'] }, () => { | ||
const authorization = Cypress.env("authorization"); | ||
var policyId, testId; | ||
|
||
it("Run test for CDM ACM0002", () => { | ||
//import policy with tests | ||
cy.readFile("../Methodology Library/CDM/CDM ACM0002/ACM0002.policy", "binary") | ||
.then((binary) => Cypress.Blob.binaryStringToBlob(binary)) | ||
.then((file) => { | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + 'policies/import/file?demo=true', | ||
body: file, | ||
headers: { | ||
"content-type": "binary/octet-stream", | ||
authorization, | ||
}, | ||
timeout: 180000, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.SUCCESS); | ||
}); | ||
}) | ||
|
||
//get policy id and test id | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
policyId = response.body.at(0).id; | ||
testId = response.body.at(0).tests.at(0).id; | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + API.Policies + policyId + "/test/" + testId + "/start", | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
}) | ||
|
||
cy.wait(90000); | ||
|
||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
expect(response.body.at(0).tests.at(0).status).to.eq("Success"); | ||
}) | ||
}) | ||
|
||
}) | ||
}); |
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,63 @@ | ||
import { METHOD, STATUS_CODE } from "../../../support/api/api-const"; | ||
import API from "../../../support/ApiUrls"; | ||
|
||
context("Policy autotest", { tags: ['policyAT'] }, () => { | ||
const authorization = Cypress.env("authorization"); | ||
var policyId, testId; | ||
|
||
it("Run test for CDM ACM0006", () => { | ||
//import policy with tests | ||
cy.readFile("../Methodology Library/CDM/CDM ACM0006/ACM0006.policy", "binary") | ||
.then((binary) => Cypress.Blob.binaryStringToBlob(binary)) | ||
.then((file) => { | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + 'policies/import/file?demo=true', | ||
body: file, | ||
headers: { | ||
"content-type": "binary/octet-stream", | ||
authorization, | ||
}, | ||
timeout: 180000, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.SUCCESS); | ||
}); | ||
}) | ||
|
||
//get policy id and test id | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
policyId = response.body.at(0).id; | ||
testId = response.body.at(0).tests.at(0).id; | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + API.Policies + policyId + "/test/" + testId + "/start", | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
}) | ||
|
||
cy.wait(90000); | ||
|
||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
expect(response.body.at(0).tests.at(0).status).to.eq("Success"); | ||
}) | ||
}) | ||
|
||
}) | ||
}); |
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,63 @@ | ||
import { METHOD, STATUS_CODE } from "../../../support/api/api-const"; | ||
import API from "../../../support/ApiUrls"; | ||
|
||
context("Policy autotest", { tags: ['policyAT'] }, () => { | ||
const authorization = Cypress.env("authorization"); | ||
var policyId, testId; | ||
|
||
it("Run test for CDM ACM0007", () => { | ||
//import policy with tests | ||
cy.readFile("../Methodology Library/CDM/CDM ACM0007/ACM0007.policy", "binary") | ||
.then((binary) => Cypress.Blob.binaryStringToBlob(binary)) | ||
.then((file) => { | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + 'policies/import/file?demo=true', | ||
body: file, | ||
headers: { | ||
"content-type": "binary/octet-stream", | ||
authorization, | ||
}, | ||
timeout: 180000, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.SUCCESS); | ||
}); | ||
}) | ||
|
||
//get policy id and test id | ||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
policyId = response.body.at(0).id; | ||
testId = response.body.at(0).tests.at(0).id; | ||
cy.request({ | ||
method: METHOD.POST, | ||
url: API.ApiServer + API.Policies + policyId + "/test/" + testId + "/start", | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
}) | ||
|
||
cy.wait(90000); | ||
|
||
cy.request({ | ||
method: METHOD.GET, | ||
url: API.ApiServer + API.Policies, | ||
headers: { | ||
authorization, | ||
}, | ||
}).then((response) => { | ||
expect(response.status).to.eq(STATUS_CODE.OK); | ||
expect(response.body.at(0).tests.at(0).status).to.eq("Success"); | ||
}) | ||
}) | ||
|
||
}) | ||
}); |
Oops, something went wrong.