• This repository has been archived on 13/Feb/2019
  • Stars
    star
    118
  • Rank 289,117 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool for rapid test development with TestCafe

TestCafe Live

This module is now deprecated.

In TestCafe v1.0.0, we have integrated features from the testcafe-live module into the main TestCafe code. We have introduced the live mode, which provides experience similar to testcafe-live. See Live Mode for more information.

See instant feedback when working on tests.

What is it?

TestCafe Live provides a service that keeps the TestCafe process and browsers opened the whole time you are working on tests. Changes you make in code immediately restart the tests. That is, TestCafe Live allows you to see test results instantly.

TestCafe Live Demo

Watch the full review on YouTube.

Install

TestCafe Live is a CLI tool. To start using it, you need to install both testcafe and testcafe-live:

npm install testcafe testcafe-live -g

If you have already installed the testcafe module (version 0.18.0 or higher) you can install only testcafe-live:

npm install testcafe-live -g

This installs modules on your machine globally.

If necessary, you can add these modules locally to your project:

cd <your-project-dir>
npm install testcafe testcafe-live --save-dev

If you have installed testcafe-live locally to your project, add an npm script to package.json to run tests:

"scripts": {
  "testcafe-live": "testcafe-live chrome tests/"
},
npm run testcafe-live

How to use

Run tests with testcafe-live in the same way as you do with testcafe:

testcafe-live chrome tests/

Use standard testcafe arguments to run tests with testcafe-live. It opens the required browsers, run tests there, shows the reports and waits for your further actions.

TestCafe Live watches files that you pass as the src argument and files that are required in them. Once you make changes in files and save them, TestCafe Live immediately reruns your tests.

When the tests are done, browsers stay on the last opened page so you can work with it and explore it by using the browser's developer tools.

Commands

  • ctrl+s - stop current test run;
  • ctrl+r - restart current test run;
  • ctrl+w - turn off/on files watching;
  • ctrl+c - close opened browsers and terminate the process.

Features

  • TestCafe Live watches files with tests and helper modules rerunning the tests once changes are saved;
  • You can explore the tested page in the same browser when tests are finished;
  • If tests authenticate into your web application using User Roles, you do not need to execute login actions every test run, it saves your working time;
  • Use the same API as TestCafe;
  • CLI interface allows you to stop test runs, restart them and pause file watching;
  • You can use TestCafe Live with any browsers (local, remote, mobile or headless).

Why TestCafe Live is a separate repository

TestCafe Live is developed by the TestCafe Team as an addition to the main TestCafe module. Keeping it a separate project provides many benefits:

  • We can deliver new functionality once it's ready regardless of the TestCafe release cycle;
  • We can get feedback early and make new releases as fast as necessary to provide the best experience for developers;
  • We can try experimental features that may be added to TestCafe later and get early feedback about them.

Will this functionality be released in the main TestCafe tool

We will decide when we have more feedback and when we consider TestCafe Live finished and stable. Since TestCafe is a test runner it is possible that live mode will exist as an additional tool.

Tips and Tricks

Which path should I pass as the src argument

You can pass either a path to a file with tests or a path to a directory.

If you specify a single file, testcafe-live will watch changes in it. Additionally, it will watch changes in files that are required from this file. Once you save changes in this file or in one of the required files, tests are rerun.

testcafe-live chrome tests/test.js

You can also pass a path to a directory where your files with tests are stored.

testcafe-live chrome tests/

TestCafe will watch all files in this directory and all files that are required from there and restart all tests once one of them is changed.

I have lots of tests but would like to restart only one

When you work on a particular test, just add the .only call for it:

test.only('Current test', async t => {});

Once you are done with it and ready to run the whole suite, just remove the .only directive and save the file.

Should I use TestCafe Live or TestCafe for CI

TestCafe Live is designed to work with tests locally. So use the main testcafe module for CI.

How avoid performing authentication actions every run

If you test a page with a login form, you need to enter credentials at the beginning of each test. TestCafe provides User Roles to impove your experience here.

At first, create a user role with authentication steps in a separate file and export it:

// roles.js

import { Role, t } from 'testcafe';

