Open Bug 1176474 Opened 4 years ago Updated 4 years ago
Mozregui: Add some tests
Mozregui seems to mature a bit. Perhaps it is time to add some tests. As discussed with Julien, it will be great to write them with pytests (http://pytest.org/latest/). We have to discuss the scope of this ticket though. Perhaps we can limit it to a first batch of, nominal case, functional gui testing.
Yay this is cool! I'd love to see more tests on the GUI! As we discussed, I would like to try out pytest in combination with pytest-qt: http://pytest.org/latest/ https://pytest-qt.readthedocs.org/en/1.4.0/ I'm pretty sure it will allow to write test code easier and faster. So maybe a good first step would be here to adapt our gui tests (let's keep the whole core tests out of that for now) to use this new technology ? Then go on with writing new tests on top of that.
I just replaced nose with py.test and changed two tests (this can be used as a *simple* starting point for future tests). Others tests are working fine (py.test is compatible with unittest) so I don't see the point of changing those. But as a starting point, we now have the choice to write tests using unittest (the *old* way) or using py.test. Jonathan, what do you think ? Don't worry about appveyor being red, all seems fine too me for the tests; this is another issue for building the installer under windows that I need to investigate: https://ci.appveyor.com/project/parkouss/mozregression/build/1.0.301#L378
Attachment #8625559 - Flags: review?(jonathan.pigree)
Hey sorry. I was kinda tired yesterday.I will definitly look into your PR after work. :)
Okay. I just looked quickly at it. Seems good. Yes the appveyor failure seems totally unrelated. The test_report_basic passed just fine in AppVeyor and Travis.
Attachment #8625559 - Flags: review?(jonathan.pigree) → review+
There aren't so many differences between the two frameworks so far.
Thanks Jonathan for the review! I just merged this: https://github.com/mozilla/mozregression/commit/52df0c0036af6cc91411045e5ccf0287c746c1aa Actually there are differences between the two frameworks, and I believe py.test will be more powerfull because it allows to write less boiler plate code. (as you mentionned on github, no class is needed for example). You can look at the documentation for more details, and have a look at what is called "fixtures": https://pytest.org/latest/fixture.html py.test is also compatible with unittest (our old test system, available in standard python lib) so we do not need to change every test - which is usefull! But now next tests could be written using py.test, which I believe will be easier. I don't close this bug, it could be used as a tracking bug for some more specifics gui testing bugs.
You need to log in before you can comment on or make changes to this bug.