Angularjs 如何使用量角器E2E测试执行向下/向上滚动

Angularjs 如何使用量角器E2E测试执行向下/向上滚动,angularjs,protractor,Angularjs,Protractor,我不熟悉量角器e2e测试。我需要使用量角器在地图上滚动并选择地图上的任何位置。我没有找到任何方式自动执行网上地图滚动部分,所以我在这个论坛上问它 <map-edit-panel poi-icons="inactive" zoombarrier="16.5" class="full-map-image" mode="location" show-editor="true" filter="NVT_LINK" show-zoom="true" id="mapContainer"><

我不熟悉量角器e2e测试。我需要使用量角器在地图上滚动并选择地图上的任何位置。我没有找到任何方式自动执行网上地图滚动部分,所以我在这个论坛上问它

<map-edit-panel poi-icons="inactive" zoombarrier="16.5" class="full-map-image" mode="location" show-editor="true" filter="NVT_LINK" show-zoom="true" id="mapContainer"><!-- ngIf: showZoom --><div ng-if="showZoom" class="map-ui-right-center ng-scope">
<div ng-click="geoLocate()" class="map-ui-zoom-control map-ui-geolocate"></div>
<div ng-click="zoomIn()" class="map-ui-zoom-control map-ui-zoom-control-up"></div>
<div ng-click="zoomOut()" class="map-ui-zoom-control map-ui-zoom-control-down"></div>

这是地图部分的代码,我需要执行自动向上/向下滚动。请分享你的宝贵意见

1)向上滚动

2) 向下滚动

 browser.executeScript('window.scrollTo(0,10000);').then(function () {
                console.log('++++++SCROLLED Down+++++');
            });
3) 滚动到特定的WebElement

var we =GUtils.$element(GUtils.$locatorXpath('xpath'));
            browser.executeScript("arguments[0].scrollIntoView();", we.getWebElement()).then(function(){
               we.click();
            });
1) 向上滚动

2) 向下滚动

 browser.executeScript('window.scrollTo(0,10000);').then(function () {
                console.log('++++++SCROLLED Down+++++');
            });
3) 滚动到特定的WebElement

var we =GUtils.$element(GUtils.$locatorXpath('xpath'));
            browser.executeScript("arguments[0].scrollIntoView();", we.getWebElement()).then(function(){
               we.click();
            });

你说的是将地图元素滚动到视图中,还是从地图内部滚动?你说的是将地图元素滚动到视图中,还是从地图内部滚动?works-我修改为使用。。。等待browser.executeScript('window.scrollTo(0,0)');作品-我修改为使用。。。等待browser.executeScript('window.scrollTo(0,0)');