-
Notifications
You must be signed in to change notification settings - Fork 62
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 #1642 from MahtabBukhari/feature-add-phases
Add Phases to Features
- Loading branch information
Showing
13 changed files
with
712 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import { User, HostName, UserStories, Phases } from '../support/objects/objects'; | ||
|
||
describe('Create Phases for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features/phase`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: Phases[i] | ||
}).its('body').then(body => { | ||
expect(body).to.have.property('uuid').and.equal(Phases[i].uuid.trim()); | ||
expect(body).to.have.property('feature_uuid').and.equal(Phases[i].feature_uuid.trim()); | ||
expect(body).to.have.property('name').and.equal(Phases[i].name.trim()); | ||
expect(body).to.have.property('priority').and.equal(Phases[i].priority); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify phases name', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features/phase`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: Phases[i].uuid, | ||
name: Phases[i].name + "_addtext" | ||
} | ||
}).its('body').then(body => { | ||
expect(body).to.have.property('uuid').and.equal(Phases[i].uuid.trim()); | ||
expect(body).to.have.property('feature_uuid').and.equal(Phases[i].feature_uuid.trim()); | ||
expect(body).to.have.property('name').and.equal(Phases[i].name.trim() + " _addtext"); | ||
expect(body).to.have.property('priority').and.equal(Phases[i].priority); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get phases for feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/features/${Phases[0].feature_uuid}/phase`, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
|
||
resp.body.forEach((phase, index) => { | ||
// Directly use index to compare with the expected phase in the same order | ||
const expectedPhase = Phases[index]; | ||
expect(phase.uuid).to.equal(expectedPhase.uuid.trim()); | ||
expect(phase.feature_uuid).to.equal(expectedPhase.feature_uuid.trim()); | ||
expect(phase.name).to.equal(expectedPhase.name.trim() + " _addtext"); | ||
expect(phase.priority).to.equal(expectedPhase.priority); | ||
}); | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get phase by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/features/${Phases[0].feature_uuid}/phase/${Phases[i].uuid}`, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
expect(resp.body).to.have.property('uuid').and.equal(Phases[i].uuid.trim()); | ||
expect(resp.body).to.have.property('feature_uuid').and.equal(Phases[i].feature_uuid.trim()); | ||
expect(resp.body).to.have.property('name').and.equal(Phases[i].name.trim() + " _addtext"); | ||
expect(resp.body).to.have.property('priority').and.equal(Phases[i].priority); | ||
}) | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Delete phase by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'DELETE', | ||
url: `${HostName}/features/${Phases[0].feature_uuid}/phase/${Phases[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: 'GET', | ||
url: `${HostName}/features/${Phases[0].feature_uuid}/phase/${Phases[0].uuid}`, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {}, | ||
failOnStatusCode: false | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(404); | ||
}) | ||
}) | ||
}) | ||
}) |
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
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
Oops, something went wrong.