@@ -29,15 +29,14 @@ public class ScenarioStopwatch : AlarmClockSession
2929 [ TestMethod ]
3030 public void StopwatchLap ( )
3131 {
32- int numberOfEntry = 3 ;
33- var stopwatchPivotItem = session . FindElementByAccessibilityId ( "StopwatchPivotItem" ) ;
32+ int numberOfEntry = 8 ;
3433
3534 // Start the stopwatch
36- var stopwatchPlayPauseButton = stopwatchPivotItem . FindElementByAccessibilityId ( "StopwatchPlayPauseButton" ) ;
35+ var stopwatchPlayPauseButton = session . FindElementByAccessibilityId ( "StopwatchPlayPauseButton" ) ;
3736 stopwatchPlayPauseButton . Click ( ) ;
3837
3938 // Create lap entries
40- var stopwatchLapButton = stopwatchPivotItem . FindElementByAccessibilityId ( "StopWatchLapButton" ) ;
39+ var stopwatchLapButton = session . FindElementByAccessibilityId ( "StopWatchLapButton" ) ;
4140 for ( uint count = 0 ; count < numberOfEntry ; count ++ )
4241 {
4342 stopwatchLapButton . Click ( ) ;
@@ -48,7 +47,7 @@ public void StopwatchLap()
4847 Thread . Sleep ( TimeSpan . FromSeconds ( 0.5 ) ) ;
4948
5049 // Verify that the lap entries are created
51- var lapListView = stopwatchPivotItem . FindElementByAccessibilityId ( "LapsAndSplitsListView" ) ;
50+ var lapListView = session . FindElementByAccessibilityId ( "LapsAndSplitsListView" ) ;
5251 var lapEntries = lapListView . FindElementsByClassName ( "ListViewItem" ) ;
5352 Assert . IsNotNull ( lapEntries ) ;
5453 Assert . AreEqual ( numberOfEntry , lapEntries . Count ) ;
@@ -60,13 +59,13 @@ public void StopwatchLap()
6059 Assert . IsFalse ( firstLapEntry . Displayed ) ;
6160
6261 // Horizontally scroll the list up and verify that the fist lap entry is now displayed while the last entry is now hidden
63- touchScreen . Scroll ( lapListView . Coordinates , 0 , - 50 ) ;
62+ touchScreen . Scroll ( lapListView . Coordinates , 0 , - 100 ) ;
6463 Thread . Sleep ( TimeSpan . FromSeconds ( 1 ) ) ;
6564 Assert . IsTrue ( firstLapEntry . Displayed ) ;
6665 Assert . IsFalse ( lastLapEntry . Displayed ) ;
6766
6867 // Horizontally scroll the list down and verify that the last lap entry is now displayed while the first entry is now hidden again
69- touchScreen . Scroll ( lapListView . Coordinates , 0 , 50 ) ;
68+ touchScreen . Scroll ( lapListView . Coordinates , 0 , 100 ) ;
7069 Thread . Sleep ( TimeSpan . FromSeconds ( 1 ) ) ;
7170 Assert . IsTrue ( lastLapEntry . Displayed ) ;
7271 Assert . IsFalse ( firstLapEntry . Displayed ) ;
@@ -75,15 +74,14 @@ public void StopwatchLap()
7574 [ TestMethod ]
7675 public void StopwatchStart ( )
7776 {
78- var stopwatchPivotItem = session . FindElementByAccessibilityId ( "StopwatchPivotItem" ) ;
79- var stopwatchResetButton = stopwatchPivotItem . FindElementByAccessibilityId ( "StopWatchResetButton" ) ;
77+ var stopwatchResetButton = session . FindElementByAccessibilityId ( "StopWatchResetButton" ) ;
8078
8179 // Track the reset stopwatch timer text for comparison
82- var stopwatchTimer = stopwatchPivotItem . FindElementByAccessibilityId ( "StopwatchTimerText" ) ;
80+ var stopwatchTimer = session . FindElementByAccessibilityId ( "StopwatchTimerText" ) ;
8381 string stopwatchTimerText = stopwatchTimer . GetAttribute ( "Name" ) ;
8482
8583 // Verify that the stopwatchPlayPauseButton button says Start and the stopwatchResetButton is disabled
86- var stopwatchPlayPauseButton = stopwatchPivotItem . FindElementByAccessibilityId ( "StopwatchPlayPauseButton" ) ;
84+ var stopwatchPlayPauseButton = session . FindElementByAccessibilityId ( "StopwatchPlayPauseButton" ) ;
8785 Assert . AreEqual ( "Start" , stopwatchPlayPauseButton . Text ) ;
8886 Assert . IsFalse ( stopwatchResetButton . Enabled ) ;
8987
@@ -103,7 +101,6 @@ public void StopwatchStart()
103101 Assert . AreNotEqual ( stopwatchTimerText , stopwatchTimer . GetAttribute ( "Name" ) ) ;
104102 }
105103
106-
107104 [ ClassInitialize ]
108105 public static void ClassInitialize ( TestContext context )
109106 {
@@ -112,7 +109,7 @@ public static void ClassInitialize(TestContext context)
112109 // Save application window original size and temporarily set it to 500 x 500
113110 originalSize = session . Manage ( ) . Window . Size ;
114111 Assert . IsNotNull ( originalSize ) ;
115- session . Manage ( ) . Window . Size = new Size ( 500 , 500 ) ;
112+ session . Manage ( ) . Window . Size = new Size ( 550 , 500 ) ;
116113 }
117114
118115 [ ClassCleanup ]
@@ -131,7 +128,7 @@ public override void TestInit()
131128 base . TestInit ( ) ;
132129
133130 // Navigate to Stopwatch tab
134- session . FindElementByAccessibilityId ( "StopwatchPivotItem " ) . Click ( ) ;
131+ session . FindElementByAccessibilityId ( "StopwatchButton " ) . Click ( ) ;
135132
136133 // Stop the stopwatch if it is running and reset it
137134 TestCleanup ( ) ;
0 commit comments