TestProject Forum

Python SDK or coded test into TestProject [OPEN]

Hello

I’ve got a simple accessibility testing snippet written in Python unittest framework in Pycharm IDE with the TestProject token calling the webdrivers via TestProject agent.

When I run the test in Pycharm, it runs successfully and I can see the output in TestProject in the monitor section.

I would like to run the test solely from TestProject calling that code snippet, is there a way to do this?

I’ve tried coping the .py file into TestProject but it’s missing DLL files - what is the correct way to do this? I’d like to have this test across different projects.

Here is my code I’ve written in Pycharm IDE

from src.testproject.sdk.drivers import webdriver
from src.testproject.decorator import report_assertion_errors
from axe_selenium_python import Axe



@report_assertion_errors
def accessibility_test():
    # Navigate to application
    driver = webdriver.Chrome(token='somenumber')
    driver.get("https://www.google.com/")

    # Clear cookie banner - to do

    # Run axe
    axe = Axe(driver)
    axe.inject()
    results = axe.run()

    # Output results to file
    axe.write_results(results, 'results.json')

    # Check the number of Violations is zero. If not fail assertion
    assert len(results["violations"]) ==0, axe.report(results["violations"])

# Quit Driver
    driver.quit()

if __name__ == "__main__":
    accessibility_test()

Hello @ross
The uploading of Python code is not yet available.
But you can still run the code locally and enjoy the reports on the cloud while we work on uploading Python code as well

Thanks @ran.tzur hopefully this functionality comes soon.

Hi @ran.tzur :slight_smile: ,
any update about when this functionality of upload python code to the TestProject platform will be available?

TNX and have a nice weekend.

Hi,
This feature is planned for Q4.