1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/tests/testAboutHomeVisibility.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +package org.mozilla.gecko.tests; 1.5 + 1.6 +import org.mozilla.gecko.tests.components.AboutHomeComponent.PanelType; 1.7 +import org.mozilla.gecko.tests.helpers.GeckoHelper; 1.8 +import org.mozilla.gecko.tests.helpers.NavigationHelper; 1.9 + 1.10 +/** 1.11 + * Tests the visibility of about:home after various interactions with the browser. 1.12 + */ 1.13 +public class testAboutHomeVisibility extends UITest { 1.14 + public void testAboutHomeVisibility() { 1.15 + GeckoHelper.blockForReady(); 1.16 + 1.17 + // Check initial state on about:home. 1.18 + mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); 1.19 + mAboutHome.assertVisible() 1.20 + .assertCurrentPanel(PanelType.TOP_SITES); 1.21 + 1.22 + // Go to blank 01. 1.23 + NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); 1.24 + mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE); 1.25 + mAboutHome.assertNotVisible(); 1.26 + 1.27 + // Go to blank 02. 1.28 + NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL); 1.29 + mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE); 1.30 + mAboutHome.assertNotVisible(); 1.31 + 1.32 + // Enter editing mode, where the about:home UI should be visible. 1.33 + mToolbar.enterEditingMode(); 1.34 + mAboutHome.assertVisible() 1.35 + .assertCurrentPanel(PanelType.TOP_SITES); 1.36 + 1.37 + // Dismiss editing mode, where the about:home UI should be gone. 1.38 + mToolbar.dismissEditingMode(); 1.39 + mAboutHome.assertNotVisible(); 1.40 + 1.41 + // Loading about:home should show about:home again. 1.42 + NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL); 1.43 + mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); 1.44 + mAboutHome.assertVisible() 1.45 + .assertCurrentPanel(PanelType.TOP_SITES); 1.46 + 1.47 + // TODO: Type in a url and assert the go button is visible. 1.48 + } 1.49 +}