-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1658 from MahtabBukhari/feature-add-features-to-w…
…orkspaces-modify-delete Feature add features to workspaces modify delete
- Loading branch information
Showing
21 changed files
with
2,422 additions
and
436 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { User, HostName, Workspaces, Repositories } from '../support/objects/objects'; | ||
|
||
|
||
describe('Create Repositories for Workspace', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 1; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/workspaces/repositories`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: Repositories[i] | ||
}).its('body').then(body => { | ||
expect(body).to.have.property('name').and.equal(Repositories[i].name.trim()); | ||
expect(body).to.have.property('url').and.equal(Repositories[i].url.trim()); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
|
||
describe('Check Repositories Values', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/workspaces/repositories/` + Repositories[0].workspace_uuid, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
expect(resp.body[0]).to.have.property('name', Repositories[0].name.trim()) | ||
expect(resp.body[0]).to.have.property('url', Repositories[0].url.trim()) | ||
expect(resp.body[1]).to.have.property('name', Repositories[1].name.trim()) | ||
expect(resp.body[1]).to.have.property('url', Repositories[1].url.trim()) | ||
}) | ||
}) | ||
}) | ||
}) |
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,117 @@ | ||
import { User, HostName, UserStories } from '../support/objects/objects'; | ||
|
||
describe('Create user stories for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 5; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features/story`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: UserStories[i] | ||
}).its('body').then(body => { | ||
expect(body).to.have.property('uuid').and.equal(UserStories[i].uuid.trim()); | ||
expect(body).to.have.property('feature_uuid').and.equal(UserStories[i].feature_uuid.trim()); | ||
expect(body).to.have.property('description').and.equal(UserStories[i].description.trim()); | ||
expect(body).to.have.property('priority').and.equal(UserStories[i].priority); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify user story description', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 5; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features/story`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: UserStories[i].uuid, | ||
description: UserStories[i].description + "_addtext" | ||
} | ||
}).its('body').then(body => { | ||
expect(body).to.have.property('uuid').and.equal(UserStories[i].uuid.trim()); | ||
expect(body).to.have.property('feature_uuid').and.equal(UserStories[i].feature_uuid.trim()); | ||
expect(body).to.have.property('description').and.equal(UserStories[i].description.trim() + " _addtext"); | ||
expect(body).to.have.property('priority').and.equal(UserStories[i].priority); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get user stories for feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/features/${UserStories[0].feature_uuid}/story`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
for (let i = 0; i <= 5; i++) { | ||
expect(resp.body[i]).to.have.property('uuid').and.equal(UserStories[i].uuid.trim()); | ||
expect(resp.body[i]).to.have.property('feature_uuid').and.equal(UserStories[i].feature_uuid.trim()); | ||
expect(resp.body[i]).to.have.property('description').and.equal(UserStories[i].description.trim() + " _addtext"); | ||
expect(resp.body[i]).to.have.property('priority').and.equal(UserStories[i].priority); | ||
} | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get story by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 5; i++) { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/features/${UserStories[0].feature_uuid}/story/${UserStories[i].uuid}`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200); | ||
expect(resp.body).to.have.property('uuid').and.equal(UserStories[i].uuid.trim()); | ||
expect(resp.body).to.have.property('feature_uuid').and.equal(UserStories[i].feature_uuid.trim()); | ||
expect(resp.body).to.have.property('description').and.equal(UserStories[i].description.trim() + " _addtext"); | ||
expect(resp.body).to.have.property('priority').and.equal(UserStories[i].priority); | ||
}); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Delete story by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'DELETE', | ||
url: `${HostName}/features/${UserStories[0].feature_uuid}/story/${UserStories[0].uuid}`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Check delete by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'DELETE', | ||
url: `${HostName}/features/${UserStories[0].feature_uuid}/story/${UserStories[0].uuid}`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: {}, | ||
failOnStatusCode: false | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(404); | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.