Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
62d4076
fixes for tests
Celiant Jul 23, 2024
24e7ba7
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 23, 2024
f485833
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 24, 2024
bb6b49f
fixing and updating cotracts tests
Celiant Jul 25, 2024
eec6db7
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 25, 2024
63d0248
update contracts tab and fixes for pipeline
Celiant Jul 29, 2024
090cb46
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 29, 2024
79f24b6
update account register
Celiant Jul 29, 2024
277c456
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 30, 2024
b34970d
Merge branch 'develop' into tmp-e2e-tests
Celiant Jul 31, 2024
860e981
fixes for contracts tests
Celiant Aug 6, 2024
db5119d
Merge branch 'develop' into tmp-e2e-tests
Celiant Aug 6, 2024
2cccc20
Merge branch 'develop' into tmp-e2e-tests
Celiant Aug 12, 2024
89a77c2
Merge branch 'develop' into tmp-e2e-tests
Celiant Aug 14, 2024
e982083
test fixes
Celiant Aug 16, 2024
5c9757b
Merge branch 'develop' into tmp-e2e-tests
Celiant Aug 26, 2024
d00f222
[skip ci] Add swagger.yaml
envision-ci-agent Aug 26, 2024
ac34b07
Merge branch 'develop' into tmp-e2e-tests
Celiant Aug 29, 2024
f4798c4
Merge branch 'tmp-e2e-tests' of https://github.com/hashgraph/guardian…
Celiant Aug 29, 2024
99f677a
[skip ci] Add swagger.yaml
envision-ci-agent Aug 29, 2024
bb828e7
Merge branch 'develop' into tmp-e2e-tests
Celiant Sep 16, 2024
eb98497
update auth
Celiant Sep 17, 2024
3305695
Merge branch 'develop' into tmp-e2e-tests
Celiant Oct 1, 2024
a251586
tests update
Celiant Oct 24, 2024
5f97da4
Merge branch 'develop' into tmp-e2e-tests
Celiant Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions e2e-tests/cypress.env.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IlN0YW5kYXJkUmVnaXN0cnkiLCJkaWQiOiJkaWQ6aGVkZXJhOnRlc3RuZXQ6REpkb0FmUmd5em1ScGROY0ZOSDZQcUhQWFd3Nk5QVFhEOVRDa2NicW5qZTNfMC4wLjM5NDM1ODMiLCJyb2xlIjoiU1RBTkRBUkRfUkVHSVNUUlkiLCJpYXQiOjE2ODAwODg4MDN9.qv3sb9rtrowdQqObk8Co15erlkrXFAePvef1DeyTjmc",
"root_user": "StandardRegistry",
"SRUser": "SR",
"SR2User": "SR2",
"SR3User": "SR3",
"User": "User",
"Password": "test",
"irec_policy": "1707125414.999819805",
"module_for_import": "1707905514.867260472",
"module_for_import": "1727267276.509160001",
"schema_for_import": "1707910154.293808812",
"policy_with_artifacts": "1708013588.393490003",
"policy_with_artifacts": "1727779585.782578888",
"policy_for_compare1": "1707126227.976010003",
"policy_for_compare2": "1707126709.066208559",
"tool_for_compare1": "1710748691.708383003",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schema", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Export schema file", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
let schemaId = response.body[0].id;

cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas + schemaId + "/export/file",
encoding: null,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).to.eq(STATUS_CODE.OK);
expect(response.body).to.not.be.oneOf([null, ""]);
let schema = Cypress.Blob.arrayBufferToBinaryString(
response.body
);
cy.writeFile(
"cypress/fixtures/exportedSchema.schema",
schema,
"binary"
);
});
});
})
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schema", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Export schema message", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
let schemaId = response.body[0].id;

