Skip to content

Commit

Permalink
tmf: Add SwtBot test for AD navigation in XYCharts
Browse files Browse the repository at this point in the history
Change-Id: I5532aaf9443450bccefb146b5f667fd42b5f1374
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/140951
Tested-by: CI Bot
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
bhufmann committed Apr 24, 2019
1 parent edbe123 commit 2d2975d
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -245,6 +245,26 @@ public String getFailureMessage() {
fViewBot.bot().waitUntil(new SeriesCondition(fXyViewer, getDuration(range)));
}

/**
* Test 'a' and 'd' navigation
*/
@Test
public void testKeyboardNavigation() {
SWTBotSwtChart xyChart = new SWTBotSwtChart(fViewBot.bot());
xyChart.setFocus();
assertEquals(80, fXyViewer.getWindowDuration());

TmfTimeRange updatedWindowRange = new TmfTimeRange(TmfTimestamp.fromNanos(40), TmfTimestamp.fromNanos(120));

// move to the right
fireKeyInGraph(xyChart, 'd');
fViewBot.bot().waitUntil(new SeriesCondition(fXyViewer, getDuration(updatedWindowRange)));

// move to the left
fireKeyInGraph(xyChart, 'a');
fViewBot.bot().waitUntil(new SeriesCondition(fXyViewer, getDuration(INITIAL_WINDOW_RANGE)));
}

// ------------------------------------------------------------------------
// Helper methods
// ------------------------------------------------------------------------
Expand Down

0 comments on commit 2d2975d

Please sign in to comment.