CutyCapt Not Displaying Custom Web Fonts - cutycapt

I'm trying to use cutycapt to take iPhone-sized screenshots of sites, to test a mobile app, rather than having to go and manually take screenshots every time the CSS changes.
The problem I'm running into is that cutycapt isn't rendering or loading custom web fonts, either served from a fonts directory, or by Google Web Fonts.
Example screenshot - Google Web Fonts.
I'm running cutycapt using xvfb-run on a Ubuntu server. The command I'm using is something like this:
xvfb-run --server-args="-screen 0, 1024x768x24" \
cutycapt --url={url} --out=/tmp/test2.png \
--min-width=640 --min-height=960 \
--user-agent="Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7" \
--delay=2000 --header=X_SCREEN_DIMENSIONS:640x960

I'm using xvfb-run for wkhtmltoimage and had the same issue of custom fonts not rendering in the image output.
To solve the issue, I installed the custom font on my server following the instructions here:
http://www.cangjie.info/public/howto/ubuntu_fonts/ubuntu_fonts.php
I downloaded the ttf file from google web fonts and placed it in:
/usr/share/fonts/truetype/custom/customfont.ttf
After placing the font, I refreshed the font cache: sudo fc-cache -fv
If you get a 'command not found' error trying to refresh the font cache, install fontconfig:
apt-get install fontconfig

I use this to resolve this same problem. But it will take some time to download all of the fonts.:
sudo apt-get install ttf-wqy-zenhei
sudo apt-get install xfs xfonts* -y

Related

Unable to launch WebDriverAgent because of xcodebuild failure: Command 'carthage bootstrap --platform iOS\,tvOS' exited with code 1

