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 | |
michael@0 | 3 | import org.mozilla.gecko.Actions; |
michael@0 | 4 | |
michael@0 | 5 | public class testPromptGridInput extends BaseTest { |
michael@0 | 6 | protected int index = 1; |
michael@0 | 7 | public void testPromptGridInput() { |
michael@0 | 8 | blockForGeckoReady(); |
michael@0 | 9 | |
michael@0 | 10 | test(1); |
michael@0 | 11 | |
michael@0 | 12 | testGridItem("Icon 1"); |
michael@0 | 13 | testGridItem("Icon 2"); |
michael@0 | 14 | testGridItem("Icon 3"); |
michael@0 | 15 | testGridItem("Icon 4"); |
michael@0 | 16 | testGridItem("Icon 5"); |
michael@0 | 17 | testGridItem("Icon 6"); |
michael@0 | 18 | testGridItem("Icon 7"); |
michael@0 | 19 | testGridItem("Icon 8"); |
michael@0 | 20 | testGridItem("Icon 9"); |
michael@0 | 21 | testGridItem("Icon 10"); |
michael@0 | 22 | testGridItem("Icon 11"); |
michael@0 | 23 | |
michael@0 | 24 | mSolo.clickOnText("Icon 11"); |
michael@0 | 25 | mSolo.clickOnText("OK"); |
michael@0 | 26 | |
michael@0 | 27 | mAsserter.ok(waitForText("PASS"), "test passed", "PASS"); |
michael@0 | 28 | mActions.sendSpecialKey(Actions.SpecialKey.BACK); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | public void testGridItem(String title) { |
michael@0 | 32 | // Force the list to scroll if necessary |
michael@0 | 33 | mSolo.waitForText(title, 1, 500, true); |
michael@0 | 34 | mAsserter.ok(waitForText(title), "Found grid item", title); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | public void test(final int num) { |
michael@0 | 38 | // Load about:blank between each test to ensure we reset state |
michael@0 | 39 | loadUrl("about:blank"); |
michael@0 | 40 | mAsserter.ok(waitForText("about:blank"), "Loaded blank page", "page title match"); |
michael@0 | 41 | |
michael@0 | 42 | loadUrl("chrome://roboextender/content/robocop_prompt_gridinput.html#test" + num); |
michael@0 | 43 | } |
michael@0 | 44 | } |