| OLD | NEW |
| (Empty) |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 | |
| 6 class SharedUserStoryState(object): | |
| 7 """A class that manages the test state across multiple user stories. | |
| 8 It's styled on unittest.TestCase for handling test setup & teardown logic. | |
| 9 | |
| 10 """ | |
| 11 | |
| 12 def __init__(self, test, options, user_story_set): | |
| 13 """ This method is styled on unittest.TestCase.setUpClass. | |
| 14 Override to do any action before running user stories that | |
| 15 share this same state. | |
| 16 Args: | |
| 17 test: a page_test.PageTest instance. | |
| 18 options: a BrowserFinderOptions instance that contains command line | |
| 19 options. | |
| 20 user_story_set: a user_story_set.UserStorySet instance. | |
| 21 """ | |
| 22 pass | |
| 23 | |
| 24 @property | |
| 25 def platform(self): | |
| 26 """ Override to return the platform which user stories that share this same | |
| 27 state will be run on. | |
| 28 """ | |
| 29 raise NotImplementedError() | |
| 30 | |
| 31 def WillRunUserStory(self, user_story): | |
| 32 """ Override to do any action before running each one of all user stories | |
| 33 that share this same state. | |
| 34 This method is styled on unittest.TestCase.setUp. | |
| 35 """ | |
| 36 raise NotImplementedError() | |
| 37 | |
| 38 def DidRunUserStory(self, results): | |
| 39 """ Override to do any action after running each of all user stories that | |
| 40 share this same state. | |
| 41 This method is styled on unittest.TestCase.tearDown. | |
| 42 """ | |
| 43 raise NotImplementedError() | |
| 44 | |
| 45 def GetTestExpectationAndSkipValue(self, expectations): | |
| 46 """ Return test expectation and skip value instance in case expectation | |
| 47 is 'skip'. This is run after WillRunUserStory and before RunUserStory. | |
| 48 """ | |
| 49 raise NotImplementedError() | |
| 50 | |
| 51 def RunUserStory(self, results): | |
| 52 """ Override to do any action before running each one of all user stories | |
| 53 that share this same state. | |
| 54 This method is styled on unittest.TestCase.run. | |
| 55 """ | |
| 56 raise NotImplementedError() | |
| 57 | |
| 58 def TearDownState(self, results): | |
| 59 """ Override to do any action after running multiple user stories that | |
| 60 share this same state. | |
| 61 This method is styled on unittest.TestCase.tearDownClass. | |
| 62 """ | |
| 63 raise NotImplementedError() | |
| OLD | NEW |