Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait doesn't work anymore with chrome #616

Open
4 tasks done
ajoah opened this issue Jul 29, 2019 · 4 comments
Open
4 tasks done

Wait doesn't work anymore with chrome #616

ajoah opened this issue Jul 29, 2019 · 4 comments

Comments

@ajoah
Copy link
Contributor

ajoah commented Jul 29, 2019

Since the 4.2.4 version, it seems that it is no longer possible to wait. Neither with wait--chrome file nor with the new settle parameter (see my comment: #578 (comment)).

To tested this, i created a simple html file with a JS counter:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Test Wraith Waith</title>
		<script type="text/javascript">
			setInterval( function() {
				document.getElementById( 'counter' ).textContent = parseInt( document.getElementById( 'counter' ).textContent ) + 1
			}, 1000 )
		</script>
	</head>
	<body>
		<span id="counter">0</span>
	</body>
</html>

I used a wait of 10 seconds.

With wraith 4.2.3 :
4 2 3

With wraith 4.2.4 :
4 2 4

You can found my wraith settings below :

  • I have validated my config file against YAML Validator to make sure it is valid YAML.

  • I have run the wraith info command and pasted the output below:

  • I have run the command in verbose mode (by adding verbose: true to my config) and pasted the output below:

DEBUG: #################################################
DEBUG:   Command run:        history configs/history.yaml
DEBUG:   Wraith version:     4.2.4
DEBUG:   Ruby version:       ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
DEBUG:   ImageMagick:        Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
DEBUG:   PhantomJS version:  PhantomJS not installed
DEBUG:   chromedriver version:  ChromeDriver 75.0.3770.140 (2d9f97485c7b07dc18a74666574f19176731995c-refs/branch-heads/3770@{#1155})
DEBUG:   CasperJS version:   CasperJS not installed
DEBUG: #################################################
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
  • I have pasted the contents of my config file below:
##############################################################
##############################################################
# This is an example configuration provided by Wraith.
# Feel free to amend for your own requirements.
# ---
# This particular config is intended to demonstrate how
# to use Wraith in 'history' mode, which is best suited to
# making sure your site's appearance remains consistent over
# time.
#
# `wraith history history.yaml` # generate base screenshots
# `wraith latest history.yaml`  # take new shots and compare
#
##############################################################
##############################################################

# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'
browser: "chrome"

# (required) The domain to take screenshots of.
domains:
  test: "https://test.example.com/"

# (required) The paths to capture. This particular config is using casperjs, so we can take screenshots of selectors rather than the entire page.
paths:
  test: "/"

settle: 10

# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil
before_capture: 'javascript/wait--chrome.js'

# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.
screen_widths:
  - 1280

# (optional) Resize to each screen width (efficient), or reload at each screen width (costly). Default: 'reload'
resize_or_reload: 'reload'

# (required for history mode, otherwise optional) The directory that your base screenshots will be stored in.
history_dir: 'shots_base'

# (required) The directory that your latest screenshots will be stored in
directory: 'shots'

# (required) Amount of fuzz ImageMagick will use when comparing images. A higher fuzz makes the comparison less strict.
fuzz: '20%'

# (optional) The maximum acceptable level of difference (in %) between two images before Wraith reports a failure. Default: 0
threshold: 5

# (optional) Specify the template (and generated thumbnail sizes) for the gallery output.
gallery:
  template: 'slideshow_template' # Examples: 'basic_template' (default), 'slideshow_template'
  thumb_width:  200
  thumb_height: 200

# (optional) Choose which results are displayed in the gallery, and in what order. Default: alphanumeric
# Options:
#   alphanumeric - all paths (with or without a difference) are shown, sorted by path
#   diffs_first - all paths (with or without a difference) are shown, sorted by difference size (largest first)
#   diffs_only - only paths with a difference are shown, sorted by difference size (largest first)
# Note: different screen widths are always grouped together.
mode: diffs_first

# (optional) Choose to run Wraith in verbose mode, for easier debugging. Default: false
verbose: true

# (optional) Color to highlight the image diff. Default: 'blue'
highlight_color: red

# (optional) Parameters to pass to Phantom/Casper command line. Default: '--ignore-ssl-errors=true --ssl-protocol=tlsv1'
phantomjs_options: ''

Wait file :

var callback = arguments[arguments.length-1];
setTimeout(callback, 10000);

@nicrodgers
Copy link

We are also seeing the same behaviour (wait not working, settle not working) with Chrome and wraith 4.2.4.

@billysandle95
Copy link

billysandle95 commented Sep 2, 2019

Same here, we are also seeing this issue in 4.2.4 when using Chrome.

@patricknelson
Copy link

What do you guys see when you run chromedriver -v? Also, what version of Chrome are you using? If those two aren't the same, try replacing the current chromedriver binary currently in your path with one from here that is aligned with your version of Chrome: https://chromedriver.chromium.org/

That's usually the issue for it going out of sync. I think it'd be a rad feature to have wraith somehow find a way to stay in sync with your currently installed Chrome (either that or just isolate/ship it's own version... hint hint... 😎).

@weseze
Copy link

weseze commented May 12, 2020

I have this exact same issue:

Chromedriver: 81.0.4044.69 (6813546031a4bc83f717a2ef7cd4ac6ec1199132-refs/branch-heads/4044@{#776})
Chrome: Version 81.0.4044.122 (Official Build) (64-bit)

Setting threads: 1 seems to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants