<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 恒温 on Medium]]></title>
        <description><![CDATA[Stories by 恒温 on Medium]]></description>
        <link>https://medium.com/@lihua.zhang?source=rss-b2f174ae0726------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BEgsNDyA3ei3fclU.jpeg</url>
            <title>Stories by 恒温 on Medium</title>
            <link>https://medium.com/@lihua.zhang?source=rss-b2f174ae0726------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 11:33:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lihua.zhang/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[请使用 Macaca Puppeteer 驱动]]></title>
            <link>https://medium.com/@lihua.zhang/%E8%AF%B7%E4%BD%BF%E7%94%A8-macaca-puppeteer-%E9%A9%B1%E5%8A%A8-ed0229a179d6?source=rss-b2f174ae0726------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed0229a179d6</guid>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[恒温]]></dc:creator>
            <pubDate>Sun, 19 Nov 2017 02:43:19 GMT</pubDate>
            <atom:updated>2017-11-19T02:49:59.899Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>谷歌 Chrome 团队发布了 [puppeteer](<a href="https://github.com/GoogleChrome/puppeteer">https://github.com/GoogleChrome/puppeteer</a>)，提供了很多实用功能，Chrome 59 版本后将支持 headless 模式。</blockquote><h3>特性</h3><p>除了有吸引力的截图和导出 PDF 外，puppeteer 还提供了很多有价值的特性。基于puppeteer 可以更加轻松地做服务端渲染、爬虫应用等，当然 puppeteer 也为自动化测试领域带来了便利。</p><p>在面向 web 的测试方向，Macaca 一直在不断尝试开发更新更快、能力更强的驱动，为用户带来最佳的实践选择。目前已经提供的测试驱动：</p><p><a href="https://github.com/macacajs/macaca-chrome">macaca-chrome</a>：macaca-chrome 基于 chromedriver，是谷歌最早推出的自动化驱动。</p><p><a href="https://github.com/macacajs/macaca-electron">macaca-electron</a>：macaca-electron 是基于开发平台 Electron。一年多以前选择基于 Chromium 的 Electron 平台，而没有选择基于 Webkit 的 phantomjs，是因为使用 Chromium 更加直接，Electron 更加面向未来。(<a href="https://groups.google.com/forum/m/#!topic/phantomjs/9aI5d-LDuNE">今年4月，phantomjs 作者已宣布放弃维护</a>)</p><p>与 Electron 和 phantomjs 相比，puppeteer 有如下差异特性：</p><ol><li>更新更加频繁，始终与 Chromium 最新版同步</li><li>集成环境不再需要 Xvfb (由于是纯粹的无头实现，已经不需要内存屏幕)</li><li>能够导出 PDF</li><li>对移动端、文件上传、处理alert上更加友好</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPxSjEStN30i7-5Fso9s8g.jpeg" /></figure><h3>如何上手？</h3><p>直接使用 macaca-puppeteer 驱动即可，已有的 API 可以直接无缝切换。</p><p><a href="https://macacajs.github.io/versioning](https://macacajs.github.io/versioning)">https://macacajs.github.io/versioning</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*jZEjf4KD-42ixqE_-75tjQ.png" /></figure><p>- <a href="https://github.com/macacajs/macaca-puppeteer">macaca-puppeteer</a><br>- <a href="https://github.com/macaca-sample/sample-nodejs">测试例子</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed0229a179d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>