Skip to content

An example Testcafe project, chock full of e2e testy goodness

License

Notifications You must be signed in to change notification settings

qualityshepherd/testcafe-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E2E Tests

Testcafe Example

Example e2e tests (some of which are slightly silly) written in Testcafe, that:

  • use a page object pattern (now with 100% less class)
  • are es6y
  • use async/await
  • run in parallel
  • run on multiple browsers
  • run headlessly
  • run tests on BrowserStack

Setup

  1. clone clone [email protected]:qualityshepherd/testcafe-example.git
  2. install npm i

Run

  • run npm test to watch in browser, or
  • npm run ci to run parallel, headless, and retry fails on Chrome
  • npm run browserstack to run tests in the cloud (requires an account and env keys to be set)
  • npm run to see more run options

Feedback

Testcafe is really good; I used it for years but it has two issues that ultimately became deal-breakers for me:

  1. no beforeAll which sucks on it's own but also means you have to use Roles... which really sucks.
  2. they shard/thread tests at the test level instead of the file level.

Test Run Gif