[Node.js] Take Screenshots of Multiple Dimensions for Responsive Sites using Nightmare
2017-04-18 14:58
351 查看
When developing responsive websites, you will constantly be resizing your browser to make sure your site is properly responding to all of the resizes. You can script this behavior by using
Github
Nightmareto leverage Electron and it will handle all the resizing for you. Nightmare can then also takes screenshots and save them so you can make sure the site matches your designs.
const Nightmare = require('nightmare'); const path = require('path'); const nightmare = new Nightmare({ show: true, frame: false }); nightmare .goto('https://egghead.io') .viewport(640, 480) .wait(1000) .screenshot('./screenshots/640x480.png') .viewport(1280, 720) .wait(1000) .screenshot('./screenshots/1280x720.png') .end() .then(() => console.log("done"));
Github
相关文章推荐
- Nodejs Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'xx' (using password:YES)
- System and method for parallel execution of memory transactions using multiple memory models, including SSO, TSO, PSO and RMO
- 《Sikuli: Using GUI Screenshots for Search and Automation》
- Create screenshots of a web page using Python and QtWebKit | Roland's Blog
- Sikuli——Using Screenshots for GUI Automation and Testing
- Using Node.js for Javascript Analysis
- Review the syntax of using sp_MsForEachDb
- Using CL GUI TIMER for automated screen refreshing
- Retrieve multiple Oracle Ref Cursor using .NET data Provider for Oracle
- Unable to find a value for "dwmc" in object of class "java.lang.String" using operator "." (null
- Modeling of Test Structures for Efficient Online Defect Monitoring Using a Digital Tester
- [软件哲理][转]A piece with a lot of screenshots about the close tab behaviour in Google Chrome
- Are you looking for a way to get the entire text of a word document into a RichEdit without using the Clipboard?
- Set Visible attribute in the node of HTML for ASPX
- spread extension for node.js
- Screenshots for new engines.
- The Design of Sites: Patterns, Principles, and Processes for Crafting a Customer-Centered Web Experi
- [翻译]Effect of Sensor Fusion for Recognition of Emotional States Using Voice, Face Image and Thermal Image of Face
- ExpressJS for NodeJS 开发(草稿)
- Snap it! - How to take a screen shot using .NET