How can run a specific test scenario in my angular app. what I mean by this is that I implemented a new feature in protractor, created the page and the step, but I already have other features implemented. What I'm asking is if there's a way to test only the feature I added.
-
I don't know where to implement it? I'm a newbie. Can you please give me more simplified steps. Btw i guess i should mention that i work with 'Give' and 'Then' in the steps – Rachid El Adnani Aug 05 '21 at 10:13
2 Answers
sure, there are 2 ways
instead of
describe
orit
usefdescribe
andfit
respectively.f
stands for focus. This will run only focused blockedIn your config, there is
spec
property which can take an array of specs or a single path. Just specify the path to your spec you want to run

- 7,964
- 2
- 17
- 40
The only way I know to do this is to skip tests as follows:
instead of describe
use xdescribe
to skip a whole test suite.
instead of it
use xit
to skip a single test.
Skip all the suites except your new one!
This is not a great solution since you have to manually add the x
and then delete it when you don't want to skip anymore. Depends how many other test suites you have, whether this is suitable.
It may be possible to make the skipping conditional based on some variable or config value. Here's how to make skipping conditional with mocha - https://stackoverflow.com/a/42586302/1205871
This may work with protractor tests too, worth a try!

- 52,471
- 49
- 232
- 283