Hi Im still having an issue when running my basic script using Appium.
The issue is Unable to launch WebDriveragent because of xcodebuild failure.
Tried executing the Carthage bootstrap --platform iOS,tvOS' but returns an error
platform iOS,tvOS
IntelliJ Error
I've tried to backtrack the issue by going to my webdriveragent and entering
./Scripts/bootstrap.sh -d
but still it produce an issue
Bootstrap Issue
so I tried to use
carthage bootstrap --use-xcframeworks --platform iOS --no-use-binaries;
it does not return any issue
Appium Server Issue
Im using
MacOS = BigSur 11.5
Appium = 1.17
Xcode = 12.5.1
Carthage version = 0.38.0
Sorry I'm really new to iOS world. Followed all tutorial in the web. Manage to connect an app (IntegrationApp.app) and it works in iOS Real device and simulator but when I tried to connect Appium to real device and simulator it fails
Also tried to reinstall Carthage and even the whole Appium (tried the whole process)
Steps I did
Install Appium desktop and Appium doctor
Open the location of Appium and look for webdriveragent
Open terminal and set it to the location of webdriveragent
code I use is : mkdir -p Resources/WebDriverAgent.bundle
./Scripts/bootstrap.sh -d (didn't work so tried other which stated above)
Open the WebDriverAgent file in Xcode and set the necessary field (Build success)
Tried to open IntegrationApp.app in iOS device(real and simulator)(Success)
Tried to open Appium inspector and set the following:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("platformName", "iOS");
cap.setCapability("platformVersion", "14.5");
cap.setCapability("deviceName", "iPhone 12");
cap.setCapability(CapabilityType.BROWSER_NAME, "safari");
// cap.setCapability("app");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
IOSDriver driver = new IOSDriver(url, cap);
Manage to solve this problem (Though it has another issue on real device - still has answers here)
Download new Appium version v1.18.3
Tried to setup again but after creating the Resource Directory (mkdir -p Resource/WebDriverAgent.bundle). instead using ./Source/bootstrap.sh -d I used
sudo ./Source/bootsrap.sh -d
I'm using a company provided macbook air. And I also run the
sudo carthage bootstrap --use-xcframeworks --platform iOS --no-use-binaries;
And this is a good read to https://www.mutuallyhuman.com/blog/webdriveragent-getting-started-with-automated-ios-testing/

Wordpress: Using svg as header image

I am using wordpress, theme Twenty Fourteen. I would like to add a svg image as header. I have no problems with uploading svg images (I use them already successfully on my webpage), but when I try to use it as head image the following message occurs: "There has been an error cropping your image". Does anybody knows what the problem is?
Thank you!
Best wishes,
pradhana
I had the same problem. Its the GD Library not installed.
Just use this command to install it:
sudo apt-get install php7.0-gd
Use this to stop Apache for it to make changes
sudo apachectl stop
Start Apache now and everything is fixed.
sudo apachectl start
As Shubham007 said, the GD Library is not installed.
However, for PHP7 on CentOS or EC2 Linux AMI:
sudo yum install php70-gd

IOS mobile automation

I am new to IOS automation testing. I have to install appium for automation on actual physical device. I have followed a number of links but I am still confused. I have installed appium and xcode. But when I run appium inspector I always get error 'Could not launch Appium Inspector'. What could be the possible cause? Also can someone suggest a link which I can follow for appium set up on MAC.
Here's a very basic list of things you need to have to make Appium work for iOS:
It's helpful to use Homebrew to install some of these items.
https://brew.sh/
First you need to have ruby version 2.2 or higher to utilize the newest appium. I would suggest you use a ruby manager like RVM to install this Ruby.
\curl -sSL https://get.rvm.io | bash -s stable
Then install a ruby version above 2.2 (I personally default to 2.4.0):
rvm install 2.2.0
you can set a default rvm to use for convenience:
rvm default 2.2.0
If you don't set the rvm default you will have to use the "rvm use rubyversion" command every time you open a terminal.
Node.js: Essential, can not do without.
brew install node
(Note: DO NOT INSTALL WITH SUDO)
Appium Desktop: Convenient implementation of appium for building test cases. Uses a GUI and has inspector build in.
https://github.com/appium/appium-desktop
Appium CLI: command line Appium which is best for running multiple devices at once.
npm install -g appium
npm install -g appium-doctor
Check the Doctor: You can use appium doctor to diagnose what next steps you need to do next. Run it with the --ios or --android tags to find out what you need for each of these operating systems. You'll have to make adjustments to your .bash_profile so Appium can find your JDK folder among other things.
Authorize iOS testing on your computer:
npm install -g authorize-ios
sudo authorize-ios
Carthage: required to automate after Xcode 8
brew install carthage
brew update carthage
Hopefully this will help to diagnose what is going on with your set up. If you're using ruby to do your automation scripts don't forget to actually download the appium_lib gem:
sudo gem install appium_lib
Good Luck!
Check this out latest appium desktop :
AppiumDesktop1.1.0beta4 iOS setup - Inspector and Record the scripts,
Link : https://www.youtube.com/watch?v=2_xHmofGgUE
If you face any issue please comment it.

How to install wkhtmltopdf patched qt without compiling?

I'm using google cloud instance for host Odoo, somo reports print to pdf ok, but other with custom paperformat get the following error:
"The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display"
I google it, and to solve I need to compile wkhtmltopdf like this:
http://www.grobak.net/id/blog/how-fix-wkhtmltopdf-failed-error-code-6 but this proccess need 3 hs and I'm building a script to install google instances on the run with odoo dependencies.
the .deb package have a dependency broken
Anyone know other solution?
My system configuration is Ubuntu 14.04 and 64 bit. So, i am downloading according to that.
First you have to check your system OS name by
lsb_release -a
Check to see if your Ubuntu Linux operating system architecture is 32-bit or 64-bit, open up a terminal and run the following command below.
file /sbin/init
Download wkhtmltopdf patched with qt using below command
sudo wget -P Downloads https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
Here, replace "trusty" with your OS name and if 64 bit only then keep "amd64" like that , otherwise change it to "i386" and down load the deb file.
After that execute the following commands,
cd ~/Downloads
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
Now, check wkhtmltopdf version with below command,
wkhtmltopdf -V
Enjoy!!
After trying many ways I finally made it work.
First I removed all my previous installation by
sudo apt-get remove --purge wkhtmltopdf
sudo apt-get autoremove
Then I opened wkhtmltopdf.org and navigated into their Downloads > Archive. In Archive section I downloaded 0.12.1 .deb version by
wget <copy the link from website for the.deb file and paste it in terminal here>.
sudo dpkg -i <package name>
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
This is because odoo looks for wkhtmltopdf in /usr/bin directory otherwise gives IOError. I also set my webkit_path parameter in Odoo System Parameters to /usr/bin.
Thats it. Hope this helps
I was facing same issue with wkhtmltopdf 0.12.4
installed new version of wkhtmltopdf 0.12.6-1
follow below commands to install wkhtmltopdf 0.12.6-1
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm
yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm #centos specific command

Report formatting not working in Odoo 8 Qweb Reports

All the default reports and the new reports that I am generating are being printed towards the left of the page. This only happens when the report is generated in PDF format. In HTML format the report is displayed fine. I did some research and found that downgrading the wkhtmltox to version 0.21.1 would solve this problem. I did that, but the problem still persists.
There is one small configuration
Go to settings --> Technical --> Parameters --> System Parameters -->
Click on Create and type
Done
You can try with completely un install and install again it again wkhtmlttopdf 0.12.X python library and try to print that report again..
I hope this should helpful for you ..:)
In Ubuntu 14.04, open the terminal and type:
sudo add-apt-repository ppa:ecometrica/servers
sudo apt-get update
sudo apt-get install wkhtmltopdf
In Ubuntu 12.04, open the terminal and type:
sudo add-apt-repository ppa:pov/wkhtmltopdf
sudo apt-get update
sudo apt-get install wkhtmltopdf
If That Was Not Working Then Following This Step
1) Download wkhtmltopdf version from wkhtmltopdf.org depend on your system arch (32 or 64 bit)
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
2) Install the package using commnad :
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
3) Copy binary or wkhtmltopdf to /usr/bin location from ./usr/local/bin use command
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/
4) Restart Odoo server and try once again.

Resources