Adding reordering attachments tests
parent
6d0b008322
commit
073d515f7f
|
@ -6,7 +6,7 @@ var chaiAsPromised = require('chai-as-promised');
|
|||
chai.use(chaiAsPromised);
|
||||
var expect = chai.expect;
|
||||
|
||||
describe('Issue detail', async function(){
|
||||
describe.only('Issue detail', async function(){
|
||||
let issuesUrl = "";
|
||||
before(async function(){
|
||||
utils.common.goHome();
|
||||
|
|
|
@ -277,6 +277,11 @@ helper.attachment = function() {
|
|||
await browser.waitForAngular();
|
||||
},
|
||||
|
||||
getFirstAttachmentName: async function () {
|
||||
let name = await el.$$('div[tg-attachment] .attachment-comments').first().getText();
|
||||
return name;
|
||||
},
|
||||
|
||||
getLastAttachmentName: async function () {
|
||||
let name = await el.$$('div[tg-attachment] .attachment-comments').last().getText();
|
||||
return name;
|
||||
|
@ -310,6 +315,13 @@ helper.attachment = function() {
|
|||
await utils.lightbox.confirm.ok();
|
||||
await browser.waitForAngular();
|
||||
},
|
||||
|
||||
dragLastAttchmentToFirstPosition: async function() {
|
||||
await browser.actions().mouseMove(el.$$('div[tg-attachment]').last()).perform();
|
||||
let lastDraggableAttachment = el.$$('div[tg-attachment] .attachment-settings .icon-drag-v').last();
|
||||
let destination = el.$$('div[tg-attachment] .attachment-settings .icon-drag-v').first();
|
||||
await utils.common.drag(lastDraggableAttachment, destination);
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
|
|
@ -107,15 +107,18 @@ helper.attachmentTesting = async function() {
|
|||
var fileToUpload = './upload-file-test.txt',
|
||||
absolutePath = path.resolve(process.cwd(), 'e2e', fileToUpload);
|
||||
await attachmentHelper.upload(absolutePath, 'This is the testing name ' + date);
|
||||
|
||||
// Check set name
|
||||
let name = await attachmentHelper.getLastAttachmentName();
|
||||
expect(name).to.be.equal('This is the testing name ' + date);
|
||||
|
||||
// Check new length
|
||||
let newAttachmentsLength = await attachmentHelper.countAttachments();
|
||||
expect(newAttachmentsLength).to.be.equal(attachmentsLength + 1);
|
||||
|
||||
//Drag'n drop
|
||||
await attachmentHelper.dragLastAttchmentToFirstPosition();
|
||||
name = await attachmentHelper.getFirstAttachmentName();
|
||||
expect(name).to.be.equal('This is the testing name ' + date);
|
||||
|
||||
// Renaming
|
||||
await attachmentHelper.renameLastAttchment('This is the new testing name ' + date);
|
||||
name = await attachmentHelper.getLastAttachmentName();
|
||||
|
|
Loading…
Reference in New Issue