diff options
author | Manish Sinha <manish.sinha@xamarin.com> | 2015-05-27 21:25:40 +0300 |
---|---|---|
committer | Manish Sinha <manish.sinha@xamarin.com> | 2015-05-27 21:35:54 +0300 |
commit | 1fa6701885212f1fc231be2fbf33797f24b3f3f3 (patch) | |
tree | c85af01b4e95e7dc5b7b11ee2da4676b9f19982d /main/tests/UserInterfaceTests/UITestBase.cs | |
parent | f139c3b10ad6c2b79253b5cbc727acacebc56945 (diff) |
[UITest] Move ScreenshotForTestSetup to SetUp method
Till now we needed to call ScreenshotForTestSetup method
explicitely on each test, but now moving it to SetUp
method it is called explicitely. The access has been
changed to default (private) so that it is not visible
to outside
Diffstat (limited to 'main/tests/UserInterfaceTests/UITestBase.cs')
-rw-r--r-- | main/tests/UserInterfaceTests/UITestBase.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/main/tests/UserInterfaceTests/UITestBase.cs b/main/tests/UserInterfaceTests/UITestBase.cs index 501ba10b07..2612e809d2 100644 --- a/main/tests/UserInterfaceTests/UITestBase.cs +++ b/main/tests/UserInterfaceTests/UITestBase.cs @@ -76,6 +76,8 @@ namespace UserInterfaceTests TestService.StartSession (MonoDevelopBinPath); TestService.Session.DebugObject = new UITestDebug (); + + ScreenshotForTestSetup (TestContext.CurrentContext.Test.Name); } [TearDown] @@ -113,7 +115,7 @@ namespace UserInterfaceTests Directory.CreateDirectory (ScreenshotsPath); } - protected void ScreenshotForTestSetup (string testName) + void ScreenshotForTestSetup (string testName) { testScreenshotIndex = 1; projectScreenshotFolder = Path.Combine (ScreenshotsPath, testName); @@ -124,9 +126,6 @@ namespace UserInterfaceTests protected void TakeScreenShot (string stepName) { - if (string.IsNullOrEmpty (projectScreenshotFolder)) - throw new InvalidOperationException ("You need to initialize Screenshot functionality by calling 'ScreenshotForTestSetup (string testName)' first"); - stepName = string.Format ("{0:D3}-{1}", testScreenshotIndex++, stepName); var screenshotPath = Path.Combine (projectScreenshotFolder, stepName) + ".png"; Session.TakeScreenshot (screenshotPath); |