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 user stories #1647

Merged
merged 6 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 19 additions & 18 deletions cypress/e2e/03_features.cy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
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`,
Expand All @@ -25,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 @@ -48,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 @@ -71,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 @@ -94,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 @@ -121,30 +121,31 @@ describe('Get Features for Workspace', () => {
cy.request({
method: 'GET',
url: `${HostName}/features/forworkspace/` + Features[0].workspace_uuid,
headers: { 'x-jwt': `${ value }` },
body: {}
headers: { 'x-jwt': `${value}` },
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")
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 => {
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: {}
headers: { 'x-jwt': `${value}` },
body: {}
}).then((resp) => {
expect(resp.status).to.eq(200)
expect(resp.body).to.have.property('name', Features[i].name.trim() + " _addtext")
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);
})
})
})
})
File renamed without changes.
116 changes: 0 additions & 116 deletions cypress/e2e/06_phases.cy.js

This file was deleted.

12 changes: 6 additions & 6 deletions cypress/support/objects/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ export const Features = [
];

export const UserStories = [
{ uuid: 'com1lh0n1e49ug76noig', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {make providers \"hive ready\"}, so I can {leverage the hive process ' },
{ uuid: 'com1lk8n1e49uqfe3l40', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {CRUD Features}, so I can {use the system to manage my features} ' },
{ uuid: 'com1ln8n1e49v4159gug', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {follow best practices}, so I can {make more valuable features} ' },
{ uuid: 'com1lqgn1e49vevhs9k0', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {save the architecture of the feature}, so I can {share it with people} ' },
{ uuid: 'com1lt8n1e49voquoq90', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {create phases}, so I can {divide the work in several deliverable stages} ' },
{ uuid: 'com1m08n1e4a02r6j0pg', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {assign bounties to features}, so I can {group bounties together} ' },
{ uuid: 'com1lh0n1e49ug76noig', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {make providers \"hive ready\"}, so I can {leverage the hive process ', priority: 0 },
{ uuid: 'com1lk8n1e49uqfe3l40', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {CRUD Features}, so I can {use the system to manage my features} ', priority: 1 },
{ uuid: 'com1ln8n1e49v4159gug', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {follow best practices}, so I can {make more valuable features} ', priority: 2 },
{ uuid: 'com1lqgn1e49vevhs9k0', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {save the architecture of the feature}, so I can {share it with people} ', priority: 3 },
{ uuid: 'com1lt8n1e49voquoq90', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {create phases}, so I can {divide the work in several deliverable stages} ', priority: 4 },
{ uuid: 'com1m08n1e4a02r6j0pg', feature_uuid: 'com1kson1e49th88dbg0', description: ' As a {PM} I want to {assign bounties to features}, so I can {group bounties together} ', priority: 5 },
];

export const Phases = [
Expand Down
1 change: 1 addition & 0 deletions db/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func InitDB() {
db.AutoMigrate(&WorkspaceRepositories{})
db.AutoMigrate(&WorkspaceFeatures{})
db.AutoMigrate(&FeaturePhase{})
db.AutoMigrate(&FeatureStory{})

DB.MigrateTablesWithOrgUuid()
DB.MigrateOrganizationToWorkspace()
Expand Down
Loading
Loading