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()