Closed Kenith closed 6 years ago
@kenith asyncCaptureLimit is only for chrome engine. Capture is synchronous with phantom option. This is as designed.
@garris Really appreciate for the help. I tried, but seems Capture is not working either. The config is as bellow.
Would you please explain more about the how to use the Capture?
Also, I found an same question raised on Jul 19, 2016: https://github.com/garris/BackstopJS/issues/224
Note: Sorry to tell you that we use the phantomjs as our engine, because the engine - chrome (v62) is not stable in Linux (Centos7), sometimes, for example, it should capture 4 screenshots, but with some possibilities, not all screenshots are captured. Later, we will raise a detail issue to you. Really appreciate for your help in advance.
{"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "casper/onBefore.js",
"onReadyScript": "casper/onReady.js",
"scenarios": [
{
"label": "Test1",
"cookiePath": "",
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"readyEvent": "",
"readySelector": "",
"delay": 10000,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": "",
"selectors": [],
"selectorExpansion": true,
"misMatchThreshold": 0.1,
"requireSameDimensions": true
},
{
"label": "Test2",
"cookiePath": "",
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"readyEvent": "",
"readySelector": "",
"delay": 10000,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": "",
"selectors": [],
"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": "phantomjs",
"casperFlags": [
"--ignore-ssl-errors=yes",
"--engine=phantomjs",
"--proxy=10.74.66.43:3128"
],
"Capture": 3,
"asyncCompareLimit": 50,
"debug": true,
"debugWindow": false
}
Log
BackstopJS v3.0.32
Loading config: /Users/ken/Docker/test-automation/VisualRegression/Institutional/backstop.json
COMMAND | Executing core for `reference`
clean | backstop_data/bitmaps_reference was cleaned.
createBitmaps | Selected 2 of 2 scenarios.
Running CasperJS with: [ '/usr/local/lib/node_modules/backstopjs/capture/genBitmaps.js',
'--ignore-ssl-errors=yes',
'--engine=phantomjs',
'--proxy=10.74.66.43:3128',
'--captureConfigFileName=/var/folders/sx/81945gm9197gbnxx5snbl54c0000gn/T/capture/20a06bb00fceeedb0c83fa61cd0c080a3c7e518f.json' ]
CasperJS: CREATING NEW REFERENCE FILES
CasperJS: Cookie state restored with cookies: []
CasperJS: Ready event received.
CasperJS: Current location is https://garris.github.io/BackstopJS/
CasperJS: SCENARIO> Test1
CasperJS: Capturing screenshots for phone (320x480)
CasperJS: Cookie state restored with cookies: []
CasperJS: Ready event received.
CasperJS: Current location is https://garris.github.io/BackstopJS/
CasperJS: SCENARIO> Test1
CasperJS: Capturing screenshots for tablet (1024x768)
CasperJS: Cookie state restored with cookies: []
CasperJS: Ready event received.
CasperJS: Current location is https://garris.github.io/BackstopJS/
CasperJS: SCENARIO> Test2
CasperJS: Capturing screenshots for phone (320x480)
CasperJS: Cookie state restored with cookies: []
CasperJS: Ready event received.
CasperJS: Current location is https://garris.github.io/BackstopJS/
CasperJS: SCENARIO> Test2
CasperJS: Capturing screenshots for tablet (1024x768)
CasperJS: Comparison config file updated.
Bitmap file generation completed.
Run `$ backstop test` to generate diff report.
COMMAND | Command `reference` successfully executed in [48.435s]
Ken-MacBook-Pro:Institutional ken$
@Kenith I guess @garris meant that with PhantomJS you can only run 1 capture at the time (therefore synchronous), that means asyncCapture
is setting only for case when you use Chrome. There is not such setting for PhantomJS.
As for not capturing all screenshots with Chrome engine maybe you will find some helpful answer here https://github.com/garris/BackstopJS/issues/589 ... although I still get empty screenshots even with asyncCapture set to 1 :/
@VladimirPittner Great post! Thank you! We will take time to try it.
@garris If we only can run 1 capture at the time for phantom, you could close ticket. Really appreciate for your help.
closed as PhantomJS does not have parallel feature
Hello All,
We found if we set the engine to phantomJS, the asyncCaptureLimit is not working. Only 1 process is running for capture. Would you please take time for the issue? You are very welcome if something wrong on our side.
ENV: npm - 5.5.1 node - 8.9.1 backstop - 3.0.32 phantomjs - 2.1.1
backstop.json
Thank you, Ken