phantomjs screenshots differs on different machines - phantomjs

I have created an integration test on my local developer machine.
With VaadinTestBench I have created a screenshot that should be used as a reference screenshot.
After uploading the reference screenshot to svn and using jenkins to verify the build I get a slightly different image and therefore the test fails.
It seems that the fonts are different, but I have installed the same fonts and the website specifies the font to use.
But of course I cannot verify that exactly the same fonts are used.
Here is a sample pic (please ignore the purple border):
http://picpaste.com/phantomJS.jpg
Do you have an idea how to make the screenshots be identical?
Thank you
Tobias

Related

Can we customize Chrome browser launch with different options using Chrome Java API? [duplicate]

I am using the Karate framework to do the API testing. As part of CI efforts, we send an email at the end of test execution listing the summary of test results. There is a need to include the screeshot of the test execution counts from 'overview-feature.html' file.
I did so through the TestRunner.java file - launched Chrome using Chrome.start() and then using it to take screenshot. It all works well locally on Windows.
However when executing on CI server which is a Unix box, the chrome executable is not present in the default location (usr/bin/google-chrome) and hence the connection for the localhost fails.
Is there a way we can change the default location of the chrome executable?
PS: Apologies if this was too trivial to be asked.
Yes Chrome on CI is hard to get right, refer: https://stackoverflow.com/a/62325328/143475 - note that CI boxes typically are "headless" a browser may not be even installed.
I think the best thing for you is to ZIP the HTML and send it. But I really think you need to work with some CI experts, because the report generation and e-mailing business is normally done by things like Jenkins. What you are doing is certainly not normal or best-practice.
If you really want, there is a Karate Docker container that can give you a proper Chrome instance (see docs) but that is overkill for what you need.
EDIT: The Chrome Java API allows for customization of the executable path and this is in the docs: https://github.com/intuit/karate/tree/master/karate-core#chrome-java-api
It should be something like this:
Chrome.start("/opt/blah/chrome");

What is wlConcatenatedUserHead0.js?

I am facing this issue in mfp 7. See the attached image for better clarification.
"wlconcatenatedbody0.js" gets created when you chose to concatenate your JS files. This is a choice you make as part of your build process. The configuration to do this, is enabled via build-settings.xml. Concatenation of JS files is not on by default in Desktop browser environment.
Refer to the steps and details here.
This does not cause runtime issues, but if there is a problem, troubleshooting becomes hard. If you do not wish to have concatenation on, you should modify the settings accordingly.

Can I access Electron's HTML/CSS via app.asar?

I'm testing a desktop app being built in Electron. Since the app’s layout is CSS/HTML based, I was hoping to do simple layout modifications without access to the source material. Even if I can't see my mods in the running app, it would be useful to extract HTML/CSS/JavaScript templates, modify these and see the results in a browser.
Question 1: Is the above possible?
Based on this question I'm assuming app.asar could be what I'm looking for, but being on Windows 10, it seems that installing asar (and Node, NPM, Python and Visual Studio) just to unarchive files is discouraged.
Question 2: Can I access the files presumed to be inside app.asar without installing all the stuff mentioned above?

How to open an sshfs-project in Adobe Brackets editor

adobe-brackets is an open source code editor for the web, written in JavaScript, HTML and CSS.
Although I followed the instructions on how to open a Project ( see also How to create a new project in adobe-brackets?) this does not work for my project-directory which is mapped via sshfs.
Brackets will show the sshfs directory but without any contents. (neither files nor subdirs)
Opening other locally stored directories works like a charm.
Any hints/suggestions?
Update: This is fixed in the latest release of Brackets, Sprint 34. You should now be able to open files on SSHFS file systems with no trouble.
original answer:
What platform are you on? If Linux, you might be seeing bug #5292, which is currently under investigation.
If not, it might be best if you just file a new bug specifying your platform and any other details, and then the Brackets devs (of which I am one) can take a look. When reporting a bug, always check the console log via Debug > Show Developer Tools and paste any exceptions there into your bug report.

Is it possible for Vagrant to use an OS .ISO install image directly/or create a Vagrant box from an ISO on the fly?

Is it possible to automate the creation of a Vagrant .box file for an OS install, from the original ISO?
To me, this is a significant gap in the end-to-end automation of Operating System install and configuration on a Virtual Machine that Vagrant provides.
Sure, VagrantBox.es provides many base .box OS install files for usage. But some are from third party suppliers and not from the original OS distribution maker. For example Arch Linux: Arch Linux 64 (2012-07-02) http://vagrant.pouss.in/archlinux_2012-07-02.box
Not wanting to be negative about the efforts of third-party suppliers, but some organisations may want the original install image from the original OS provider (e.g. for the Arch example above, this would be: https://www.archlinux.org/download/ ). Reasons for wanting original install image would be security (as it would not be possible to verify the third party image for security compromises and malware) and getting the image as the original suppliers intended without extra stuff not required. Another reason would be to take advantage of new releases direct from the original supplier and not have to wait for a third party to release it as a Vagrant .box
There are guides for creating a .box file from a .ISO image:
http://www.practicalweb.co.uk/blog/12/10/16/how-build-centos-6-base-box-vagrant
http://pyfunc.blogspot.co.uk/2011/11/creating-base-box-from-scratch-for.html
But these are manual steps - which goes against the philosphy behind Vagrant of automation and consistency. Especially if many want to achieve the end goal of being able to use the original - this would end up with duplicate effort on everyone's part.
So I would be looking here from a definitive answer that describes how to make a generic automation script to convert a .ISO OS install image into a Vagrant box.
I think VeeWee provides a great mechanism for preparing a Vagrant box from an ISO:
https://github.com/jedi4ever/veewee
It already provides a lot of out-of-the-box templates for most distributions, which you can customize if required (although this is often not needed). Alternatively you can create your own definitions.
Alternatively you can use Packer:
https://packer.io/
Which is produced by the same company that makes Vagrant, so it has fairly good integration. Packer itself doesn't provided sample templates I believe, but you can use the ones Puppet Labs uses for its own testing purposes if you like:
https://github.com/puppetlabs/puppetlabs-packer
This can be used as a solid base for your own templates and modified to taste, or you can raise a PR on the project to contribute back if desired.