lundi 29 avril 2019

Avoid code duplication when writing selenium tests for Firefox and Chrome

If you write tests for Selenium to check e.g. both Firefox and Chrome, the tests look very much alike, except for the setUp, see e.g. https://gist.github.com/devinmancuso/54904c005f8d237f6fec, which has identical functions test_search_in_python_chrome and test_search_in_python_firefox. There are patterns to avoid code duplication in selenium, e.g. the Page Object Pattern.

Is there a way to avoid this huge code duplication?

Aucun commentaire:

Enregistrer un commentaire