简体   繁体   English

'clickSelector'和'hoverSelector'属性不适用于backstopJS

[英]'clickSelector' and 'hoverSelector' attributes are not working for backstopJS

I am using Backstopjs with chrome engine. 我在Chrome引擎上使用Backstopjs I am able to take screenshot by passing different urls's and using various attributes but when I am trying to click a button before taking screenshots, the click is not working. 我可以通过传递不同的URL并使用各种属性来获取屏幕截图,但是当我尝试在获取屏幕截图之前单击一个按钮时,单击不起作用。

The attributes 'clickSelector' and 'hoverSelector' are getting ignored and no action is getting performed. 属性“ clickSelector”和“ hoverSelector”将被忽略,并且不执行任何操作。

Please let me know how to use these attributes. 请让我知道如何使用这些属性。

Below is my backstop.json file where i am opening google.com and trying to click on 'I am feeling lucky' before taking screenshot : 以下是我的backstop.json文件,我在其中打开google.com并尝试在获取屏幕快照之前单击“我感到幸运”:

`` ``

 {
  "id": "backstop_default",
  "viewports": [
    {
      "label": "iPad",
      "width": 1024,
      "height": 768
    }
  ],
  "onBeforeScript": "chromy/onBefore.js",
  "onReadyScript": "chromy/onReady.js",
  "scenarios": [
    {
      "label": "Google",
      "url": "https://www.google.co.in",
      "referenceUrl": "https://www.google.co.in",
      "readyEvent": "",
      "readySelector": "",
      "delay": 0,
      "hideSelectors": [],
      "clickSelector": "input[name='btnI']",
      "hoverSelector": "input[name='btnI']",
      "removeSelectors": [],
      "postInteractionWait": "",
      "selectors": ["viewport"],
      "selectorExpansion": true,
      "misMatchThreshold" : 0.1,
      "requireSameDimensions": true
    }
  ],
  "paths": {
    "bitmaps_reference": "backstop_data/bitmaps_reference",
    "bitmaps_test": "backstop_data/bitmaps_test",
    "engine_scripts": "backstop_data/engine_scripts",
    "html_report": "backstop_data/html_report",
    "ci_report": "backstop_data/ci_report"
  },
  "report": ["browser"],
  "engine": "chrome",
  "engineFlags": [],
  "engineOptions": {
  "waitTimeout": 120000,
  "chromePath": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
  "chromeFlags": "['--disable-gpu', '--force-device-scale-factor=1']"
},
  "asyncCaptureLimit": 2,
  "asyncCompareLimit": 50,
  "debug": false,
  "debugWindow": true
} 

`` ``

Trying setting "postInteractionWait" to an integer. 尝试将“ postInteractionWait”设置为整数。 This indicates how long to wait after BackstopJS clicks or hovers. 这表示BackstopJS单击或悬停后要等待多长时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM