From c8e3f4f61477e39d278648c2e0e537940f776bdd Mon Sep 17 00:00:00 2001 From: Jonathan Bouzekri Date: Fri, 4 Aug 2017 22:22:23 +0200 Subject: [PATCH] lint --- test/e2e/specs/test.js | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/test/e2e/specs/test.js b/test/e2e/specs/test.js index 6140f71..03d4364 100644 --- a/test/e2e/specs/test.js +++ b/test/e2e/specs/test.js @@ -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() } }