/publish_fb_status

Automation in Python

Primary LanguagePython

Publish Facebook Status

PreRequisites

  1. Python3 (Python/MAC / Python/Windows)
  2. FB_USERNAME variable key is set in your system env vars
  3. FB_PASSWORD variable key is set in your system env vars
  4. Python Virtual Environment (Python Virtual Environment)
  5. ChromeDriver installed in your Python Virtual Environment (ChromeDriver)

Setup

  1. Clone the repo automation_exercise
    git clone https://github.com/eliran-shani/automation_exercise.git
  2. Create & Activate Virtual Environment
    python3 -m venv .venv
    source ./venv/bin/activate
  3. Install requirements.txt pip3 install -r requirements.txt
  4. Inject ChromeDriver binary into /.venv/bin folder

Usage

  • Run all tests (default chrome browser):
    pytest

  • Run all tests using a specific browser (only chrome supported at the moment:
    pytest --browser chrome

  • Run all tests against a specific url (default Facebook URL):
    pytest --url localhost:9090

  • Run tests by marker:
    pytest -m acceptance
    pytest -m regression

  • Run a specific test:
    pytest tests/test_acceptance_publish_status.py

*Optional: Facebook test user:
username: test_mkwaaug_user@tfbnw.net / pass: 1qaz@WSX

Folder structure convention

.
├── attachments                         # All attachments used throghout the test
├── common                              # All reuseable functions
├── downloads                           # All relevant downloadables while the test is running
├── tests                               # All related tests
├── .gitignore                          # Github ignore file
├── conftest                            # Pytest configuration file
├── pytest.ini                          # One place to register all custom markers
├── requirements.txt                    # Python packages required to run this project                           
└── README.md