包含标签 Testing 的文章

构建Headless 的 E2E 测试

为什么要构建 Headless 的 E2E 测试

A headless browser is a great tool for automated testing and server environments where you don't need a visible UI shell. For example, you may want to run some tests against a real web page, create a PDF of it, or just inspect how the browser renders an URL.

结合上面的原因,我们还可以

  • Headless结合 E2E 测试,可以让E2E 测试在非 GUI 的操作系统中运行
  • 可以集成至 CI 环境中。让版本得到快速验证

Chrome Headless 的选取

  • Mac/Linux 的Chrome从59版本后,已经支持 Healess 模式的运行。Windows 的从60版本开始支持
  • 所以选择一个你想要的 Chrome 版本,便可以进行 Headless 的测试
chrome \
  --headless \                   # Runs Chrome in headless mode.
  --disable-gpu \                # Temporarily needed if running on Windows.
  https://www.chromestatus.com   # URL to open. Defaults to about:blank.
……

阅读全文

E2E测试之Headless browser容器化

目的

We recommend against using PhantomJS for tests with Protractor. There are many reported issues with PhantomJS crashing and behaving differently from real browsers.

Docker

安装

docker pull webnicer/protractor-headless
……

阅读全文

API开发神器-Postman

Postman helps you develop APIs faster.

豪华午餐

Postman

Postman

构建、管理、文档化API

Newman(我真的不是MP3)

……

阅读全文

如此Tricky的测试场景,你应该怎么办

什么是Tricky的测试场景?

Tricky的测试场景

测试场景

Scenario testing is a software testing activity that uses scenarios: hypothetical stories to help the tester work through a complex problem or test system. The ideal scenario test is a credible, complex, compelling or motivating story the outcome of which is easy to evaluate.

……

阅读全文

Protractor End to End Testing

Protractor

Protractor is an end-to-end test framework for AngularJS applications.
Protractor runs tests against your application running in a real browser, interacting with it as a user would.

是什么

功能

  • 模拟真实的用户操作行为
  • 针对AngularJS中的Element不需要做特殊的处理,普通HTML元素也同样支持
  • 智能等待,不需要为页面中的加载和同步显示做特殊的等待时间处理
……

阅读全文