Skip to content

The repository serves as a boilerplate for end 2 end testing

Notifications You must be signed in to change notification settings

w3tecch/test-cafe-e2e

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Build status devDependencies Status

Installation

You need to set up your development environment before you can do anything.

Install Node.js and NPM

Install yarn globally

npm install yarn -g

Then install the dependencies with

yarn install

Then copy the .env.example to .env and replace the setting in the file with your settings

cp .env.example .env

Usage

This repository uses the testcafe library to perform e2e tests.

Running the tests

You can run all tests by

npm test

or just run a single file by

npm run test:single <path-to-file>

npm run test:single tests/test-case.spec.ts

or run all test in live (watch) mode

npm run live

Write tests

All test are located in tests/. See example estate.ts. There is also a helper utility helper.ts which can be imported and provides some help. The helper.ts can also be extended.

I have lots of tests but would like to restart only one (only live command)

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.

Documentation

Here you can find help about element selection (e.g. get text)

Here you can find help about actions for elements (e.g. clicks)

Here you can find help about Aurelia specific stuff

CI

To run the all test headless use npm run ci.

Additional information about CI integrations can be found here.

Additional resources

Here a list of additional resources and useful plugins.