pythonautomated-testsrobotframework

Is it possible to execute a test case that passes solely when the Test Setup is executed?


I have added the following two Keywords to my Test Setup:

Test Setup    Navigate to Home Page    Home Page Card Is Visible

I navigate to the Home Page and verify that the Home Page Card is visible at the start of every test case. However, I have one test case that only needs these two keywords:

Home Page Card is visible on Home Page

I need this test case to pass as long as the Test Setup passes. And I would like to remove the two keywords from the test case itself. Is that possible with Robot Framework using the Browser Library?


Solution

    1. Putting several keywords into Test Setup section should be done by using run keywords, like
    Test Setup    run keywords  Navigate to Home Page  AND  Home Page Card Is Visible
    
    
    1. The test case's goal is to cover these actions, then to make it more semantically correct, I would advise leaving the actions inside the test but removing the test setup. E.g.
    Home Page Card is visible on Home Page
        [Test Setup]     # empty section removes setup defined above
        
        Navigate to Home Page
        Home Page Card Is Visible