Skip to content

Commit

Permalink
update contracts tab and fixes for pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Celiant committed Jul 29, 2024
1 parent eec6db7 commit 63d0248
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
4 changes: 2 additions & 2 deletions e2e-tests/cypress/e2e/api-tests/contracts/getContracts.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
failOnStatusCode: false,
}).then((response) => {
expect(response.status).eql(STATUS_CODE.ERROR);
//expect(response.status).eql(STATUS_CODE.FORBIDDEN);
//expect(response.status).eql(STATUS_CODE.ERROR);
expect(response.status).eql(STATUS_CODE.UNPROCESSABLE);
});
});
});
Expand Down
40 changes: 20 additions & 20 deletions e2e-tests/cypress/e2e/api-tests/contracts/getPermissions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,39 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
contractIdW = response.body.id;
contractIdHedW = response.body.contractId;
});

cy.request({
method: METHOD.POST,
url: API.ApiServer + API.AccountsLogin,
body: {
username: username,
password: "test"
}
method: METHOD.GET,
url: API.ApiServer + API.RandomKey,
headers: {
authorization
},
}).then((response) => {
cy.wait(3000)
let hederaAccountId = response.body.id
let hederaAccountKey = response.body.key
cy.request({
method: METHOD.POST,
url: API.ApiServer + API.AccessToken,
url: API.ApiServer + API.AccountsLogin,
body: {
refreshToken: response.body.refreshToken
username: username,
password: "test"
}
}).then((response) => {
let accessToken = "Bearer " + response.body.accessToken
cy.request({
method: METHOD.GET,
url: API.ApiServer + API.RandomKey,
headers: {
authorization
},
method: METHOD.POST,
url: API.ApiServer + API.AccessToken,
body: {
refreshToken: response.body.refreshToken
}
}).then((response) => {
cy.wait(3000)
let hederaAccountId = response.body.id
let hederaAccountKey = response.body.key
let accessToken = "Bearer " + response.body.accessToken
cy.request({
method: METHOD.PUT,
url: API.ApiServer + API.Profiles + username,
body: {
parent: SRDid,
hederaAccountId: response.body.id,
hederaAccountKey: response.body.key,
hederaAccountId: hederaAccountId,
hederaAccountKey: hederaAccountKey,
useFireblocksSigning: false,
fireblocksConfig:
{
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/cypress/e2e/api-tests/contracts/getPools.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
failOnStatusCode: false,
}).then((response) => {
expect(response.status).eql(STATUS_CODE.ERROR);
expect(response.status).eql(STATUS_CODE.UNPROCESSABLE);
//expect(response.status).eql(STATUS_CODE.FORBIDDEN);
});
});
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/cypress/e2e/api-tests/contracts/getRequests.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import * as Checks from "../../../support/checkingMethods";

context("Contracts", { tags: ['contracts', 'firstPool'] },() => {
const authorization = Cypress.env("authorization");
const username = Math.floor(Math.random() * 999) + "User";
const contractNameR = Math.floor(Math.random() * 999) + "RCon4RequestsTests";
const contractNameW = Math.floor(Math.random() * 999) + "WCon4RequestsTests";
let username = Math.floor(Math.random() * 999) + "User";
let contractNameR = Math.floor(Math.random() * 999) + "RCon4RequestsTests";
let contractNameW = Math.floor(Math.random() * 999) + "WCon4RequestsTests";
const optionKey = "option"
let wContractId, rContractId, tokenId, policyId, hederaId, rConractUuid
let wContractId, rContractId, tokenId, tokenid2, policyId, hederaId, rConractUuid
let waitForApproveApplicationBlockId, deviceGridBlockId, issueRequestGridBlockId, approveRegistrantBtnBlockId

describe("Flow for one NFT token and get requests", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body).eql("14");
expect(response.body).eql(14);
});
})
});
Expand Down Expand Up @@ -349,7 +349,7 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body).eql("2");
expect(response.body).eql(2);
});
})
});
Expand Down Expand Up @@ -552,6 +552,7 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
});

it("Verify roles(wipe)", () => {
cy.wait(60000)
cy.request({
method: METHOD.POST,
url: API.ApiServer + API.AccountsLogin,
Expand All @@ -576,13 +577,14 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body).eql("0");
expect(response.body).eql(0);
});
})
});
});

it("Verify roles(retire)", () => {
cy.wait(60000)
cy.request({
method: METHOD.POST,
url: API.ApiServer + API.AccountsLogin,
Expand All @@ -607,7 +609,7 @@ context("Contracts", { tags: ['contracts', 'firstPool'] }, () => {
},
}).then((response) => {
expect(response.status).eql(STATUS_CODE.OK);
expect(response.body).eql("0");
expect(response.body).eql(0);
});
})
});
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ before(() => {
"@context": [],
},
},
timeout: 200000,
timeout: 400000,
}).then(() => {
cy.log("hedera credentials was created");
});
Expand Down

0 comments on commit 63d0248

Please sign in to comment.