Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Insta tests (Playwright + pytest)

  1. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate
    

    On Windows: .\venv\Scripts\activate

  2. Install dependencies: pip install -r requirements.txt

  3. Install browsers: playwright install

  4. Adjust tests/conftest.py:

    • Make sure runner_cmd launches your Flask app on 127.0.0.1:5001
    • Or run your Flask app manually on port 5001 before tests.
  5. Run tests: pytest tests/test_login.py -q

Notes:

  • If your app requires CSRF tokens for POST via fetch, tests should either:
    • Perform login via the HTML form (so CSRF token is present), or
    • Inject authentication cookie/session directly into context (see Playwright context.add_cookies), or
    • Provide the CSRF token to fetch headers (read from login page).
  • For debugging, set headless=False in conftest.py to watch browser.

About

Instagram test based on pytest with Playright and PageObject Model (POM)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages