Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | package org.mozilla.gecko.tests; |
michael@0 | 2 | import org.mozilla.gecko.Actions; |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * This patch tests the option that shows the full URL and title in the URL Bar |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | public class testTitleBar extends PixelTest { |
michael@0 | 9 | public void testTitleBar() { |
michael@0 | 10 | blockForGeckoReady(); |
michael@0 | 11 | checkOption(); |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | public void checkOption() { |
michael@0 | 15 | |
michael@0 | 16 | String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); |
michael@0 | 17 | String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE; |
michael@0 | 18 | |
michael@0 | 19 | // Loading a page |
michael@0 | 20 | inputAndLoadUrl(blank1); |
michael@0 | 21 | verifyPageTitle(title); |
michael@0 | 22 | |
michael@0 | 23 | // Verifing the full URL is displayed in the URL Bar |
michael@0 | 24 | selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL); |
michael@0 | 25 | inputAndLoadUrl(blank1); |
michael@0 | 26 | verifyUrl(blank1); |
michael@0 | 27 | |
michael@0 | 28 | // Verifing the title is displayed in the URL Bar |
michael@0 | 29 | selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL); |
michael@0 | 30 | inputAndLoadUrl(blank1); |
michael@0 | 31 | verifyPageTitle(title); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 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 |
michael@0 | 35 | public void selectOption(String option) { |
michael@0 | 36 | selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL); |
michael@0 | 37 | mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend"); |
michael@0 | 38 | mSolo.clickOnText(option); |
michael@0 | 39 | mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked"); |
michael@0 | 40 | if (mDevice.type.equals("phone")) { |
michael@0 | 41 | mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
michael@0 | 42 | mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed"); |
michael@0 | 43 | mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
michael@0 | 44 | mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); |
michael@0 | 45 | } |
michael@0 | 46 | else { |
michael@0 | 47 | mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
michael@0 | 48 | mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done"); |
michael@0 | 49 | } |
michael@0 | 50 | } |
michael@0 | 51 | } |