1

I'm writing some simple e2e tests with protractor, but given this is my first attempt I have a lot of simple questions. The scenario is as follows: user logins, enter credentials, lands on the site dashboard, clicks a button, lands on a table with 100 rows, clicks export button, exports a csv and logs out.

Now my questions are the following:

How do I organize all of this? Does this fit into one 'spec' file where I navigate from page to page (importing all the page objects into the single spec file, etc)? Or do I create a separate spec file (and associated page obj file) for each screen? If so, how do I chain them together to move in the order described above? Should each spec be independent (and thus have the appropriate prep work done in it)? Or Should the specs be called in order in the conf.js file--like a suite? Thanks.

jrDeveloper
  • 167
  • 2
  • 10

1 Answers1

1

A lot of your suggestions could be chosen up to you. But you could try to use best practice in building automation tests.

You could organize your spec by features or by logical parts (e.g. pages). Then in a conf file you could organize your spec files into a suites (e.g. by testing types of checking: smoke, regression, sanity etc.).

For more information, take a look:

Oleksii
  • 1,623
  • 20
  • 26
  • Thanks. Im guessing if I separate it so that there's a separate spec for each page, then I collect them into a suite and then list them in the manner I want them executed? – jrDeveloper Jul 18 '17 at 14:40
  • Yep, good view. It should be convenient and clearly for you at the first place. Could you mark my answer if I helped you enough) and feel free to ask me by skype for example (`crispusdh`) – Oleksii Jul 18 '17 at 16:20
  • Sure will do. Thank you! – jrDeveloper Jul 18 '17 at 16:32