Projects

API Reference - Projects resource

This namespace allows you to retrieve information about Currents Projects:

  • Get the list of projects for your organization

  • Get specific project details

  • Get the list of runs for a project

List Projects

GET v1/projects

Query Parameters

Name
Type
Description

limit

number

Maximum number of results to return (1-100). Default: 10

starting_before

string

Pagination cursor for fetching results before this cursor. See Pagination

ending_after

string

Pagination cursor for fetching results after this cursor. See Pagination

{
    "status": "OK",
    "has_more": false,
    "data": [{
        "projectId": "emdaGd", // project id
        "name": "Hello Currents", // project name
        "createdAt": "2022-01-14T16:15:18.852Z", // creation date
        "inactivityTimeoutSeconds": 7200, // timeout value
        "cursor": "61e1a196954ca800138aae97", // pagination cursor
        "failFast": true // enable fail-fast strategy
    }]
}

Get Project

GET v1/projects/:projectId

Path Parameters

Name
Type
Description

projectId*

string

Project ID

{
    "status": "OK",
    "data": {
        "projectId": "emdaGd", // project id
        "name": "Hello Currents", // project name
        "createdAt": "2022-01-14T16:15:18.852Z", // creation date
        "inactivityTimeoutSeconds": 7200, // timeout value
        "failFast": true // enable fail-fast strategy
    }
}

List Project Runs

GET v1/projects/:projectId/runs

Path Parameters

Name
Type
Description

projectId*

string

Project ID

Query Parameters

Name
Type
Description

limit

number

Maximum number of results to return (1-50). Default: 10

starting_before

string

Pagination cursor for fetching results before this cursor. See Pagination

ending_after

string

Pagination cursor for fetching results after this cursor. See Pagination

{
    "status": "OK",
    "has_more": true,
    "data": [
        {
            "runId": "0a91f41ed60abfab9ea509e866ba9d6d", // run ID
            "cursor": "62c5468c239c55bd1a1a97ce", // pagination cursor
            "projectId": "bAYZ4a", // project ID for this run
            "createdAt": "2022-07-06T08:23:40.939Z", // creation time
            "completionState": "COMPLETE", // "CANCELED" | "COMPLETE" | "IN_PROGRESS" | "TIMEOUT"
            "status": "FAILED", // "FAILED" | "FAILING" | "PASSED" | "RUNNING"
            "tags": ["tagA", "tagB"], // tags
            "durationMs": 2443644, // run duration in ms
            // timeout data
            "timeout": {
                "isTimeout": true, // whether the run timed out
                "timeoutValueMs": 3600000 // value used for timeout
            },
            // cancellation data
            "cancellation": {
                "actor": "api-request",
                "canceledAt": "2022-06-28T07:24:58.948Z",
                "reason": "apiRequest"
            },
            // Groups progress within the run
            "groups": [
                {
                    "groupId": "regression-c64c5c2b976aa5047507cb8badc889aac7539a3b-2621389820-1", 
                    "platform": {
                        "osName": "linux",
                        "osVersion": "Debian - 10.11",
                        "browserName": "Chrome",
                        "browserVersion": "97.0.4692.71"
                    },
                    // Instances / specs progress
                    "instances": {
                        "overall": 73,
                        "claimed": 73,
                        "complete": 73,
                        "passes": 62,
                        "failures": 11
                    },
                    // Tests progress
                    "tests": {
                        "overall": 264,
                        "passes": 230,
                        "failures": 16,
                        "pending": 12,
                        "skipped": 6,
                        "retries": 3,
                        "flaky": 3
                    }
                }
            ],
            "meta": {
                // CI Build ID associated with the run
                "ciBuildId": "regression-c64c5c2b976aa5047507cb8badc889aac7539a3b-2621389820-1",
                // Git commit information for the run
                "commit": {
                    "sha": "c64c5c2b976aa5047507cb8badc889aac7539a3b",
                    "branch": "feat/branch",
                    "authorName": "John Doe",
                    "authorEmail": "[email protected]",
                    "message": "Commit message",
                    "remoteOrigin": "https://github.com/nasa/monorepo",
                    "defaultBranch": null
                },
                // Framework details
                "framework": {
                    "type": "pw" | "cypress" | "jest" | "postman" | "vitest",
                    "version": "1.52.0", // test runner version
                    "clientVersion": "1.12.0" // currents client version
                }
            }
        }
    ]
}

Get Project Insights

GET v1/projects/:projectId/insights

Returns aggregated metrics for the project. See Insights and Analytics.

Path Parameters

Name
Type
Description

projectId*

string

Project ID

Query Parameters

Name
Type
Description

date_start*

string (ISO 8601)

Start date for filtering the query results

date_end*

string (ISO 8601)

End date for filtering the query results

resolution

enum

Aggregation resolution. Values: "1w", "1d"

tags[]

string

Filter by tag names. Multiple values: tags[]=valueA&tags[]=valueB

branches[]

string

Filter by branch names. Multiple values: branches[]=valueA&branches[]=valueB

type ResponsePayload = {
  status: "OK";
  data: ProjectInsights;
};

type ProjectInsights = {
  projectId: string;
  orgId: string;
  dateStart: string; // ISO date string
  dateEnd: string; // ISO date string
  resolution: string[]; 
  tags: string[];
  authors: string[];
  branches: string[];
  results: {
    overall: {
      runs: RunMetric;
      tests: TestMetric;
    };
    timeline: {
      [timestamp: number]: {
        runs: RunMetric;
        tests: TestMetric;
      };
    };
  };
};

type RunMetric = {
  total: number; // total number of runs for the period
  cancelled: number; // number of cancelled runs for the period
  timeouts: number; // number of timed-out runs for the period
  completed: number; // number of completed runs for the period
  failed: number; // number of failed runs for the period
  passed: number; // number of passed runs for the period
  avgDurationSeconds: number; // average duration of completed runs for the period
};

type TestMetric = {
  total: number; // total number of tests for the period
  failed: number; // number of failed tests for the period
  passed: number; // number of passed tests for the period
  pending: number; // number of pending tests for the period
  skipped: number; // number of skipped tests for the period
  flaky: number; // number of flaky tests for the period
};

Last updated

Was this helpful?