Metadata-Version: 2.4
Name: autoplay-l7
Version: 0.1.9
Summary: Playwright automation scaffold installer for L7 projects
Author-email: L7 Informatics <koushik.balabadruni@l7informatics.com>
License: MIT
Keywords: playwright,automation,testing,scaffold
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# autoplay-l7

Playwright automation scaffold installer for L7 projects.

## Installation

```bash
pip install autoplay-l7
```

## Usage

Inside your project root, run:

```bash
autoplay init
```

### Behavior

- If `tests/` **exists** → installs scaffold into `tests/automation/`
- If `tests/automation/` **already exists** → merges scaffold files into it (existing files are not deleted)
- If no `tests/` folder exists → creates `tests/automation/` with the full scaffold

### Options

```
autoplay init [--target DIR]

  --target DIR   Project root to install into (default: current directory)
```

### Example

```bash
cd my-project/
autoplay init
# → tests/automation/ is created or updated
```

## What gets installed

```
tests/automation/
├── conftest.py
├── pytest.ini
├── requirements.txt
├── playwright.sh
├── utils/
│   ├── commands.py
│   ├── networks.py
│   └── utility_functions.py
├── pages/
│   ├── base_page.py
│   ├── homepage.py
│   └── ...
├── e2e/
│   ├── base_tc.py
│   ├── placeholder/
│   └── Test case Templates/
└── fixtures/
    └── index_seed.yml
```

## Configuration

### Port & Host

The automation connects to your app using environment variables. The defaults are defined in `tests/automation/pages/base_page.py`:

```python
DEFAULT_PORT = "8002"

HOST = os.getenv("ESP_HOST", "localhost")
PORT = os.getenv("ESP_PORT", DEFAULT_PORT)
```

**To change the port**, update `DEFAULT_PORT` in `base_page.py` to match the port exposed by your Docker container:

```python
DEFAULT_PORT = "8080"  # replace with your Docker port
```

This single change propagates automatically to:
- The browser navigation URLs (`BasePage.build_url`)
- The `esp` CLI commands in `utils/commands.py`
- The default value in `playwright.sh`

Alternatively, you can pass the port at runtime without changing any file:

```bash
ESP_PORT=8080 ./playwright.sh -t "e2e/placeholder/placeholder.py"
```

Or for Docker mode:

```bash
ESP_HOST=localhost ESP_PORT=8080 ./playwright.sh -t "e2e/placeholder/placeholder.py" -D
```

## Running tests

```bash
cd tests/automation/
./playwright.sh -t "e2e/placeholder/placeholder.py"
```

For Docker mode:

```bash
./playwright.sh -t "e2e/placeholder/placeholder.py" -D
```