cy.request({
method: METHOD.GET,
url:
API.ApiServer +
API.Schemas +
schemaId +
"/export/message",
encoding: null,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).to.eq(STATUS_CODE.OK);
});
});
})
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Push create new schema", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
const topicUid = response.body[0].topicId;
cy.request({
method: METHOD.POST,
url:
API.ApiServer +
API.Schemas +
"push/" +
topicUid,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).to.eq(STATUS_CODE.ACCEPTED);
});
});
});
})
});
33 changes: 33 additions & 0 deletions e2e-tests/cypress/e2e/DR-test/011_schemas/getSchemaEntity.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Find the schema using the schema type", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
const items = [
"STANDARD_REGISTRY",
"USER",
"POLICY",
"MINT_TOKEN",
"WIPE_TOKEN",
"MINT_NFTOKEN",
];
let randomItem = items[Math.floor(Math.random() * items.length)];
cy.request({
method: METHOD.GET,
url:
API.ApiServer +
API.SchemasSystemEntity +
randomItem,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
});
})
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Get all schemas by topicId", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
const topicUid = response.body[0].topicId;
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas + topicUid,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body[0]).to.have.property("id");
expect(response.body[0]).to.have.property("topicId", topicUid);
});
});
})
});
});
19 changes: 19 additions & 0 deletions e2e-tests/cypress/e2e/DR-test/011_schemas/getSchemaType.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Get the schema using the json document type", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.SchemasType,
headers: { authorization, type: "array" },
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
});
})
});
});
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const authorization = Cypress.env("authorization");
const SRUsername = Cypress.env('SRUser');

it("Get all schemas by topicId", () => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
const topicUid = response.body[0].topicId;
it("Get all schemas", { tags: ['smoke'] }, () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas + topicUid,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body[0]).to.have.property("id");
expect(response.body[0]).to.have.property("topicId", topicUid);
expect(response.body[0]).to.have.property("topicId");
});
});
})
});
});
33 changes: 33 additions & 0 deletions e2e-tests/cypress/e2e/DR-test/011_schemas/getSimpleSchema.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Get schema by schema ID", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
let schemaId = response.body[0].id;

cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schema + schemaId,
encoding: null,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).to.eq(STATUS_CODE.OK);
});
});
});
})
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

it("Get all system schemas by username", () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.SchemasSystem + SRUsername,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body[0]).to.have.property("uuid");
});
});
})
});
82 changes: 82 additions & 0 deletions e2e-tests/cypress/e2e/DR-test/011_schemas/postImportFile.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { METHOD, STATUS_CODE } from "../../../support/api/api-const";
import API from "../../../support/ApiUrls";
import * as Authorization from "../../../support/authorization";

context("Schemas", { tags: ['schema', 'thirdPool'] }, () => {
const SRUsername = Cypress.env('SRUser');

before(() => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
let schemaId = response.body[0].id;
cy.request({
method: METHOD.GET,
url:
API.ApiServer +
API.Schemas +
schemaId +
"/export/file",
encoding: null,
headers: {
authorization,
},
}).then((response) => {
expect(response.status).to.eq(STATUS_CODE.OK);
expect(response.body).to.not.be.oneOf([null, ""]);
let schema = Cypress.Blob.arrayBufferToBinaryString(
response.body
);
cy.writeFile(
"cypress/fixtures/exportedSchema.schema",
schema,
"binary"
);

});
});
})
});

it("Import new schema from a file", { tags: ['smoke'] }, () => {
Authorization.getAccessToken(SRUsername).then((authorization) => {
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.Schemas,
headers: {
authorization,
},
}).then((response) => {
const topicUid = response.body[0].topicId;

cy.fixture("exportedSchema.schema", "binary")
.then((binary) => Cypress.Blob.binaryStringToBlob(binary))
.then((file) => {
cy.request({
method: METHOD.POST,
url:
API.ApiServer +
API.Schemas +
topicUid +
"/import/file",
body: file,
headers: {
"content-type": "binary/octet-stream",
authorization,
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.SUCCESS);
expect(response.body).to.not.be.oneOf([null, ""]);
});
});
});
})
});

});
Loading