网络科技

    今日:336| 主题:244604
收藏本版
互联网、科技极客的综合动态。

[其他] TestCafe - a new open-source browser testing framework based on node.js

[复制链接]
旧人城 发表于 2016-10-19 03:59:23
409 30

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
Easy Install      Everything is included in a single module installed with one command.
      npm install -g testcafe
      No native parts to compile, no browsers plugins to install.
            Complete Test Harness      TestCafe automatically starts browsers, runs tests and gathers results. You only type a single command to begin testing.
      testcafe chrome,firefox tests/
      When testing is finished, TestCafe aggregates test results from different browsers and outputs them into one comprehensive report.
            Write Test Code Using ES2016          You can write TestCafe tests in ES2016 using the latest JavaScript features like        async/await.      
      Test API consists of over two dozen methods that can emulate all actions one could possibly do with a webpage. Chained syntax allows for code that is easy to write and read.      
     
  1. import { expect } from 'chai';
  2. fixture `Example page`
  3.     .page('http://devexpress.github.io/testcafe/example');
  4. test('Emulate user actions and perform a verification', async t => {
  5.     await t
  6.         .click('#send-button')
  7.         .typeText('#input', 'Peter Parker')
  8.         .wait(1000);
  9.     expect(await t.eval(() => getSomethingOnTheClient())).to.be.true;
  10. });
复制代码
     Additionally, TestCafe automatically generates source maps for easy debugging. To debug your test code, start a debugging session in an IDE that supports source maps.
            Direct Access to Page Elements          TestCafe allows you to access webpage elements using standard CSS selectors orcustom selectors that run client JavaScript code. You can call a custom selector as a regular function within your test. It will execute your code on the client and pass the returned value back to the test. This allows you to determine the state of each element on the tested page or select a proper element to perform an action on.      
     
  1. import { Selector } from 'testcafe';
  2. const getElementById = Selector(id => document.querySelector(`#${id}`));
  3. fixture `Example page`
  4.     .page('http://devexpress.github.io/testcafe/example');
  5. test('Type the developer name, obtain the header text and check it', async t => {
  6.     await t
  7.         .typeText('#developer-name', 'John Smith')
  8.         .click('#submit-button');
  9.     const articleHeader = await getElementById('article-header');
  10.     const headerText = articleHeader.innerText;
  11.     expect(headerText).to.equal('Thank you, John!');
  12. });
复制代码
           No Extra Coding          Write tests without boilerplate code.
      
            
  • TestCafe automatically waits for page loads and XHRs to complete, as well as for DOM elements to become visible. You do not need to write custom code for that.        
  • Test runs are isolated, which means that they do not share cookies, local or session storages. There is nothing to clean up between test runs.      
            Descriptive Reports      TestCafe automatically generates full-detailed reports that provide a test run summary and comprehensive information about errors. Automatic page screenshots, fancy call sites and call stacks free of TestCafe internals allow you to easily detect error causes.
      Use one ofbuilt-in reporters to output test results orcreate your own one to produce custom reports.      
            Straightforward Continuous Integration    TestCafe is easy to set up on popular Continuous Integration platforms as it allows you to test against various browsers: local, remote or cloud (e.g.      Sauce Labs). You can also create a custombrowser provider to add support for a browser or a cloud platform of your choice.   
        More to Come…    We plan to introduce other outstanding features so that you can test apps with even more efficiency. Meanwhile, you can help us improve TestCafe by voting for features on our road map or sharing your own ideas and code in our      GitHub repository.   
        Get Started
友荐云推荐




上一篇:读懂Netty的高性能架构之道
下一篇:老罗憋大招!锤子发布Smartisan M1,售价2499元起
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

528944900 发表于 2016-10-19 05:49:30
最近病院在打折!?
回复 支持 反对

使用道具 举报

董俊旗 发表于 2016-10-19 13:14:38
朕好无聊啊!爱妃呢?
回复 支持 反对

使用道具 举报

张伟伟 发表于 2016-10-20 08:04:59
为失联儿童祈福!2016-10-20
回复 支持 反对

使用道具 举报

xftqn 发表于 2016-10-20 08:25:57
房价越来越高,所以,好男人越来越少……
回复 支持 反对

使用道具 举报

股道觅馨香 发表于 2016-10-20 08:46:08
做好事不留名,都写在帖子里!
回复 支持 反对

使用道具 举报

黄玲玲 发表于 2016-10-20 08:55:45
楼猪V5啊
回复 支持 反对

使用道具 举报

大忽悠呐 发表于 2016-10-20 09:06:44
楼主,我这人不太会说话,如果有什么冒犯的地方,你他妈来打我啊!
回复 支持 反对

使用道具 举报

谢辉 发表于 2016-10-20 09:24:16
开启抢楼模式,楼下速度跟上!
回复 支持 反对

使用道具 举报

国有工业行业 发表于 2016-10-20 09:34:19
虽然我不知道你在说什么 不过我知道你有钱所以你说的话肯定是对的
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表