Anaconda Hub CLI + Playwright Automation
This repository provides end-to-end automation for the Anaconda Hub login flow, combining the Anaconda CLI, Playwright API, and browser interactions. It covers:
- OAuth login via API + browser
- CLI-driven login (
anaconda auth login) against an already authenticated session - Verification of the success banner and URL path
-
Python 3.9+ (using
venv) or Miniconda/Anaconda (recommended for isolating dependencies). -
Playwright browsers:
pip install playwright playwright install
-
Python dependencies:
pip install -r requirements-pip.txt pip install -e .
-
.envshould live next toconftest.pyand be loaded automatically. -
Tests use pytest fixtures defined in
conftest.py:- ensureConda: installs or locates
condaon PATH. - api_request_context: Playwright API context against
ANACONDA_API_BASE. - urls / credentials: pulled from
.env.
- ensureConda: installs or locates
pytest -q --headedpytest -q tests/test_anaconda_login.py --headedpytest -q tests/test_anaconda_login_cli_flow.py --headedUse
-qfor concise output,--headedto see the browser.
test_anaconda_login.py: API → browser login + banner + URL assertiontest_anaconda_login_cli_flow.py: full end‑to‑end CLI+browser flow, capturing and completing the OAuth handshake
- If you change environment variables, restart your test session or shell.
- To debug CLI flow, watch the console logs: each step prints subprocess stdout/stderr.
- Ensure no other process is using the OAuth callback port (default or via
ANACONDA_OAUTH_CALLBACK_PORT).
Happy testing!