Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature add features to workspaces modify delete #1658

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
709d601
fixed migration org uuid
elraphty Apr 26, 2024
78e3470
added difference in budget
elraphty Apr 26, 2024
84b7e5e
Merge pull request #1619 from stakwork/fix/migrations_and_update_balance
elraphty Apr 27, 2024
5575277
fixed csv export bug
elraphty Apr 30, 2024
3ea8f77
Merge pull request #1623 from stakwork/fix/csv-export
elraphty Apr 30, 2024
0a3f966
Added cypress tests and objects
fvalentiner Apr 30, 2024
687a5fb
fixed workspace name not being displayed
elraphty Apr 30, 2024
4ff090d
Changed Bounty to NewBounty
elraphty Apr 30, 2024
a341797
Merge pull request #1625 from stakwork/fix/admin_bounties_organization
elraphty Apr 30, 2024
377c27f
added workspace to admin
elraphty May 1, 2024
4dac8d0
added workspace for payment and bounty metrics
elraphty May 1, 2024
fe70a56
Merge pull request #1628 from stakwork/feature-add-features-endpoints
elraphty May 1, 2024
298a07b
Added feature endpoints
AbdulWahab3181 May 2, 2024
ff72560
updated workspace for admin
elraphty May 2, 2024
3008133
Addressed changes
AbdulWahab3181 May 2, 2024
1861bf5
changes
elraphty May 2, 2024
3c8fdc1
Merge pull request #1629 from AbdulWahab3181/feature/add-feature-endp…
elraphty May 2, 2024
b8d2b1f
added assignee stats
elraphty May 3, 2024
1438e44
fixed tests
elraphty May 3, 2024
e6c08b3
Merge pull request #1627 from stakwork/feat/admin_workspace
elraphty May 3, 2024
12ee59e
Merge pull request #1630 from stakwork/feature-add-features-to-worksp…
elraphty May 3, 2024
97b8b4b
Add Endpoints for Workspace Repositories
MirzaHanan May 3, 2024
ba5ebd8
Merge branch 'master' into Add-Endpoints-for-Workspace-Repo
MirzaHanan May 3, 2024
356f165
Merge pull request #1631 from MirzaHanan/Add-Endpoints-for-Workspace-…
elraphty May 6, 2024
66008d9
fixeed payment history
elraphty May 7, 2024
fac27f3
Merge pull request #1632 from stakwork/fix/payments
elraphty May 7, 2024
bbbbe46
fixed bounty budgets addition
elraphty May 7, 2024
7d4c4e5
Merge pull request #1633 from stakwork/fix/payments
elraphty May 7, 2024
39bf36b
workspace
elraphty May 7, 2024
acae85b
Merge pull request #1634 from stakwork/fix/payments
elraphty May 7, 2024
ee9f22f
rename org
elraphty May 7, 2024
4f33ba9
Merge pull request #1635 from stakwork/fix/payments
elraphty May 7, 2024
96fb0f9
fixed deduct payment
elraphty May 9, 2024
39b6548
Merge pull request #1636 from stakwork/feat/deduct_payment
elraphty May 9, 2024
c534f73
Added Tests
fvalentiner May 10, 2024
578d5d9
Merge pull request #1641 from stakwork/feature-add-features-to-worksp…
elraphty May 12, 2024
7c11757
added paginationto feature
elraphty May 14, 2024
5d9a2cc
Merge pull request #1645 from stakwork/fix/feature_db
elraphty May 14, 2024
133800d
Added Tests
fvalentiner May 10, 2024
f745cdd
fixed merge conflicts
elraphty May 15, 2024
7a2e1df
again push due to error
MahtabBukhari May 13, 2024
6cf499d
fixed unit test errors
MahtabBukhari May 13, 2024
32a45dd
fixed unit test errors
MahtabBukhari May 13, 2024
3c7cc87
update code to fulfill requirements
MahtabBukhari May 14, 2024
d1f8428
update code logic
MahtabBukhari May 14, 2024
8f30485
change file name
MahtabBukhari May 15, 2024
50cc848
fixed merge conflicts
elraphty May 15, 2024
0ef119d
Merge pull request #1642 from MahtabBukhari/feature-add-phases
elraphty May 15, 2024
4df9d02
Merge pull request #1648 from stakwork/feature-add-phases
elraphty May 16, 2024
cb02084
Add Tests
fvalentiner May 10, 2024
b72ac7f
Change file name
fvalentiner May 10, 2024
89bc0dc
fixed conflicts
elraphty May 16, 2024
734ac40
Add User Stories to Features small changes
MirzaHanan May 15, 2024
b45748d
fixed feature cypress test
elraphty May 16, 2024
e07cb5e
deleted JS file
elraphty May 16, 2024
8a831f5
Merge pull request #1647 from stakwork/feature-add-user-stories
elraphty May 16, 2024
8cddf92
Added TDD
fvalentiner May 12, 2024
b156e19
Modify Features endpoint and add delete feature
MahtabBukhari May 16, 2024
9addf23
Added TDD
fvalentiner May 12, 2024
a79a521
resolve conflicts
MahtabBukhari May 17, 2024
b47c3f3
resolve conflicts again
MahtabBukhari May 17, 2024
7899419
resolve conflicts again
MahtabBukhari May 17, 2024
c14676c
Modify Features endpoint and add delete feature
MahtabBukhari May 19, 2024
b6ed5d1
Merge branch 'feature-add-features-to-workspaces-modify-delete' into …
MahtabBukhari May 19, 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
40 changes: 40 additions & 0 deletions cypress/e2e/02_repositories.cy.ts
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())
})
})
})
})
122 changes: 79 additions & 43 deletions cypress/e2e/03_features.cy.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { User, HostName, Workspaces, Repositories, Features } from '../support/objects/objects';
import { User, HostName, Features } from '../support/objects/objects';



