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

imageUtilsTest passes on ChromeHeadless #32524

Merged
merged 1 commit into from Jan 7, 2020

Conversation

islemaster
Copy link
Contributor

I've been trying to run tests in ChromeHeadless on my local machine, since PhantomJS isn't working properly on recent versions of Ubuntu. Eventually, I'd like us to use ChromeHeadless in our CI builds too, but to do that, we need to fix up all the tests that fail on this browser.

One of the tests that fails is image utils overlays an image inside the Artist frame. I believe this fixes that test under both ChromeHeadless and PhantomJS.

See also

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

// pass in both browsers.
const expectedPng = /PhantomJS/.test(window.navigator.userAgent)
? expectedPhantomPng
: expectedChromePng;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the problem with loadAppTest, Chrome and Phantom generate visually similar images that are very different when you actually try to do a bytewise comparison.

PhantomJS ChromeHeadless
523kB 40kB
expected expected-chrome

Copy link
Member

@davidsbailey davidsbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution, @islemaster !

@islemaster islemaster force-pushed the imageutilstest-chromeheadless branch from 4b70080 to f2c99c9 Compare January 6, 2020 21:24
@islemaster islemaster merged commit 72a2ca3 into staging Jan 7, 2020
@islemaster islemaster deleted the imageutilstest-chromeheadless branch January 7, 2020 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants