Skip to content

Commit

Permalink
docs(cypress): copy edits (#3536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adnan Rahić authored Jan 18, 2024
1 parent 9978afc commit 8dd27e7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions docs/docs/tools-and-integrations/cypress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ The `@tracetest/cypress` npm package is a Cypress plugin that allows you to run
- Create an [environment token](/concepts/environment-tokens).
- Have access to the environment's [agent API key](/configuration/agent).

**Pokeshop Demo:** Clone the official [Tracetest Pokeshop Demo App Repo](https://github.com/kubeshop/pokeshop) to your local machine.
**Pokeshop Demo:**

**Docker**: Have [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.
Clone the official [Tracetest Pokeshop Demo App Repo](https://github.com/kubeshop/pokeshop) to your local machine.

```bash
git clone [email protected]:kubeshop/pokeshop.git
cd pokeshop
```

**Docker**:

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

## Project Structure

Expand All @@ -65,15 +74,18 @@ The project is built with Docker Compose.
The [Pokeshop Demo App](/live-examples/pokeshop/overview) is a complete example of a distributed application using different backend and front-end services, implementation code is written in Typescript.

The `docker-compose.yml` file in the root directory is for the Pokeshop Demo app and the OpenTelemetry setup.

And the `docker-compose.e2e.yml` includes the [Tracetest Agent](/concepts/agent).

Finally, the Cypress E2E tests can be found in `cypress/e2e/1-getting-started`.
Finally, the Cypress end-to-end tests can be found in `cypress/e2e/1-getting-started`.

## The Cypress Setup

The Cypress setup is pretty straightforward, it was generated by installing the Cypress dependency and configuring it from the UI after running `cypress open`. The configuration script looks like this:
The Cypress setup is generated by [installing Cypress locally](https://docs.cypress.io/guides/getting-started/installing-cypress) and configuring it from the UI after running `cypress open`.

```typescript
The configuration script file is `cypress.config.ts` looks like this:

```typescript title=cypress.config.ts
import { defineConfig } from "cypress";
import { config } from "dotenv"; // loads the environment variables

Expand All @@ -97,7 +109,7 @@ Before moving forward, run `npm i` in the root folder to install the dependencie

### The `home.cy` Test Script

The `home.cy` test script contains three different tests based on the Pokeshop Demo UI fetures, which are:
The `cypress/e2e/1-getting-started/home.cy` test script contains three different tests based on the Pokeshop Demo UI fetures, which are:

1. Create a Pokemon
2. Import a Pokemon (using an async process)
Expand Down Expand Up @@ -236,7 +248,7 @@ describe('Home', { defaultCommandTimeout: 60000 }, () => {

### Setting the Environment Variables

Copy the `.env.template` file to `.env` and add the Tracetest API token and agent tokens to the `TRACETEST_API_TOKEN` and `TRACETEST_AGENT_API_KEY` variables.
Copy the `.env.template` content into a new `.env` file. Add the [Tracetest API Token](/concepts/environment-tokens) and [Tracetest Agent API Key](/configuration/agent) to the `TRACETEST_API_TOKEN` and `TRACETEST_AGENT_API_KEY` variables.

### Starting the Pokeshop Demo App

Expand Down

0 comments on commit 8dd27e7

Please sign in to comment.