-
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 branch 'feature-add-repos-to-workspaces-modify-delete' of https…
…://github.com/stakwork/sphinx-tribes into feature-add-repos-to-workspaces-modify-delete
- Loading branch information
Showing
19 changed files
with
1,308 additions
and
289 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,129 @@ | ||
import { uniqueId } from 'cypress/types/lodash'; | ||
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('Modify Repository name 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: { | ||
uuid: Repositories[i].uuid, | ||
name: Repositories[i].name.trim() + "_addText" | ||
} | ||
}).its('body').should('have.property', 'name', Repositories[i].name.trim() + "_addText") | ||
.its('body').should('have.property', 'url', Repositories[i].url.trim()); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify Repository url 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: { | ||
uuid: Repositories[i].uuid, | ||
url: Repositories[i].name.trim() + "_addText" | ||
} | ||
}).its('body').should('have.property', 'name', Repositories[i].name.trim() + "_addText") | ||
.its('body').should('have.property', 'url', Repositories[i].url.trim() + "_addText"); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
|
||
describe('Check Repositories Values', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 1; i++) { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/workspaces/repositories/` + Repositories[i].workspace_uuid, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
expect(resp.body[i]).to.have.property('name', Repositories[i].name.trim() + "_addText") | ||
expect(resp.body[i]).to.have.property('url', Repositories[i].url.trim() + "_addText") | ||
}) | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get repository by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for(let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/workspaces/${Repositories[i].workspace_uuid}/repository/${Repositories[i].uuid}`, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).then((resp) => { | ||
expect(resp.status).to.eq(200) | ||
expect(resp.body[i]).to.have.property('name', Repositories[i].name.trim() + "_addText") | ||
expect(resp.body[i]).to.have.property('url', Repositories[i].url.trim() + "_addText") | ||
}) | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Delete repository by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
cy.request({ | ||
method: 'DELETE', | ||
url: `${HostName}/workspaces/${Repositories[0].workspace_uuid}/repository/${Repositories[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}/workspaces/${Repositories[0].workspace_uuid}/repository/${Repositories[0].uuid}`, | ||
headers: { 'x-jwt': `${ value }` }, | ||
body: {} | ||
}).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
import { User, HostName, Workspaces, Repositories, Features } from '../support/objects/objects'; | ||
|
||
|
||
|
||
describe('Create Features for Workspace', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: Features[i] | ||
}).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()); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify name for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: Features[i].uuid, | ||
name: Features[i].name + "_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()); | ||
expect(body).to.have.property('requirements').and.equal(Features[i].requirements.trim()); | ||
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim()); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify brief for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: Features[i].uuid, | ||
brief: Features[i].brief + "_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()); | ||
expect(body).to.have.property('architecture').and.equal(Features[i].architecture.trim()); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify requirements for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: Features[i].uuid, | ||
requirements: Features[i].requirements + "_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()); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Modify architecture for Feature', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'POST', | ||
url: `${HostName}/features`, | ||
headers: { 'x-jwt': `${value}` }, | ||
body: { | ||
uuid: Features[i].uuid, | ||
architecture: Features[i].architecture + "_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"); | ||
}); | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
|
||
describe('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) | ||
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") | ||
} | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('Get Feature by uuid', () => { | ||
it('passes', () => { | ||
cy.upsertlogin(User).then(value => { | ||
for (let i = 0; i <= 2; i++) { | ||
cy.request({ | ||
method: 'GET', | ||
url: `${HostName}/features/` + Features[i].uuid, | ||
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") | ||
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") | ||
}) | ||
} | ||
}) | ||
}) | ||
}) |
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.