# List Tests — TestLocally

> Returns a list of tests in TestLocally. See the documentation

- Key: `testlocally-list-tests`
- Type: Action (Read-only)
- Version: 0.0.2
- App: TestLocally (`testlocally`) — https://pipedream.com/apps/testlocally.md
- This page (HTML): https://pipedream.com/apps/testlocally/actions/list-tests
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/testlocally/actions/list-tests/list-tests.mjs

## Description

Returns a list of tests in TestLocally. [See the documentation](https://testlocally.readme.io/reference/api_v0_recent_tests)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `start` | `string` | No | The start time specification. Example: 1 month ago |
| `end` | `string` | No | The end time specification. Example: now |
| `owners` | `string[]` | No | A list of userIds of the owners of the tests to retrieve |
| `locations` | `string[]` | No | A list of locations of the tests to retrieve |
| `target` | `string` | No | The target URL of the tests to retrieve |
| `scheduled` | `string` | No | The scheduled status of the tests to retrieve. Values: 'yes', 'no', or a specific schedule ID |
| `browser` | `string` | No | The browser of the tests to retrieve |
| `viewport` | `string` | No | The viewport of the tests to retrieve |
| `maxResults` | `integer` | No | The maximum number of tests to retrieve |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "testlocally",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "testlocally-list-tests",
  arguments: {
    start: "Start",
    end: "End",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "testlocally-list-tests",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    testlocally: { authProvisionId: "apn_xxxxxxx" },
    start: "Start",
    end: "End",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "testlocally-list-tests",
    "configured_props": {
      "testlocally": { "authProvisionId": "apn_xxxxxxx" },
      "start": "Start",
      "end": "End"
    }
  }'
```

---

- App: https://pipedream.com/apps/testlocally.md · All apps: https://pipedream.com/apps
