Testcafe: Add a recipe on how to test static files from a local file system

Created on 20 Oct 2016  路  10Comments  路  Source: DevExpress/testcafe

Sorry, but I did not find anything in the docs. Is it not possible to test local files? Like testContent.html?

docs Auto-locked enhancement

Most helpful comment

@lukasoppermann I run testcafe on local files using http-server as a simple server and concurrently to run both processes together and kill the server before exiting.

concurrently -r -k "http-server" "http-server ./dist -p 4000 -s" "testcafe chrome ./test/acceptance/**"

All 10 comments

Hi! TestCafe requires page to be served via HTTP(S) protocol. However, you can easily serve static pages by using packages like static-server

Ahh, okay, thanks. Maybe you could add a short "how to" to the docs?

@lukasoppermann Sure, we have Recipes section for such things. Feel free to contribute or if your're busy we'll take care of it. Meanwhile, I'll convert this issue into documentation feature request.

Thanks, I am not 100% how to do it, I would be better suited to read the recipe than to write it. 馃槈

@lukasoppermann No problem, we'll do it 馃槂 cc @VasilyStrelyaev

@lukasoppermann I run testcafe on local files using http-server as a simple server and concurrently to run both processes together and kill the server before exiting.

concurrently -r -k "http-server" "http-server ./dist -p 4000 -s" "testcafe chrome ./test/acceptance/**"

@renancouto Great solution, thanks!

@AlexanderMoskovkin created a PR for that if you like: https://github.com/DevExpress/testcafe/pull/970

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyBelym picture AndreyBelym  路  3Comments

fnlctrl picture fnlctrl  路  3Comments

Lukas-Kullmann picture Lukas-Kullmann  路  3Comments

devmondo picture devmondo  路  3Comments

calisven picture calisven  路  3Comments