Skip to content

Instantly share code, notes, and snippets.

@dmitryrck
Last active March 24, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitryrck/4bff9a92fa7c740b3f6e79e6a227b947 to your computer and use it in GitHub Desktop.
Save dmitryrck/4bff9a92fa7c740b3f6e79e6a227b947 to your computer and use it in GitHub Desktop.

Source: https://dmitryrck.com/getting-started-with-testcafe-and-docker/

$ mkdir tc
$ cd tc 
$ nvim thankyoupage.test.js
$ docker pull testcafe/testcafe
Using default tag: latest
latest: Pulling from testcafe/testcafe
7ea5c00be5c0: Pull complete 
ac898fa0a4c7: Pull complete 
35014ce94dba: Pull complete 
695352b6a653: Pull complete 
0e04b8869948: Pull complete 
Digest: sha256:82a1ba194b5fd60c8bb85f1ce7c008661988bd1292dcdc5c231cd4b386f6d9ef
Status: Downloaded newer image for testcafe/testcafe:latest
docker.io/testcafe/testcafe:latest
$ docker run --rm -v $(pwd):/app -w /app testcafe/testcafe firefox thankyoupage.test.js
 Running tests in:
 - Firefox 68.0 / Linux 0.0

 Thank you page
 ✓ should say thank you, john doe


 1 passed (6s)
$ 
import { Selector } from "testcafe"
fixture `Thank you page`
.page `http://devexpress.github.io/testcafe/example`
test("should say thank you, john doe", async t => {
await t
.typeText("#developer-name", "John Doe")
.click("#submit-button")
.expect(Selector("#article-header").innerText)
.eql("Thank you, John Doe!");
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment