Skip to content

Commit

Permalink
fixed cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed May 18, 2024
1 parent 9431b0b commit 0c7d2b1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
27 changes: 26 additions & 1 deletion cypress/e2e/01_workspaces.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { User, HostName, Workspaces } from '../support/objects/objects';
import {User, HostName, Workspaces, Features} from '../support/objects/objects';


describe('Create Workspaces', () => {
Expand Down Expand Up @@ -99,3 +99,28 @@ describe('Check Workspace Values', () => {
})
})
})


describe('Get Features for Workspace', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
url: `${HostName}/workspaces/` + Features[0].workspace_uuid + `/features`,
headers: { 'x-jwt': `${value}` },
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200);
if (resp.status === 200) {
resp.body.forEach((feature) => {
const expectedFeature = Features.find(f => f.uuid === feature.uuid);
expect(feature).to.have.property('name', expectedFeature.name.trim() + " _addtext");
expect(feature).to.have.property('brief', expectedFeature.brief.trim() + " _addtext");
expect(feature).to.have.property('requirements', expectedFeature.requirements.trim() + " _addtext");
expect(feature).to.have.property('architecture', expectedFeature.architecture.trim() + " _addtext");
});
}
});
})
})
})
22 changes: 0 additions & 22 deletions cypress/e2e/03_features.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,6 @@ describe('Modify architecture for Feature', () => {
})


describe('Get Features for Workspace', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
url: `${HostName}/workspaces/` + Features[0].workspace_uuid + `/features`,
headers: { 'x-jwt': `${value}` },
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200);
const body = resp.body.reverse();
for (let i = 0; i <= 2; i++) {
expect(body[i]).to.have.property('name', Features[i].name.trim() + " _addtext")
expect(body[i]).to.have.property('brief', Features[i].brief.trim() + " _addtext")
expect(body[i]).to.have.property('requirements', Features[i].requirements.trim() + " _addtext")
expect(body[i]).to.have.property('architecture', Features[i].architecture.trim() + " _addtext")
}
});
})
})
})

describe('Get Feature by uuid', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
Expand Down

0 comments on commit 0c7d2b1

Please sign in to comment.