Fixing e2e tests for firefox
parent
bde2c2c850
commit
c1dd703d9f
52
conf.e2e.js
52
conf.e2e.js
|
@ -43,6 +43,58 @@ exports.config = {
|
|||
team: "e2e/full/team.e2e.js"
|
||||
},
|
||||
onPrepare: function() {
|
||||
// track mouse movements
|
||||
var trackMouse = function() {
|
||||
angular.module('trackMouse', []).run(function($document) {
|
||||
|
||||
function addDot(ev) {
|
||||
var color = 'black',
|
||||
size = 6;
|
||||
|
||||
switch (ev.type) {
|
||||
case 'click':
|
||||
color = 'red';
|
||||
break;
|
||||
case 'dblclick':
|
||||
color = 'blue';
|
||||
break;
|
||||
case 'mousemove':
|
||||
color = 'green';
|
||||
break;
|
||||
}
|
||||
|
||||
var dotEl = $('<div></div>')
|
||||
.css({
|
||||
position: 'fixed',
|
||||
height: size + 'px',
|
||||
width: size + 'px',
|
||||
'background-color': color,
|
||||
top: ev.clientY,
|
||||
left: ev.clientX,
|
||||
|
||||
'z-index': 9999,
|
||||
|
||||
// make sure this dot won't interfere with the mouse events of other elements
|
||||
'pointer-events': 'none'
|
||||
})
|
||||
.appendTo('body');
|
||||
|
||||
setTimeout(function() {
|
||||
dotEl.remove();
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
$document.on({
|
||||
click: addDot,
|
||||
dblclick: addDot,
|
||||
mousemove: addDot
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
browser.addMockModule('trackMouse', trackMouse);
|
||||
|
||||
require('./e2e/capabilities.js');
|
||||
|
||||
browser.driver.manage().window().maximize();
|
||||
|
|
|
@ -575,9 +575,9 @@ describe('backlog', function() {
|
|||
}
|
||||
|
||||
async function dragClosedUsToMilestone() {
|
||||
await backlogHelper.setUsStatus(0, 5);
|
||||
await backlogHelper.setUsStatus(2, 5);
|
||||
|
||||
let dragElement = backlogHelper.userStories().get(0);
|
||||
let dragElement = backlogHelper.userStories().get(2);
|
||||
let dragElementHandler = dragElement.$('.icon-drag-v');
|
||||
|
||||
let sprint = backlogHelper.sprints().last();
|
||||
|
|
|
@ -13,7 +13,7 @@ describe('taskboard', function() {
|
|||
before(async function() {
|
||||
await utils.nav
|
||||
.init()
|
||||
.project('Project Example 0')
|
||||
.project('Project Example 1')
|
||||
.backlog()
|
||||
.taskboard(0)
|
||||
.go();
|
||||
|
|
|
@ -83,7 +83,7 @@ describe('Public', async function(){
|
|||
});
|
||||
|
||||
it('task detail', function() {
|
||||
browser.get(browser.params.glob.host + 'project/project-3/backlog');
|
||||
browser.get(browser.params.glob.host + 'project/project-1/backlog');
|
||||
|
||||
utils.nav
|
||||
.init()
|
||||
|
|
|
@ -56,6 +56,20 @@ common.link = async function(el) {
|
|||
.mouseMove(el)
|
||||
.perform();
|
||||
|
||||
// Ugly hack for firefox:
|
||||
// In firefox if we have a href split in two lines the point where the cursor
|
||||
// is located is just in the middle of the two lines and the hover events
|
||||
// aren't fired (we need them for the tg-nav calculation). Moving the cursor
|
||||
// "a little bit" tries to ensure the href text is really hovered and the
|
||||
// events are fired
|
||||
browser.actions()
|
||||
.mouseMove({x: -10, y: -10})
|
||||
.perform();
|
||||
|
||||
browser.actions()
|
||||
.mouseMove({x: 10, y: 10})
|
||||
.perform();
|
||||
|
||||
await browser.wait(async function() {
|
||||
let href = await el.getAttribute('href');
|
||||
return href.length > 1 && href !== browser.params.glob.host + "#";
|
||||
|
@ -69,9 +83,8 @@ common.link = async function(el) {
|
|||
|
||||
return browser.wait(async function() {
|
||||
let newUrl = await browser.getCurrentUrl();
|
||||
|
||||
return oldUrl !== newUrl;
|
||||
}, 5000);
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
common.waitLoader = function () {
|
||||
|
@ -401,9 +414,9 @@ common.uploadImagePath = function() {
|
|||
};
|
||||
|
||||
common.closeJoyride = function() {
|
||||
browser.waitForAngular();
|
||||
$('.introjs-skipbutton').isPresent().then((present) => {
|
||||
if (present) {
|
||||
browser.waitForAngular();
|
||||
$('.introjs-skipbutton').click();
|
||||
browser.sleep(600);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue