Enhancement #4339: Add e2e tests
parent
0db876c82a
commit
1fe663fb52
|
@ -17,10 +17,17 @@ helper.links = function() {
|
|||
return newLink;
|
||||
},
|
||||
|
||||
get: function() {
|
||||
get: function(index) {
|
||||
if(index !== null && index !== undefined)
|
||||
return el.$$(".wiki-link a.link-title").get(index)
|
||||
return el.$$(".wiki-link a.link-title");
|
||||
},
|
||||
|
||||
getNameOf: async function(index) {
|
||||
let item = await obj.get(index)
|
||||
return item.getText()
|
||||
},
|
||||
|
||||
deleteLink: async function(link){
|
||||
link.click();
|
||||
await utils.lightbox.confirm.ok();
|
||||
|
@ -32,6 +39,12 @@ helper.links = function() {
|
|||
return obj;
|
||||
};
|
||||
|
||||
helper.dragAndDropLinks = async function(indexFrom, indexTo) {
|
||||
let selectedLink = helper.links().get(indexFrom);
|
||||
let newPosition = helper.links().get(indexTo);
|
||||
return utils.common.drag(selectedLink, newPosition);
|
||||
};
|
||||
|
||||
helper.editor = function(){
|
||||
let el = $('.main.wiki');
|
||||
|
||||
|
|
|
@ -20,6 +20,17 @@ describe('wiki', function() {
|
|||
await utils.common.takeScreenshot("wiki", "empty");
|
||||
});
|
||||
|
||||
it("drag & drop links", async function() {
|
||||
let nameOld = await wikiHelper.links().getNameOf(0);
|
||||
|
||||
await wikiHelper.dragAndDropLinks(0, 1);
|
||||
|
||||
let nameNew = await wikiHelper.links().getNameOf(4);
|
||||
|
||||
expect(nameNew).to.be.equal(nameOld);
|
||||
|
||||
});
|
||||
|
||||
it('add link', async function(){
|
||||
let timestamp = new Date().getTime();
|
||||
currentWiki.slug = "test-link" + timestamp;
|
||||
|
|
Loading…
Reference in New Issue