Magneto allows attaching tags to test cases and tests alike, using
@pytest.mark.cards class CardsTestCase(BaseTestCase): """ Tests example functionality """ @pytest.mark.toggle def test_cards_toggle(self): ...
Now I can choose to run only
$ magneto run ui_tests/ -k cards
Magneto allows conditional skipping for test cases and tests, using
@pytest.mark.skipif(settings.param == False, reason='Skipped cause param is False') class ExampleTestCase(BaseTestCase): """ Tests example functionality """ def test_example_1(self): ...
Some tests can be defined as blockers so that if they fail, all the rest would be skipped. The boarding test, for instance, is considered a blocker as there's no point in continuing with following tests if the boarding process failed. We do this by using a pytest plugin called pytest-blocker.
class ExampleTestCase(BaseTestCase): """ Tests example functionality """ @pytest.mark.blocker def test_example_1(self): ...