describe('Create Features for Workspace', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'POST',
url: `${HostName}/features`,
headers: { 'x-jwt': `${value}` },
body: Features[i]
}).its('body').should('have.property', 'name', Features[i].name.trim())
.its('body').should('have.property', 'brief', Features[i].brief.trim())
.its('body').should('have.property', 'requirements', Features[i].requirements.trim())
.its('body').should('have.property', 'architecture', Features[i].architecture.trim())
}).its('body').then(body => {
expect(body).to.have.property('name').and.equal(Features[i].name.trim());
expect(body).to.have.property('brief').and.equal(Features[i].brief.trim());
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim());
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim());
});
}
})
})
Expand All @@ -23,7 +25,7 @@ describe('Create Features for Workspace', () => {
describe('Modify name for Feature', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'POST',
url: `${HostName}/features`,
Expand All @@ -32,10 +34,12 @@ describe('Modify name for Feature', () => {
uuid: Features[i].uuid,
name: Features[i].name + "_addtext"
}
}).its('body').should('have.property', 'name', Features[i].name.trim() + "_addtext")
.its('body').should('have.property', 'brief', Features[i].brief.trim())
.its('body').should('have.property', 'requirements', Features[i].requirements.trim())
.its('body').should('have.property', 'architecture', Features[i].architecture.trim())
}).its('body').then(body => {
expect(body).to.have.property('name').and.equal(Features[i].name.trim() + " _addtext");
expect(body).to.have.property('brief').and.equal(Features[i].brief.trim());
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim());
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim());
});
}
})
})
Expand All @@ -44,7 +48,7 @@ describe('Modify name for Feature', () => {
describe('Modify brief for Feature', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'POST',
url: `${HostName}/features`,
Expand All @@ -53,10 +57,12 @@ describe('Modify brief for Feature', () => {
uuid: Features[i].uuid,
brief: Features[i].brief + "_addtext"
}
}).its('body').should('have.property', 'name', Features[i].name.trim() + "_addtext")
.its('body').should('have.property', 'brief', Features[i].brief.trim() + "_addtext")
.its('body').should('have.property', 'requirements', Features[i].requirements.trim())
.its('body').should('have.property', 'architecture', Features[i].architecture.trim())
}).its('body').then(body => {
expect(body).to.have.property('name').and.equal(Features[i].name.trim() + " _addtext");
expect(body).to.have.property('brief').and.equal(Features[i].brief.trim() + " _addtext");
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim());
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim());
});
}
})
})
Expand All @@ -65,7 +71,7 @@ describe('Modify brief for Feature', () => {
describe('Modify requirements for Feature', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'POST',
url: `${HostName}/features`,
Expand All @@ -74,10 +80,12 @@ describe('Modify requirements for Feature', () => {
uuid: Features[i].uuid,
requirements: Features[i].requirements + "_addtext"
}
}).its('body').should('have.property', 'name', Features[i].name.trim() + "_addtext")
.its('body').should('have.property', 'brief', Features[i].brief.trim() + "_addtext")
.its('body').should('have.property', 'requirements', Features[i].requirements.trim() + "_addtext")
.its('body').should('have.property', 'architecture', Features[i].architecture.trim())
}).its('body').then(body => {
expect(body).to.have.property('name').and.equal(Features[i].name.trim() + " _addtext");
expect(body).to.have.property('brief').and.equal(Features[i].brief.trim() + " _addtext");
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim() + " _addtext");
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim());
});
}
})
})
Expand All @@ -86,7 +94,7 @@ describe('Modify requirements for Feature', () => {
describe('Modify architecture for Feature', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'POST',
url: `${HostName}/features`,
Expand All @@ -95,10 +103,12 @@ describe('Modify architecture for Feature', () => {
uuid: Features[i].uuid,
architecture: Features[i].architecture + "_addtext"
}
}).its('body').should('have.property', 'name', Features[i].name.trim() + "_addtext")
.its('body').should('have.property', 'brief', Features[i].brief.trim() + "_addtext")
.its('body').should('have.property', 'requirements', Features[i].requirements.trim() + "_addtext")
.its('body').should('have.property', 'architecture', Features[i].architecture.trim() + "_addtext")
}).its('body').then(body => {
expect(body).to.have.property('name').and.equal(Features[i].name.trim() + " _addtext");
expect(body).to.have.property('brief').and.equal(Features[i].brief.trim() + " _addtext");
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim() + " _addtext");
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim() + " _addtext");
});
}
})
})
Expand All @@ -110,37 +120,62 @@ describe('Get Features for Workspace', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
url: `${HostName}/workspaces/${Features[0].workspace_uuid}/features`, //changed from url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid, please update the routes file and any other change needed.
url: `${HostName}/workspaces/${Features[0].workspace_uuid}/features`,
headers: { 'x-jwt': `${ value }` },
body: {}
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200)
for(let i = 0; i <= 2; i++) {
expect(resp.body[i]).to.have.property('name', Features[i].name.trim() + "_addtext")
expect(resp.body[i]).to.have.property('brief', Features[i].brief.trim() + "_addtext")
expect(resp.body[i]).to.have.property('requirements', Features[i].requirements.trim() + "_addtext")
expect(resp.body[i]).to.have.property('architecture', Features[i].architecture.trim() + "_addtext")
}
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");
});
})
})
})
})

