Skip to content

sanosuke009/PoseidonFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poseidon Framework

A trident to penetrate the test automation barrier! One stop test automation framework for all types of application with 3-pronged approach!

Project Poseidon

Features:

  1. Playwright with Pytest -> To Automate Web applications -> In Progress
    1. Allure report plugin -> DONE
    2. Screenshot of each validation step -> DONE
    3. Playwright default html report -> DONE
    4. Video recording of the execution -> DONE
    5. Parallel execution -> DONE
    6. Integration with CI -> DONE
    7. Segregation of pages and configured context -> DONE
    8. Integration with Github Actions -> DONE
    9. Publish Allure-Reports on Github Pages -> DONE
  2. Playwright with Pytest -> To Automate API -> TODO
  3. PyWinAuto with Pytest -> To Automate Desktop applications -> TODO
  4. Appium with Pytest -> To Automate Mobile applications -> TODO

Installation Required:

Either you can run

    python3 -m pip install -r requirements.txt
    python3 -m playwright install

Or, if you know what you are doing, then run

    python3 -m pip install pytest
    python3 -m pip install pytest-xdist
    python3 -m pip install allure-pytest
    python3 -m pip install pytest-playwright
    python -m pip install pytest-rerunfailures
    python3 -m playwright install  #For installing Chromium, Firefox and Webkit browsers

If allure is not recognized as powershell command Troubleshooting:

  1. For Windows install nvm from here
  2. Install node using nvm
    nvm install <version>
    nvm use <installed version>
    npm install -g allure-commandline --save-dev
  1. If you find authentication error then
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  1. Now allure serve command should work

VENV Troubleshooting:

In VSCode, there is no default option to create virtual environment in Python. So follow below steps to create one:

  1. Open Visual Studio Code in your project's folder.
  2. In the terminal:
# venv is your virtual environment name
# You can also use py -3 -m venv .venv
python -m venv venv
  1. After the virtual environment is generated, use the following command to activate the virtual environment
# venv is your virtual environment name
venv\scripts\activate
  1. If you get error message after running above command, please do this:

    1. Change the execution policies by adding -ExecutionPolicy Bypass args. in vscode you will have to create a shell profile with these args by adding below in settings.json (ctrl + shift + p and type "settings.json")
    "terminal.integrated.profiles.windows": {
    "PowerShell": {
        "source": "PowerShell",
        "icon": "terminal-powershell",
        "args": ["-ExecutionPolicy", "Bypass"]
    }
    },
    "terminal.integrated.defaultProfile.windows": "PowerShell",
    1. Need to restart VS Code and the Terminal.
    2. Run:
    # venv is your virtual environment name
    venv\scripts\activate
  2. Then Python: Select Interpreter (via Ctrl + Shift + P)

  3. And select the option (in my case towards the bottom)

  4. Select --> Python 3.7 (venv) ./venv/Scripts/python.exe

Remove VENV:

    source venv/bin/activate
    pip freeze > requirements.txt
    pip uninstall -r requirements.txt -y
    deactivate
    rm -r venv/

Troubleshooting Importerror: module not found _greenlet:

  1. Reinstall the Microsoft Visual C++ Here is the link for downloading Microsoft Visual C++.
  2. Restart the system
  3. Reinstall the venv & Python packages

Starting with the first Playwright test:

  1. Install all the required packages and set up vscode as mentioned above
  2. Run:
    pytest --alluredir=allure-results --headed --numprocesses auto
    allure serve .\allure-results

TODO:

  1. Debugging using page.pause() & inspector
  2. https://shields.io/
  3. Cloud hosting on Vercel

Jenkins Integration:

TODO

Troubleshooting for allure report:

  1. Install allure plugin for jenkins
  2. Add below code in the jenkins file:
    stage('Generating Reports') {
        steps {
            script {
                allure([
                    includePorperties: false,
                    jdk: '',
                    properties: [],
                    reportBuildPolicy: 'ALWAYS',
                    results: [[path: 'allure-results']]
                ])
            }
        }
    }

References & Resources:

  1. Integration with Github Action & Pages
  2. Cronjob Help
  3. Scheduling Github Actions
  4. Scheduling Blog