Saving Cypress output to pdf file or similar - cypress

Is there a way to save the output shown in the linked video (on the left side) to a pdf file or similar? I have started experimenting with other Reporters offered, but the format of them does not seem to be as clear for reporting. Suggestions for Reporters that could do something similar as opposed to only XML would also be useful.

I haven't used this yet, but it's on my to-do list. It promises to do just that, store the command log output to a json file. It's written by Gleb, one of the cypress people, so it should integrate and work well with cypress.
https://github.com/bahmutov/cypress-failed-log

You may export a screenshot with both, the left sidebar and the application preview by using the screenshot function with capture: runner:
cy.visit(`http://www.fabiobiondi.dev`);
cy.viewport('iphone-6' )
cy.screenshot('imageName', { capture: 'runner'})
Result:
https://i.stack.imgur.com/rqN0E.png

Related

Chrome headless print-to-pdf doesn't render images

I am trying to write a script to output a lot of markdown pages to PDF using Chrome's headless mode. My current command is:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless
--run-all-compositor-stages-before-draw --disable-gpu
--print-to-pdf="index.pdf" http://localhost:8080/#!index.md
The resulting PDF file seems to render as it would be shown except for the images. What I get in the PDF file is a link to the image instead of the image itself.
When I run the --screenshot option I do get the pictures you would expect in the resulting image file.
I think the reason is that it has something to do with the page being rendered with MDwiki, which does a lot of client-side work to convert markdown to HTML. But when I try to use the --virtual-time-budget option Chrome errors out with a message about multiple tables only allowed if debugger is enabled.
Any suggestions for what next to try?
It turns out that there is an node package that takes care of this: chrome-headless-render-pdf. There isn't much documentation but it works. Check out:
npm docs chrome-headless-render-pdf

Trying to find out what language this was created in (pic inside)

You can see the image here: http://i.stack.imgur.com/ABWc4.jpg
I use this system for work on my home PC and I'm trying to find out what language it is, and if I can extract data from it. Someone suggested it may be some type of terminal program that is then converted to web. It is used like a terminal, using the F keys to help navigate.
The only info I have is that it's called CATS. It is used by the company to keep in touch with employees, keep track of payroll/payments, see when you work next, etc.
Looks like it's HTML/ XHTML. Can read that off from the end of the link.
The functioning of page is handled by Javascript

Web application written with Processing, using processing.js: how to debug?

I'm a newby in HTML, while I've some skill with Processing language.
I'm writing an application in Processing which I want to visualise in a local webpage.
I've a basic index.html, which upload my sketch and the file processing.js.
It works.
My problem is that sometimes, an application which runs with no proiblem using the Processing IDE, does not run in the webpage. I assume there are still some bugs in the porting from Processing to JavaScript.
What I would like to know is: is there some way to debug the webpage I try to visualise?
Just to seek "where" the webpage remains stuck! In this way I could bypass the problem!
For now, I'm using Firefox for html visualisation.
Thanks a lot, Valerio
Ops solved! I downloaded FireBug, an add-on for Firefox implementing a debugger.
Then I launched the debugger. It showed me immediately the error.
For curious people:
I declared an ArrayList called "foo_list", containing object "foo":
ArrayList<foo>foo_list
The above line does not produce any error in the Processing IDE.
However processing.js complains with it, the debugger displayng
the following message:
ReferenceError: ArrayListfoo_list" is not defined
The solution is to insert a blank space:
ArrayList<foo> foo_list;
This works! Maybe the error given to the parser
from Processing to JavaScript!
Bye!

Unable to view content script references in the developer tools window

When I view my extension with the developer tools, I only see the generated background file, background.js; my content script doesn't appear under the content scripts tab. Any ideas why? The relevant part of the manifest looks like this:
"content_scripts": [{
"run_at": "document_end",
"js": ["postMsg.js"],
"matches": ["https://groups.google.com/forum/*"]
}],
postMsg.js gets injected into the page, but never appears in the developer tool window, so I'm unable to debug it.
As long as you are on a page that matches the "Match patterns and globs" from your manifest, you will see the content script(s) under the Sources -> Content Scripts pane.
You may need to refresh (F5) the page (and/or your extension, then the page) to see it:
(Click for larger image)
For more information on matching that cryptic number to an extension, see this answer.
content scripts as a js file are never exposed by pages which are injected.. If your intention is debugging of content scripts it can be possible;
Ex:
mycontentscripts.js
var getStyleofbody = document.getElementsByTagName('body')[0].style;
to debug this i would first run this code in console of page that i am going to inject; After i get expected results i will move code to contentscript js file.
However for any errors after injection you can look at developer's console panel for all errors(they are listed there).
Let me know if you are confused
In 2018, if for some reason you've missed it:
Press the >>. From there select content scripts, and you'll be able to see the content scripts.
hf :)

How to use the existing Png-Shell-Thumbnail for my file types?

I am currently writing an application working with specially prepared image data. Another tool prepares the images (basically PNGs with additional data stored in the meta-data section). Now my tool works with these files, but not with all PNGs, so "we" decided to use a different file extension. So far, so good.
Now, because I am a lazy sack I implemented some file type registration to allow double-clicking on the file and opening it in my application (no problem at all).
And here is my Question:
It would be cool if the windows explorer could still show me the thumbnail previews for my files. Since they basically are still PNG files, it should be possible without writing my own shell extension (at least I believe so).
I quickly tried to copy all registry keys and values from HKCR.png to HKCR.mInDat (my file name ext) and it worked. However, I would prefere knowning what I am doing ;-)
Which of the registry settings are responsible for the thumbnail preview control and which can I use to get the preview for my file types?
I tried to google it, but I failed, since it seems I am unable to come up with the right buzz-words to find the info I need. Please, help me.
Thank you!
Yours,
3of4
Simple:
[HKEY_CLASSES_ROOT\.apng]
#="apng"
"Content Type"="image/png"
"PerceivedType"="image"
[HKEY_CLASSES_ROOT\apng\shellex\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
#="{3F30C968-480A-4C6C-862D-EFC0897BB84B}"

Resources