export loggedUser = Role('http://mysite/login-page', async t => {
  await t
    .typeText('#login-input', 'my-login')
    .typeText('#password-input', 'my-input')
    .click('#submit-btn');
}, { preserveUrl: true });

Import the role into a file with tests and use it in the beforeEach function:

// test.js
import { loggedUser } from './roles.js';

fixture `Check logged user`
    .page `http://mysite/profile`
    .beforeEach(async t => {
      await t.useRole(loggedUser);
    });
    
test('My test with logged user', async t => {
    // perform any action here as a logged user
});

When you run tests with TestCafe Live for the first time, role initialization steps will be executed and your tests will run with an authorized user profile. If you change the test file, the next run will skip role initialization and just load the page with saved credentials. If you change code in a role, it will be 'refreshed' and role initialization steps will be executed at the next run.

I'd like to make changes in several files before running tests

Just focus your terminal and press ctrl+p. TestCafe Live will not run tests until your press ctrl+r.

Feedback

Report issues and leave proposals regarding this 'live' mode in this repository. Please address all issues about TestCafe to the main TestCafe repository. If you like this mode please let us know. We will be glad to hear your proposals on how to make it more convinient. Feel free to share your experience with other developers.

Author

Developer Express Inc. (https://devexpress.com)

More Repositories

1

testcafe

A Node.js tool to automate end-to-end web testing.
JavaScript
9,749
star
2

devextreme-reactive

Business React components for Bootstrap and Material-UI
TypeScript
2,057
star
3

DevExtreme

HTML5 JavaScript Component Suite for Responsive Web Development
JavaScript
1,781
star
4

devextreme-angular

Angular UI and data visualization components
TypeScript
552
star
5

Blazor

DevExpress UI for Blazor
C#
376
star
6

AjaxControlToolkit

The ASP.NET AJAX Control Toolkit is a classic set of ASP.NET WebForms extensions.
JavaScript
286
star
7

devextreme-vue

Vue UI and data visualization components
TypeScript
262
star
8

DevExpress.Mvvm.Free

DevExpress MVVM Framework is a set of components helping to work in the Model-View-ViewModel pattern in WPF.
C#
221
star
9

testcafe-react-selectors

TestCafe selector extensions for React apps.
JavaScript
202
star
10

testcafe-hammerhead

A powerful web-proxy used as a core for the TestCafe testing framework. 🔨 😃
JavaScript
164
star
11

devextreme-react

React UI and data visualization components
JavaScript
154
star
12

XPO

DevExpress eXpress Persistent Objects (XPO) ORM for .NET Framework / .NET Core / .NET Standard 2.0
JavaScript
153
star
13

DevExtreme.AspNet.Data

DevExtreme data layer extension for ASP.NET
C#
137
star
14

devextreme-angular-template

Responsive Application Layout Templates​ based on DevExtreme Angular Components
CSS
114
star
15

obsolete-devextreme-examples

A set of sample applications that will help you to get started.
TypeScript
109
star
16

testcafe-vue-selectors

TestCafe selector extensions for Vue.js apps.
JavaScript
103
star
17

testcafe-browser-provider-browserstack

This is the BrowserStack browser provider plugin for TestCafe.
JavaScript
87
star
18

bootstrap-aspnetcore-starter

This repository is obsolete. See README for details.
HTML
81
star
19

web-dashboard-demo

The following application contains the DevExpress Dashboard Component for Angular. The client side is hosted on the GitHub Pages and gets data from the server side that hosts on DevExpress.com.
TypeScript
69
star
20

devextreme-ui-template-gallery

DevExtreme UI Template Gallery
TypeScript
67
star
21

Logify.Alert.Clients

Logify Alert - crash reporting / exception handling service
C#
66
star
22

dashboard-extension-online-map-item

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
TypeScript
63
star
23

dashboard-extension-webpage-item

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
TypeScript
62
star
24

dashboard-extension-funnel-d3-item

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
JavaScript
61
star
25

bootstrap-themes

Themes for Bootstrap
HTML
58
star
26

blazor-training-samples

This repository is obsolete. See README for details.
HTML
54
star
27

dotnet-eud

DevExpress .NET Controls Documentation for End Users
53
star
28

testcafe-examples

Ready-to-run examples for TestCafe
JavaScript
49
star
29

testcafe-browser-provider-electron

This is the Electron browser provider plugin for TestCafe.
JavaScript
49
star
30

devextreme-cli

A command-line interface for DevExtreme
TypeScript
49
star
31

dashboard-extension-parameter-item

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
JavaScript
48
star
32

DevExtreme-PHP-Data

DevExtreme data layer extension for PHP
PHP
47
star
33

devextreme-vue-template

Responsive Application Layout Templates​ based on DevExtreme Vue Components
CSS
46
star
34

aspnet-security-bestpractices

A project illustrating security best practices for DevExpress ASP.NET controls. See the README for detailed information.
C#
46
star
35

aspnet-office-solutions

A set of solutions for building scalable web applications containing DevExpress ASP.NET Spreadsheet and Rich Text Editor controls.
C#
44
star
36

dashboard-extension-dashboard-panel

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
TypeScript
43
star
37

devextreme-documentation

DevExtreme documentation
JavaScript
42
star
38

devextreme-demos

DevExtreme technical demos
C#
40
star
39

bower-devextreme

This repo is for distribution of DevExtreme Complete product.
CSS
40
star
40

DevExpress.Mvvm.CodeGenerators

DevExpress ViewModel generator
C#
40
star
41

netcore-winforms-demos

This repository contains the Outlook Inspired and Stock Market Trader demo applications that support .Net Core 3.
C#
39
star
42

DevExtreme.AspNet.TagHelpers

[OBSOLETE] See https://js.devexpress.com/Overview/Mvc/
C#
37
star
43

dashboard-extension-simple-table

â›” DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
JavaScript
37
star
44

testcafe-action

TestCafe test runner for GitHub Actions
JavaScript
33
star
45

testcafe-browser-provider-saucelabs

This is the Sauce Labs browser provider plugin for TestCafe.
JavaScript
33
star
46

testcafe-angular-selectors

TestCafe selector extensions for Angular apps.
JavaScript
32
star
47

testcafe-browser-tools

Browser manipulation utils for TestCafe.
C++
30
star
48

wpf-themedesigner-app

This is a publish-only repository and all pull requests are ignored. Please follow the Support page for any of your improvements.
28
star
49

devextreme-react-template

Responsive Application Layout Templates​ based on DevExtreme React Components
CSS
28
star
50

golfclub

GolfClub: Angular and DevExtreme sample application
TypeScript
24
star
51

Reporting.Import

An import tool designed to convert third party reports into an internal format supported by DevExpress Reports
C#
23
star
52

devextreme-schematics

Schematics for DevExtreme Angular applications.
TypeScript
20
star
53

ThemeBuilder

A tool for creating custom DevExtreme themes
TypeScript
19
star
54

dashboard-extensions

This repository is obsolete. See README for details.
TypeScript
18
star
55

dataprocessingapi-mvp-example

DevExpress Data Processing API is a prototype (MVP) of a new product and is therefore not yet a part of the DevExpress product line. The prototype supports only v21.2 and is not production-ready. Use it at your own risk.
C#
18
star
56

BigQueryProvider

The DevExpress BigQueryProvider driver is no longer maintained and supported. Use Google's official ODBC driver to obtain BigQuery data in your .NET apps.
C#
15
star
57

winui-demos

DevExpress WinUI 3 demos that show how to use DevExpress WinUI components and tools, including the Data Grid, Reporting, Scheduler, Charting, and Data Editors.
C#
15
star
58

DevExtreme.AspNet.Mvc-Demos-NETCore

[OBSOLETE] See https://js.devexpress.com/Overview/Mvc/
C#
15
star
59

OBSOLETE_EF-Core-Security

Security system for Entity Framework Core with demos
CSS
15
star
60

device-specs

JavaScript
14
star
61

angular-testcafe

Angular builder to run testcafe tests
TypeScript
14
star
62

match-url-wildcard

Module to match url by pattern
JavaScript
13
star
63

DevExtreme-Intl

Integrates ECMAScript Internationalization API with DevExtreme
JavaScript
13
star
64

dx-election

DX Election: Angular and DevExtreme sample application
TypeScript
13
star
65

SalesViewer

TypeScript
12
star
66

netcore-wpf-demos

Please visit https://www.devexpress.com/dotnet-core-3 to download the most recent version of the DevExpress .NET Core installer (contains shipping versions of all DevExpress .NET Core demos).
12
star
67

gulp-testcafe

Run TestCafe tests using Gulp.
JavaScript
11
star
68

testcafe-studio-docs

[deprecated] Documentation for TestCafe Studio
11
star
69

XAF-Blazor-Kubernetes-example

This example shows how to deploy XAF Blazor application to the Kubernetes cluster and to enable horizontal autoscaling
C#
11
star
70

bower-xtrareports-js

JavaScript
10
star
71

testcafe-reporter-xunit

This is the xUnit reporter plugin for TestCafe.
JavaScript
10
star
72

testcafe-reporter-json

This is the JSON reporter plugin for TestCafe.
JavaScript
9
star
73

gimp-dx-screenshot

GIMP Scripts for Screenshot Processing
Scheme
7
star
74

winforms-training-samples

C#
7
star
75

testcafe-aurelia-selectors

TesCafe selector extensions for Aurelia apps.
JavaScript
6
star
76

testcafe-reporter-spec

This is the Spec reporter plugin for TestCafe.
JavaScript
6
star
77

testcafe-gh-page-assets

This repository contains assets used in the TestCafe GitHub page.
SCSS
6
star
78

generator-testcafe-reporter

Scaffold out a TestCafe reporter.
JavaScript
6
star
79

DevExtreme.AspNet.Data.NgHttpClientSample

Refer to https://github.com/DevExpress/DevExtreme.AspNet.Data/issues/311
TypeScript
6
star
80

bower-devextreme-web

[OBSOLETE] See https://github.com/DevExpress/bower-devextreme
JavaScript
5
star
81

TestCafe-Scheduler

Schedule TestCafe testing tasks
JavaScript
5
star
82

testcafe-legacy-api

Legacy API support for TestCafe.
JavaScript
5
star
83

testcafe-reporter-list

This is the List reporter plugin for TestCafe.
JavaScript
5
star
84

TestCafe-BrowserStack

Add remote workers from the BrowserStack web service to the TestCafe.
JavaScript
5
star
85

testcafe-browser-provider-phantomjs

This is the PhantomJS browser provider plugin for TestCafe.
JavaScript
5
star
86

devextreme-renovation

TypeScript
5
star
87

aspnet-documentmanagement-bestpractices

A project illustrating best practices of using DevExpress ASP.NET control to create the responsive document management application. See the README for detailed information.
C#
5
star
88

saucelabs-connector

JavaScript
4
star
89

xaf-blazor-app-load-testing-example

XAF Blazor Server application load testing example
C#
4
star
90

TODO-App-via-DevExpress-MVVM

Simple TODO Application powered by DevExpress WinForms MVVM.
Visual Basic .NET
4
star
91

testcafe-reporter-minimal

This is the Minimal reporter plugin for TestCafe.
JavaScript
4
star
92

DevExtreme-Data-Parse

[OBSOLETE] See https://js.devexpress.com/Documentation/Guide/Data_Layer/Data_Layer/
JavaScript
4
star
93

create-testcafe

JavaScript
3
star
94

TestCafe-RPC

RPC library for the TestCafé.
JavaScript
3
star
95

vscode-rushsnippets

Templates for TypeScript, React and Redux projects that help you write your code faster
3
star
96

TestCafe-Wrappers

TestCafe wrappers are a set of JavaScript classes that help you work with the DevExpress ASP.NET controls in TestCafe
JavaScript
3
star
97

wpf-training-samples

C#
3
star
98

DevExtremeAddon

[OBSOLETE] This plugin setups the CordovaView in the Windows Phone application.
C#
2
star
99

TestCafe-RemoteWorkers

How to make the Continuous Integration system work with remote workers with a single TestCafe instance
JavaScript
2
star
100

eslint-plugin-hammerhead

JavaScript
2
star