mobile/android/base/tests/testTitleBar.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/tests/testTitleBar.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +package org.mozilla.gecko.tests;
     1.5 +import org.mozilla.gecko.Actions;
     1.6 +
     1.7 +/**
     1.8 + * This patch tests the option that shows the full URL and title in the URL Bar
     1.9 + */
    1.10 +
    1.11 +public class testTitleBar extends PixelTest {
    1.12 +    public void testTitleBar() {
    1.13 +        blockForGeckoReady();
    1.14 +        checkOption();
    1.15 +    }
    1.16 +
    1.17 +    public void checkOption() {
    1.18 +
    1.19 +        String blank1 = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
    1.20 +        String title = StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE;
    1.21 +
    1.22 +        // Loading a page
    1.23 +        inputAndLoadUrl(blank1);
    1.24 +        verifyPageTitle(title);
    1.25 +
    1.26 +        // Verifing the full URL is displayed in the URL Bar
    1.27 +        selectOption(StringHelper.SHOW_PAGE_ADDRESS_LABEL);
    1.28 +        inputAndLoadUrl(blank1);
    1.29 +        verifyUrl(blank1);
    1.30 +
    1.31 +        // Verifing the title is displayed in the URL Bar
    1.32 +        selectOption(StringHelper.SHOW_PAGE_TITLE_LABEL);
    1.33 +        inputAndLoadUrl(blank1);
    1.34 +        verifyPageTitle(title);
    1.35 +    }
    1.36 +
    1.37 +    // 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
    1.38 +    public void selectOption(String option) {
    1.39 +        selectSettingsItem(StringHelper.DISPLAY_SECTION_LABEL, StringHelper.TITLE_BAR_LABEL);
    1.40 +        mAsserter.ok(waitForText(StringHelper.SHOW_PAGE_TITLE_LABEL), "Waiting for the pop-up to open", "Pop up with the options was openend");
    1.41 +        mSolo.clickOnText(option);
    1.42 +        mAsserter.ok(waitForText(StringHelper.CHARACTER_ENCODING_LABEL), "Waiting to press the option", "The pop-up is dismissed once clicked");
    1.43 +        if (mDevice.type.equals("phone")) {
    1.44 +            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    1.45 +            mAsserter.ok(waitForText(StringHelper.CUSTOMIZE_SECTION_LABEL), "Waiting to perform one back", "One back performed");
    1.46 +            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    1.47 +            mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
    1.48 +        }
    1.49 +        else {
    1.50 +            mActions.sendSpecialKey(Actions.SpecialKey.BACK);
    1.51 +            mAsserter.ok(waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_URL), "Waiting to exit settings", "Exit settings done");
    1.52 +        }
    1.53 +    }
    1.54 +}

mercurial