gpt4 book ai didi

javascript - “clickSelector”和 'hoverSelector' 属性不适用于 backstopJS

转载 作者:行者123 更新时间:2023-12-03 07:11:26 27 4
gpt4 key购买 nike

我正在使用 Backstopjs 与 Chrome 引擎。我可以通过传递不同的 url 并使用各种属性来截取屏幕截图,但是当我尝试在截取屏幕截图之前单击按钮时,单击不起作用。

属性“clickSelector”和“hoverSelector”将被忽略,并且没有执行任何操作。

请让我知道如何使用这些属性。

以下是我的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
}

``

最佳答案

尝试将“postInteractionWait”设置为整数。这表示 BackstopJS 单击或悬停后等待多长时间。

关于javascript - “clickSelector”和 'hoverSelector' 属性不适用于 backstopJS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47873207/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com