Created
September 19, 2011 04:46
-
-
Save jcjc/1225976 to your computer and use it in GitHub Desktop.
Sample Selenium-WebDriver tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ShareSpecialCharTest() { | |
login(g_userDataMap.get(Constants.DEFAULT_USER)); | |
g_nav.clickLeftButton(); | |
String shareBody = Util.currentTime() + " " + TestData.SHARE_SPECIAL_CHAR; | |
HomeTest.verifyShareOnRecentActivity(driver, g_nav, shareBody); | |
} | |
public void ShareLimitTest() { | |
login(g_userDataMap.get(Constants.DEFAULT_USER)); | |
g_nav.clickLeftButton(); | |
String shareBody = Util.currentTime() + " " + TestData.SHARE_LONG; | |
HomeTest.verifyShareOnRecentActivity(driver, g_nav, shareBody); | |
} | |
public static void verifyShareOnRecentActivity(WebDriver driver, | |
Navigation nav, String shareBody) { | |
ShareView shareView = new ShareView(driver); | |
shareView.tapVisibility(); | |
ActionSheet actionSheet = new ActionSheet(driver); | |
actionSheet.tapAction(Constants.VISIBLE_TO_CONNECTIONS_ONLY); | |
shareView = new ShareView(driver); | |
shareView.setBody(shareBody); | |
shareView.send(); | |
HomeView nusView = new HomeView(driver); | |
nav.tap(Tab.DRAWER); | |
nav.tap(Tab.YOU); | |
ProfileView profileView = new ProfileView(driver); | |
profileView.tapRecentActivity(); | |
UpdatesView recentActivity = new UpdatesView(driver); | |
List<NUSItem> activityList = recentActivity.getList(); | |
NUSSimple shared = (NUSSimple) activityList.get(0); | |
String actualBody = shared.body(); | |
Assert.assertEquals(actualBody, shareBody); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See "Continuous Integration for Mobile" for context