Metadata-Version: 2.4
Name: skyramp
Version: 1.3.55
Summary: module for leveraging skyramp cli functionality
Requires-Python: >=3.0
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
License-File: LICENSE
Requires-Dist: pyyaml >=6.0.2
Requires-Dist: typing_extensions >= 4.9.0
Requires-Dist: robotframework >= 4.1.2, <7.4
Requires-Dist: playwright >= 1.55

# Skyramp

`skyramp` is a pip module that provides functionalities to generate and execute a variety of functional tests (including smoke, contract, fuzz, integration, load, UI, and E2E tests). It also offers features for asserting scenarios in various test environments.

For more information about Skyramp, please visit [our website](https://skyramp.dev).

## Installation

To install Skyramp, please refer to the [installation instructions](https://skyramp.dev/docs/quickstart/install) to set up the Skyramp CLI as well as the required dependencies.

## Usage

To use `skyramp` please refer to the guide to [generate your first test](https:skyramp.dev/docs/quickstart/first-test-general). Once you generate your first integration test in Python using the Skyramp CLI, you can execute the test with the following command:

```bash
python3 -m pytest products_integration_test.py
```

## Recorded UI test data

Ledger-backed UI tests create scratch setup data and delete tracked resources at
scope exit. Configure these inputs before running a generated test:

- **Authentication:** when the recording contains authentication, set
  `SKYRAMP_STORAGE_STATE` to a Playwright storage-state file authenticated against
  the target environment. It is loaded before setup requests; recorded setup
  login actions are not replayed. The file must contain the cookies the API needs.
- **Backend addresses:** set each `SKYRAMP_TEST_SERVICE_URL_...` variable declared
  in the generated test when moving environments. For example, the origin
  `http://localhost:8000` uses `SKYRAMP_TEST_SERVICE_URL_HTTP_LOCALHOST_3A_8000`.
  Supply an origin (scheme, host and optional port). Changing the browser's
  `SKYRAMP_TEST_BASE_URL` alone does not configure separate API backends. Setup,
  capture and cleanup use the same backend override, including Docker rewriting.
- **Unique values:** supply unique form inputs through MCP's `uniqueUIFormInputs`.
  Marked setup values and their assertions share one runtime `uniqueSuffix`
  value. The generator cannot infer an application's uniqueness constraints.
- **Credentials in setup bodies:** recognized JSON credential fields read the
  environment variables named in the generated test. Recorded values are not
  emitted. Non-JSON setup bodies and non-string credential values are rejected.

Cookie authentication is supported. A bearer token stored only in localStorage
or a JavaScript-injected CSRF header does not authenticate API setup or cleanup;
configure request headers separately. A create whose runtime ID cannot be read
can leave a resource behind; the test fails and reports the affected collection.

Python uses `with skyramp.test_data_tracker(page)` and the page context's API
request client. Ordinary exceptions, including Playwright action timeouts, run
cleanup. A timeout mechanism that terminates the Python process cannot run the
context manager's cleanup.

