I am using pytest and allure-pytest to automate my web app test cases. My test case has below format:
import allure
from selenium import webdriver
class Test_Abc():
options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox")
options.add_argument("--foreground")
options.add_argument('disable-infobars')
options.add_argument("--disable-extensions")
driver = webdriver.Remote(command_executor="http://127.0.0.1:4444/wd/hub", desired_capabilities=options.to_capabilities())
def test_check_reapply_page_001(self):
allure.attach(self.driver.get_screenshot_as_png(), "Failed", allure.attachment_type.PNG)
When running test case, an error return at the allure.attach command:
AttributeError: 'module' object has no attribute 'attachment_type'
Please advise me how to overcome this error?
Libs:
allure-pytest==2.5.4
allure-python-commons==2.5.4
pytest==3.7.0
selenium==3.141.0