I'm building android framework using Appium, Serenity and POM model.
I wanna take screenshots if any of the steps failed.
Can anybody help me with code and please let me know where to put that? Eg I have Pages, steps and stepdefinition class. Not sure where to implement that?
I tried to compare pictures with template by OpenCV library. That's what I do:
Add method to
base_page.py
.Use this method in Page Object file.
Use step in necessary test.
In result of all of this I get some percentage of pictures similarity. It can be with that percentage what you need. For my tests it is OK.
If you mean screenshots for the test results, just let me know and I can show you example how I did it with Allure.
If you mean usual screenshots in Appium, please provide some mistakes which you catch.