/
issue2183.js
61 lines (47 loc) · 2.25 KB
/
issue2183.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function runTest()
{
FBTest.sysout("issue2183.START");
FBTest.openNewTab(basePath + "html/2183/issue2183.html", function(win)
{
FBTest.openFirebug();
var panel = FBTest.selectPanel("html");
// Show cropped text for this test
FBTest.setPref("showFullTextNodes", false);
FBTest.selectElementInHtmlPanel("paragraph", function(node)
{
var paragraph = node.getElementsByClassName("nodeText").item(0);
FBTest.compare(/Lorem.*?\.\.\..*?voluptua\./, paragraph.textContent,
"Node contents in HTML panel must be cropped");
FBTest.synthesizeMouse(paragraph);
var editor = panel.panelNode.getElementsByClassName("textEditorInner").item(0);
if (FBTest.ok(editor, "Editor must be available now"))
{
FBTest.compare(/^(?!.*\.\.\.)/, editor.value,
"Node contents in HTML panel must not be cropped in inline editor");
var config = {
tagName: "div",
classes: "nodeBox textNodeBox mutated"
};
FBTest.waitForDisplayedElement("html", config, function(node)
{
paragraph = node.getElementsByClassName("nodeText").item(0);
FBTest.compare(/Loram.*?\.\.\..*?voluptua\./, paragraph.textContent,
"Node contents in HTML panel must be cropped and contain 'Loram'");
FBTest.compare(/^Loram(?!.*\.\.\.)/, win.document.getElementById("paragraph").textContent,
"Node contents on page must not be cropped and contain 'Loram'");
FBTest.testDone("issue2183.DONE");
});
FBTest.sendKey("HOME", editor);
FBTest.sendKey("LEFT", editor);
// Move text cursor before the 'e' of 'Lorem'
for (var i=0; i<3; i++)
FBTest.sendKey("RIGHT", editor);
// Delete the 'e' of 'Lorem'
FBTest.sendKey("DELETE", editor);
// Enter a single quote
FBTest.sendChar("a", editor);
FBTest.synthesizeMouse(panel.panelNode);
}
});
});
}