We have extensive Python-based application, with many E2e tests (and of course unit tests), all in Python).
We started e2e test in FitNesse (Selenium1, with Python fixtures) many years ago. Recently we developed internal webdriver (Selenium2) based tests framework, with pageobjects and other best practices (with Jenkins as runner), using Python as main language for e2e test (as is for core application). Test flakiness decreased, writing test is more flexible, we like webdriver based e2e tests a lot, happy campers.
Developers are adding Angular layer on top (with backend still in Python) on some pages (most pages are in Jinja). Angular pages will use Karma/jasmine for unit tests (written in JavaScript). So far so good, following best practices as practical.
Developers suggest very strongly that we (QA) should write e2e tests in Protractor/Jasmine/JavaScript. We are a bit reluctant, because we invested lots of effort to FitNesse and webdriver tests (hundreds of running tests) and would prefer Python over JavaScript. Python is, and will remain, our main development language, and we want to avoid duplication existing Python/pageobject framework in JavaScript/Jasmine.
We:
- would like keep FitNesse for a while (too many tests, will take long time to reimplement them all, and will esier to move Fitnesse tests to webdriver then to jasnime),
- like Python/Webdriver a lot (very productive environment, easy to develop web page automation tasks for production needs way beyond e2e testing),
- would like to avoid adding third incompatible language (jasmine/javascript) for e2e testing.
I understand that protractor may know more about Angular properties of the page elements, but is the pain of switching Python->Javascript worth it?
My questions (all related, same question from different POVs):
- Is Protractor so much more superior to plain Webdriver (even if Protractor is layer on top of Webdriver), that it is worth to switch to e2e tests in Protractor, abandoning our python pageobject code?
- Does Protractor have some superior abilities for Angular e2e testing which are not easy to reimplement by adding good locators alongside those generated by Angular?
- Or does it make sense to have two parallel e2e testing frameworks, Protractor/JavaScript for Angular-based pages, and Webdriver/Python for 80% of the pages which are non-Angular?
- Or Webdriver is just fine (after adding some locators) so we will not miss much, and will be happy in plain webdriver in Python?
- Is there some open-source project which simulates Protractor capabilities, but uses (mostly) Python? Is it even possible?
I found Can angularjs apps automated with selenium? if yes, why should we use protractor? on SE but we have strong preference for Python as main language (which Comment suggest might be OK, giving me hope).
I know that answer is always "it depends what you prefer", but would like to know what hidden obstacles and traps we might encounter on either path, from people who been there done that.
EDIT, much later: I learned that newer version on Angular (2+) abandoned the support for angular-specific locators (model/binding/scope) and support only standard locators (id/name/css class etc). With the only advantage of Protractor over Python/Webdriver gone, I see no reason to move to different (and inferior, IMHO) language and abandon all our investment in Python.