Skip to content

Commit

Permalink
chore(examples/docs): updating the playwright trigger example and rec…
Browse files Browse the repository at this point in the history
…ipe (#3972)

updating the playwright trigger example and recipe
  • Loading branch information
xoscar authored Aug 15, 2024
1 parent fd0d364 commit a59836e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ Another big benefit of using traces as test specs is that you can:
**Tracetest Account**:

- Sign up to [`app.tracetest.io`](https://app.tracetest.io) or follow the [get started](/getting-started/installation) docs.
- Create an [environment](/concepts/environments).
- Create an [environment token](/concepts/environment-tokens) with **admin role**.
- Copy the environment id to your clipboard.
- Have access to the environment's [agent API key](https://app.tracetest.io/retrieve-token).

**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.

Expand All @@ -63,13 +61,12 @@ git clone https://github.com/kubeshop/tracetest
cd tracetest/examples/tracetest-playwright-engine
```

Follow these instructions to run the example:
Follow these instructions to run the quick start:

1. Log into the [Tracetest app](https://app.tracetest.io/).
2. Copy the `.env.template` file to `.env`.
3. Fill out the [TRACETEST_API_TOKEN](https://docs.tracetest.io/concepts/environment-tokens) and [TRACETEST_ENVIRONMENT_ID](https://docs.tracetest.io/concepts/agent) details by editing your `.env` file. You can find these values in the Settings area for your environment.
4. Run `docker compose run tracetest-run`.
5. Follow the link in the terminal with the results to view the test run.
1. Copy the `.env.template` file to `.env`.
2. Fill out the [TRACETEST_TOKEN and ENVIRONMENT_ID](https://app.tracetest.io/retrieve-token) details by editing your `.env` file.
3. Run `docker compose run tracetest-run`.
4. Follow the links in the output to view the test results.

## Project Structure

Expand All @@ -84,7 +81,7 @@ docker-compose.yaml
/resources
apply.sh
datastore.yaml
import-pokemon.yaml
test.yaml
run.sh
script.js
```
Expand All @@ -100,7 +97,7 @@ The example provisions the following resources:

### Import Pokemon Test

```yaml title="resources/import-pokemon.yaml"
```yaml title="resources/test.yaml"
type: Test
spec:
id: import-pokemon
Expand Down Expand Up @@ -188,7 +185,7 @@ apply() {

echo "Applying Resources"
tracetest apply datastore -f /resources/datastore.yaml
tracetest apply test -f /resources/import-pokemon.yaml
tracetest apply test -f /resources/test.yaml
}

apply
Expand All @@ -211,7 +208,7 @@ run() {
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID

echo "Running Trace-Based Tests..."
tracetest run test -f /resources/import-pokemon.yaml
tracetest run test -f /resources/test.yaml
}

run
Expand Down
6 changes: 4 additions & 2 deletions examples/tracetest-playwright-engine/.env.template
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
TRACETEST_API_TOKEN=
TRACETEST_ENVIRONMENT_ID=
# Get the required information here: https://app.tracetest.io/retrieve-token

TRACETEST_TOKEN="<YOUR_TRACETEST_TOKEN>"
TRACETEST_ENVIRONMENT_ID="<YOUR_ENV_ID>"
7 changes: 4 additions & 3 deletions examples/tracetest-playwright-engine/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
volumes:
- ./resources:/resources
environment:
TRACETEST_API_KEY: ${TRACETEST_API_TOKEN}
TRACETEST_API_KEY: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
entrypoint:
- bash
Expand All @@ -25,7 +25,7 @@ services:
volumes:
- ./resources:/resources
environment:
TRACETEST_API_KEY: ${TRACETEST_API_TOKEN}
TRACETEST_API_KEY: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
entrypoint:
- bash
Expand All @@ -38,7 +38,8 @@ services:

tracetest-agent:
environment:
TRACETEST_API_KEY: ${TRACETEST_API_TOKEN}
TRACETEST_API_KEY: ${TRACETEST_TOKEN}
TRACETEST_ENVIRONMENT_ID: ${TRACETEST_ENVIRONMENT_ID}
image: kubeshop/tracetest-agent:latest
networks:
default: null
Expand Down
2 changes: 1 addition & 1 deletion examples/tracetest-playwright-engine/resources/apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply() {

echo "Applying Resources"
tracetest apply datastore -f /resources/datastore.yaml
tracetest apply test -f /resources/import-pokemon.yaml
tracetest apply test -f /resources/test.yaml
}

apply
2 changes: 1 addition & 1 deletion examples/tracetest-playwright-engine/resources/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ run() {
tracetest configure --token $TOKEN --environment $ENVIRONMENT_ID

echo "Running Trace-Based Tests..."
tracetest run test -f /resources/import-pokemon.yaml
tracetest run test -f /resources/test.yaml
}

run

0 comments on commit a59836e

Please sign in to comment.