博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Test] Easy automated testing in NodeJS with TestCafe
阅读量:4593 次
发布时间:2019-06-09

本文共 946 字,大约阅读时间需要 3 分钟。

Quickly get up and running with sensible automated testing scenarios written in ES6. Installing and creating your first automated tests with TestCafe is very easy. You can supercharge your quality control with a developer-friendly automation framework like TestCafe.

 

Install:

npm install -g testcafe

 

Code:

import { Selector } from 'testcafe'; // first import testcafe selectorsfixture `Getting Started`// declare the fixture    .page `https://devexpress.github.io/testcafe/example`;  // specify the start page//then create a test and place your code theretest('My first test', async t => {    await t        .typeText('#developer-name', 'John Smith')        .click('#submit-button')        // Use the assertion to check if the actual header text is equal to the expected one        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');});

 

Run:

testcafe chrome test1.js

 

转载于:https://www.cnblogs.com/Answer1215/p/8331933.html

你可能感兴趣的文章
查看IIS-7.0中的进程PID
查看>>
关于Python的super用法研究
查看>>
训练1-A
查看>>
ionic4+angular7+cordova上传图片
查看>>
[转]常用字符与ASCII代码对照表
查看>>
Oracle数据库提权(低权限提升至dba)
查看>>
再说Java集合,subList之于ArrayList
查看>>
Hibernate-validator校验框架使用
查看>>
ArcGIS Server开发教程系列(8)ArcGIS API for Javascript-控件(小部件)(续)纯代码...
查看>>
16.10—第三周
查看>>
软件工程第八次作业-例行报告
查看>>
算法:背包问题处理
查看>>
学习随笔(2017-1-10)
查看>>
jieba学习
查看>>
单例模式(Singleton Pattern)
查看>>
再谈async与await
查看>>
无根树转有根树
查看>>
for循环:用turtle画一颗五角星
查看>>
协方差的意义和计算公式(转)
查看>>
Restful规范
查看>>