In this tutorial, we'll create a test on localhost
. For now, you should use a service like ngrok or localtunnel to do this.
This is helpful for:
data-qa=search-button
to your site while creating a testWe are considering making testing localhost
easier. If this is something you're interested in, please contact us.
First, we need to install a service like ngrok or localtunnel. Install localtunnel with the following command:
npm install -g localtunnel
First we need to start a local runner.
Now create a URL to your site by running the following command. This will create a URL that points to localhost:3000
:
lt --port 3000
The result of this command is a URL you can use to create your test.
To stop running localtunnel, press CTRL+C
.
To create a test on localhost
, use the tunnel URL in your test.
const { context } = await launch();const page = await context.newPage();await page.goto("https://dry-sloth-7.loca.lt");
Now we are creating our test on localhost
. 🎉