Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouzekri committed Aug 4, 2017
1 parent 95726f3 commit c8e3f4f
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions test/e2e/specs/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,33 @@ module.exports = {
.resizeWindow(1280, 800)
.url(devServer)
.waitForElementVisible('.vue-map-container .gm-style', 8000)
.execute((selector) => {
let rect = document.querySelector(selector).getBoundingClientRect()
let centerY = rect.bottom - rect.top
let centerX = rect.right - rect.left
.execute(() => {
let rect = document.querySelector('.vue-map').getBoundingClientRect()
let centerY = rect.bottom - rect.top
let centerX = rect.right - rect.left

let divX = document.createElement("div");
divX.style.visibility = 'hidden';
divX.id = 'offsetX';
divX.innerHTML = centerX.toString();
let divY = document.createElement("div");
divY.style.visibility = 'hidden';
divY.innerHTML = centerY.toString();
divY.id = 'offsetY';
document.head.appendChild(divX);
document.head.appendChild(divY);
},
['.vue-map']
)
let divX = document.createElement('div')
divX.style.visibility = 'hidden'
divX.id = 'offsetX'
divX.innerHTML = centerX.toString()
let divY = document.createElement('div')
divY.style.visibility = 'hidden'
divY.innerHTML = centerY.toString()
divY.id = 'offsetY'
document.head.appendChild(divX)
document.head.appendChild(divY)
})
browser.pause(3000)
browser.waitForElementPresent('#offsetX', 3000)
let relX = browser.getValue('#offsetX')
let relY = browser.getValue('#offsetY')
browser.moveToElement('.vue-map', relX, relY).mouseButtonClick()
browser.pause(10000)
browser.pause(3000)
browser
.assert.containsText('.card .card-item:nth-child(1) strong', '48.86031047029195')
.assert.containsText('.card .card-item:nth-child(2) strong', '2.3455810546875')
.assert.containsText('.card .card-item:nth-child(3) strong', '36 Rue des Bourdonnais, 75001 Paris, France')
.assert.elementPresent('main')
.end()
}
}

0 comments on commit c8e3f4f

Please sign in to comment.