|
1 package org.mozilla.gecko.tests; |
|
2 import org.mozilla.gecko.Actions; |
|
3 |
|
4 /** |
|
5 * This patch tests the option that shows the full URL and title in the URL Bar |
|
6 */ |
|
7 |
|
8 public class testTitleBar extends PixelTest { |
|
9 public void testTitleBar() { |
|
10 blockForGeckoReady(); |
|
11 checkOption(); |
|
12 } |
|
13 |
|
14 public void checkOption() { |
|
15 |
|
16 String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); |
|
17 String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE; |
|
18 |
|
19 // Loading a page |
|
20 inputAndLoadUrl(blank1); |
|
21 verifyPageTitle(title); |
|
22 |
|
23 // Verifing the full URL is displayed in the URL Bar |
|
24 selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL); |
|
25 inputAndLoadUrl(blank1); |
|
26 verifyUrl(blank1); |
|
27 |
|
28 // Verifing the title is displayed in the URL Bar |
|
29 selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL); |
|
30 inputAndLoadUrl(blank1); |
|
31 verifyPageTitle(title); |
|
32 } |
|
33 |
|
34 // Entering settings, changing the options: show title/page address option and verifing the device type because for phone there is an extra back action to exit the settings menu |
|
35 public void selectOption(String option) { |
|
36 selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL); |
|
37 mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend"); |
|
38 mSolo.clickOnText(option); |
|
39 mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked"); |
|
40 if (mDevice.type.equals("phone")) { |
|
41 mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
|
42 mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed"); |
|
43 mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
|
44 mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); |
|
45 } |
|
46 else { |
|
47 mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
|
48 mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); |
|
49 } |
|
50 } |
|
51 } |