Reputation: 137
I'm halfway through a set of automated tests using the Robot Framework, and am starting to notice a lot of repetition. At the moment, my tests are organized by the page being tested (i.e. homepage, login page).
The uncertainty I'm feeling is that some tests are word-for-word repeated in two different test suites, with only the setup differing; but on the other hand, with the refactoring I've done, it feels like the keywords themselves are the test cases. I just want to know if there's a more standard practice way of doing this.
I've listed a trivial example below:
common.robot
...
*** Keywords ***
User logs in
# login logic here
...
home_page.robot
...
*** Test Cases ***
Verify user login
User logs in
...
other_page.robot
...
*** Test Cases ***
Verify user login
User logs in
...
Upvotes: 2
Views: 552
Reputation: 435
If you want to share test keywords, you can do that on many levels.
That being said, regarding your bigger concern of how to organize the structure of your test suite, that is a much-discussed topic and no single answer would suffice. You could look at the Pekka's writings on this topic (Link). Test-framework-design is an 'art-form' similar to code design.
Upvotes: 2