Adding common utils for accessing first project, backlog, taskboard, task, issue and userstory
parent
e575f23d06
commit
1f0b7d510e
|
@ -6,10 +6,14 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe('Issue detail', function(){
|
describe('Issue detail', async function(){
|
||||||
|
let issuesUrl = "";
|
||||||
before(async function(){
|
before(async function(){
|
||||||
browser.get('http://localhost:9001/project/project-2/issue/95');
|
utils.common.goHome();
|
||||||
await utils.common.waitLoader();
|
utils.common.goToFirstProject();
|
||||||
|
utils.common.goToIssues();
|
||||||
|
issuesUrl = await browser.getCurrentUrl();
|
||||||
|
utils.common.goToFirstIssue();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
@ -27,4 +31,11 @@ describe('Issue detail', function(){
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("issues", "detail updated");
|
await utils.common.takeScreenshot("issues", "detail updated");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('delete', utils.detail.deleteTesting);
|
||||||
|
|
||||||
|
it('redirected', async function (){
|
||||||
|
let url = await browser.getCurrentUrl();
|
||||||
|
expect(url.endsWith(issuesUrl)).to.be.true;
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,9 +7,14 @@ chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe('Task detail', function(){
|
describe('Task detail', function(){
|
||||||
|
let sprintUrl = "";
|
||||||
before(async function(){
|
before(async function(){
|
||||||
browser.get('http://localhost:9001/project/project-2/task/4');
|
utils.common.goHome();
|
||||||
await utils.common.waitLoader();
|
utils.common.goToFirstProject();
|
||||||
|
utils.common.goToBacklog();
|
||||||
|
utils.common.goToFirstSprint();
|
||||||
|
sprintUrl = await browser.getCurrentUrl();
|
||||||
|
utils.common.goToFirstTask();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
@ -27,4 +32,11 @@ describe('Task detail', function(){
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("tasks", "detail updated");
|
await utils.common.takeScreenshot("tasks", "detail updated");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('delete', utils.detail.deleteTesting);
|
||||||
|
|
||||||
|
it('redirected', async function (){
|
||||||
|
let url = await browser.getCurrentUrl();
|
||||||
|
expect(url.endsWith(sprintUrl)).to.be.true;
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,10 +6,14 @@ var chaiAsPromised = require('chai-as-promised');
|
||||||
chai.use(chaiAsPromised);
|
chai.use(chaiAsPromised);
|
||||||
var expect = chai.expect;
|
var expect = chai.expect;
|
||||||
|
|
||||||
describe('USer story detail', function(){
|
describe('User story detail', function(){
|
||||||
|
let backlogUrl = "";
|
||||||
before(async function(){
|
before(async function(){
|
||||||
browser.get('http://localhost:9001/project/project-2/us/65');
|
utils.common.goHome();
|
||||||
await utils.common.waitLoader();
|
utils.common.goToFirstProject();
|
||||||
|
utils.common.goToBacklog();
|
||||||
|
backlogUrl = await browser.getCurrentUrl();
|
||||||
|
utils.common.goToFirstUserStory();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
|
@ -27,4 +31,11 @@ describe('USer story detail', function(){
|
||||||
it('screenshot', async function() {
|
it('screenshot', async function() {
|
||||||
await utils.common.takeScreenshot("user-stories", "detail updated");
|
await utils.common.takeScreenshot("user-stories", "detail updated");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('delete', utils.detail.deleteTesting);
|
||||||
|
|
||||||
|
it('redirected', async function (){
|
||||||
|
let url = await browser.getCurrentUrl();
|
||||||
|
expect(url.endsWith(backlogUrl+"?no-milestone=1")).to.be.true;
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
|
@ -132,3 +132,17 @@ helper.assignToLightbox = function() {
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
helper.delete = function() {
|
||||||
|
let el = $('tg-delete-button');
|
||||||
|
|
||||||
|
let obj = {
|
||||||
|
el:el,
|
||||||
|
delete: async function(){
|
||||||
|
el.$('.button-red').click();
|
||||||
|
await utils.lightbox.confirm.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
|
@ -197,3 +197,44 @@ common.clear = function(elem, length) {
|
||||||
|
|
||||||
return elem.sendKeys(backspaceSeries);
|
return elem.sendKeys(backspaceSeries);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
common.goHome = async function() {
|
||||||
|
browser.get('http://localhost:9001');
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
};
|
||||||
|
|
||||||
|
common.goToFirstProject = async function() {
|
||||||
|
browser.actions().mouseMove($('div[tg-dropdown-project-list]')).perform();
|
||||||
|
$$('div[tg-dropdown-project-list] li a').first().click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
};
|
||||||
|
|
||||||
|
common.goToIssues = async function() {
|
||||||
|
$('#nav-issues').click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
};
|
||||||
|
|
||||||
|
common.goToFirstIssue = async function() {
|
||||||
|
$$('section.issues-table .row.table-main .subject a').first().click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
};
|
||||||
|
|
||||||
|
common.goToBacklog = async function() {
|
||||||
|
$('#nav-backlog').click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
}
|
||||||
|
|
||||||
|
common.goToFirstUserStory = async function() {
|
||||||
|
$$('.user-story-name>a').first().click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
}
|
||||||
|
|
||||||
|
common.goToFirstSprint = async function() {
|
||||||
|
$$('div[tg-backlog-sprint] a.button-gray').first().click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
}
|
||||||
|
|
||||||
|
common.goToFirstTask = async function() {
|
||||||
|
$$('div[tg-taskboard-task] a.task-name').first().click();
|
||||||
|
await utils.common.waitLoader();
|
||||||
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ helper.descriptionTesting = async function() {
|
||||||
helper.assignedToTesting = async function() {
|
helper.assignedToTesting = async function() {
|
||||||
let assignedTo = detailHelper.assignedTo();
|
let assignedTo = detailHelper.assignedTo();
|
||||||
let assignToLightbox = detailHelper.assignToLightbox();
|
let assignToLightbox = detailHelper.assignToLightbox();
|
||||||
|
|
||||||
let userName = detailHelper.assignedTo().getUserName();
|
let userName = detailHelper.assignedTo().getUserName();
|
||||||
await assignedTo.clear();
|
await assignedTo.clear();
|
||||||
assignedTo.assign();
|
assignedTo.assign();
|
||||||
|
@ -54,3 +53,8 @@ helper.assignedToTesting = async function() {
|
||||||
let newUserName = assignedTo.getUserName();
|
let newUserName = assignedTo.getUserName();
|
||||||
expect(newUserName).to.be.not.equal(userName);
|
expect(newUserName).to.be.not.equal(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helper.deleteTesting = async function() {
|
||||||
|
let deleteHelper = detailHelper.delete();
|
||||||
|
await deleteHelper.delete();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue