Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FBTest for issue 5779

  • Loading branch information...
commit 3c106d456ee28ceba6beb6e10488d00329e8cc04 1 parent 356c572
Jan Odvarko janodvarko authored
39 tests/content/commandLine/5779/issue5779.html
View
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Issue 5779: Allow to set the root element in $ and $$</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link href="../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+</head>
+<body>
+<header>
+ <h1><a href="http://code.google.com/p/fbug/issues/detail?id=5779">Issue 5779</a>:
+ Allow to set the root element in $ and $$</h1>
+</header>
+<div class="test">
+ <section id="description">
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Select and enable the Console panel</li>
+ <li>Execute following expressions in the command line and check the results<br/>
+ <i>'expression' -> 'result'</i>
+ </li>
+ <ol>
+ <li><code>$('div') -> &lt;div class="test"&gt;</code></li>
+ <li><code>$$('div') -> [div.test, div#root, div.rootdiv1, div.rootdiv2]</code></li>
+ <li><code>$('div', document.getElementById('root')); -> &lt;div class="rootdiv1"&gt;</code></li>
+ <li><code>$$('div', document.getElementById('root')); -> [div.rootdiv1, div.rootdiv2]</code></li>
+ </ol>
+ </ol>
+ </section>
+ <footer>
+ Jan Odvarko &lt;odvarko@gmail.com&gt;
+ </footer>
+</div>
+
+<div id="root">
+ <div class="rootdiv1"></div>
+ <div class="rootdiv2"></div>
+</div>
+</body>
+</html>
37 tests/content/commandLine/5779/issue5779.js
View
@@ -0,0 +1,37 @@
+function runTest()
+{
+ FBTest.sysout("issue5779.START");
+ FBTest.openNewTab(basePath + "commandLine/5779/issue5779.html", function(win)
+ {
+ FBTest.openFirebug();
+ FBTest.clearCache();
+ FBTest.enableConsolePanel(function(win)
+ {
+ var tasks = new FBTest.TaskList();
+
+ tasks.push(FBTest.executeCommandAndVerify,
+ "$('div');",
+ "<div class=\"test\">",
+ "a", "objectLink-element");
+
+ tasks.push(FBTest.executeCommandAndVerify,
+ "$$('div');",
+ "[div.test, div#root, div.rootdiv1, div.rootdiv2]",
+ "pre", "objectBox-array");
+
+ tasks.push(FBTest.executeCommandAndVerify,
+ "$('div', document.getElementById('root'));",
+ "<div class=\"rootdiv1\">",
+ "a", "objectLink-element");
+
+ tasks.push(FBTest.executeCommandAndVerify,
+ "$$('div', document.getElementById('root'));",
+ "[div.rootdiv1, div.rootdiv2]",
+ "pre", "objectBox-array");
+
+ tasks.run(function() {
+ FBTest.testDone("issue5779.DONE");
+ });
+ });
+ });
+}
1  tests/content/firebug.html
View
@@ -174,6 +174,7 @@
{group: "commandLine", uri: "commandLine/4453/issue4453.js", desc: "Issue 4453: Content of the command line can't be cleared.", testPage: "commandLine/4453/issue4453.html"},
{group: "commandLine", uri: "commandLine/5042/issue5042.js", desc: "Issue 5042: Command Line should not prevent tabbing out when empty", testPage: "commandLine/5042/issue5042.html"},
{group: "commandLine", uri: "commandLine/5130/issue5130.js", desc: "Array indices are sorted alphabetically instead of numerically", testPage: "commandLine/5130/issue5130.html"},
+ {group: "commandLine", uri: "commandLine/5779/issue5779.js", desc: "Allow to set the root element in $ and $$", testPage: "commandLine/5779/issue5779.html"},
{group: "html", uri: "html/breakpoints/breakOnElement.js", desc: "Mutation breakpoints test", testPage: "html/breakpoints/breakOnElement.html"},
{group: "html", uri: "html/breakpoints/breakOnElementCB.js", desc: "Mutation breakpoints test (Chromebug active)", testPage: "html/breakpoints/breakOnElement.html"},
{group: "html", uri: "html/breakpoints/breakOnNext.js", desc: "Mutation breakpoints test", testPage: "html/breakpoints/breakOnNext.html"},
Please sign in to comment.
Something went wrong with that request. Please try again.