|
1 package org.mozilla.gecko.tests; |
|
2 |
|
3 import org.mozilla.gecko.tests.components.AboutHomeComponent.PanelType; |
|
4 import org.mozilla.gecko.tests.helpers.GeckoHelper; |
|
5 import org.mozilla.gecko.tests.helpers.NavigationHelper; |
|
6 |
|
7 /** |
|
8 * Tests the visibility of about:home after various interactions with the browser. |
|
9 */ |
|
10 public class testAboutHomeVisibility extends UITest { |
|
11 public void testAboutHomeVisibility() { |
|
12 GeckoHelper.blockForReady(); |
|
13 |
|
14 // Check initial state on about:home. |
|
15 mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); |
|
16 mAboutHome.assertVisible() |
|
17 .assertCurrentPanel(PanelType.TOP_SITES); |
|
18 |
|
19 // Go to blank 01. |
|
20 NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); |
|
21 mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE); |
|
22 mAboutHome.assertNotVisible(); |
|
23 |
|
24 // Go to blank 02. |
|
25 NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_02_URL); |
|
26 mToolbar.assertTitle(StringHelper.ROBOCOP_BLANK_PAGE_02_TITLE); |
|
27 mAboutHome.assertNotVisible(); |
|
28 |
|
29 // Enter editing mode, where the about:home UI should be visible. |
|
30 mToolbar.enterEditingMode(); |
|
31 mAboutHome.assertVisible() |
|
32 .assertCurrentPanel(PanelType.TOP_SITES); |
|
33 |
|
34 // Dismiss editing mode, where the about:home UI should be gone. |
|
35 mToolbar.dismissEditingMode(); |
|
36 mAboutHome.assertNotVisible(); |
|
37 |
|
38 // Loading about:home should show about:home again. |
|
39 NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL); |
|
40 mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); |
|
41 mAboutHome.assertVisible() |
|
42 .assertCurrentPanel(PanelType.TOP_SITES); |
|
43 |
|
44 // TODO: Type in a url and assert the go button is visible. |
|
45 } |
|
46 } |