describe('Old Get Features for Workspace', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid,
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");
});
}
});
})
})
})

describe('Get Feature by uuid', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
for(let i = 0; i <= 2; i++) {
for (let i = 0; i <= 2; i++) {
cy.request({
method: 'GET',
url: `${HostName}/features/`+ Features[i].uuid,
headers: { 'x-jwt': `${ value }` },
body: {}
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200)
expect(resp.body).to.have.property('name', Features[i].name.trim() + "_addtext")
expect(resp.body).to.have.property('brief', Features[i].brief.trim() + "_addtext")
expect(resp.body).to.have.property('requirements', Features[i].requirements.trim() + "_addtext")
expect(resp.body).to.have.property('architecture', Features[i].architecture.trim() + "_addtext")
expect(resp.body).to.have.property('name', Features[i].name.trim() + " _addtext")
expect(resp.body).to.have.property('brief', Features[i].brief.trim() + " _addtext")
expect(resp.body).to.have.property('requirements', Features[i].requirements.trim() + " _addtext")
expect(resp.body).to.have.property('architecture', Features[i].architecture.trim() + " _addtext")
})
}
})
Expand All @@ -154,7 +189,7 @@ describe('Delete Feature by uuid', () => {
method: 'DELETE',
url: `${HostName}/features/${Features[0].uuid}`,
headers: { 'x-jwt': `${ value }` },
body: {}
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200)
})
Expand All @@ -166,10 +201,11 @@ describe('Check delete by uuid', () => {
it('passes', () => {
cy.upsertlogin(User).then(value => {
cy.request({
method: 'GET',
method: 'DELETE',
url: `${HostName}/features/${Features[0].uuid}`,
headers: { 'x-jwt': `${ value }` },
body: {}
body: {},
failOnStatusCode: false
}).then((resp) => {
expect(resp.status).to.eq(404);
})
Expand Down
117 changes: 117 additions & 0 deletions cypress/e2e/04_user_stories.cy.ts
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);
})
})
})
})
Loading
Loading