# Environment Information

The following environment is an `Ubuntu 22.04 LTS` machine.

The runtimes available are:
- Python `python`
- Node (may be available, check first) `node`

## Pre-installed tools
- Git `git`
- Github CLI `gh` / Gitlab CLI `glab`
- AWS CLI `aws`

IMPORTANT: You have a `GITHUB_TOKEN` environment variable available to you which can be used to authenticate with `gh` and `git` cli.

## Installation of runtimes

- If you require bun, run the `install-bun.sh <VERSION>` (e.g `install-bun.sh 1.1.29`, or `install-bun.sh latest`) script you can find in the `/bundle` directory.
- If you require node, run the `install-node.sh <VERSION>` (e.g `install-node.sh 20.11.0`) script you can find in the `/bundle` directory.

## Playwright Instructions

Playright should be used when requiring interaction with a website or screenshots.

To install playwright run:

```bash
npx playwright install
```

> When using playwright, the width and height of the browser viewport should be 1440x1800.

## Screenshot Instructions

> When using playwright, in order to take a screenshot of a full page, use the following script during a playwright browser evaluation instead of just the `fullPage true` option.

```javascript
async () => {
  const step = Math.floor(window.innerHeight * 0.9);
  let y = 0;
  const max = document.body.scrollHeight;
  while (y < max - window.innerHeight) {
    window.scrollBy(0, step);
    y = window.scrollY;
    await new Promise(r => setTimeout(r, 400));
  }
  window.scrollTo(0, document.body.scrollHeight);
  await new Promise(r => setTimeout(r, 800));
  return { height: document.body.scrollHeight, viewport: { w: window.innerWidth, h: window.innerHeight } };
}
```