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
  • 相关阅读:
    CF 436D 最小生成树
    HDU 1847 博弈
    ZOJ 3666 博弈 SG函数
    zoj3675 BFS+状态压缩
    HDU 4734 F(x) 数位DP
    HDU 3709 Balanced Number 数位DP
    HDU 3555 数位DP
    HDU 4336 Card Collector
    HDU4340 Capturing a country DP
    CF 351A
  • 原文地址:https://www.cnblogs.com/Answer1215/p/8331933.html
Copyright © 2011-2022 走看看