zoukankan      html  css  js  c++  java
  • [Test] Easy automated testing in NodeJS with TestCafe

    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 selectors
    
    fixture `Getting Started`// declare the fixture
        .page `https://devexpress.github.io/testcafe/example`;  // specify the start page
    
    
    //then create a test and place your code there
    test('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
  • 相关阅读:
    Delphi 学习笔记
    Extjs 4
    面向对象(OOP)
    Java基础
    Ubantu(乌班图)
    CentOS 6.3操作常识
    英语音标单元音篇
    英语音标双元音篇
    英语音标辅音篇
    Oracle补习班第一天
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8331933.html
Copyright © 2011-2022 走看看