start moving from prototype to jquery
This commit is contained in:
parent
1da4c8e4e1
commit
b1d6514e73
@ -111,6 +111,14 @@ var CategoryGroupings = {};
|
|||||||
$('.category-group-holder input[type=checkbox], .category-group-holder label')
|
$('.category-group-holder input[type=checkbox], .category-group-holder label')
|
||||||
.unbind('click')
|
.unbind('click')
|
||||||
.click(CategoryGroupings.highlight_child_levels);
|
.click(CategoryGroupings.highlight_child_levels);
|
||||||
|
|
||||||
|
$('.delete-category-group-holder')
|
||||||
|
.unbind('click')
|
||||||
|
.click(function() {
|
||||||
|
if (confirm('Are you sure?')) {
|
||||||
|
$(this).parents('.category-group-holder').remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
}(jQuery))
|
}(jQuery))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
87
test/selenium/TestCategoryGroupings.html
Normal file
87
test/selenium/TestCategoryGroupings.html
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<link rel="selenium.base" href="http://comicpress-mu.local/" />
|
||||||
|
<title>TestCategoryGroupings</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table cellpadding="1" cellspacing="1" border="1">
|
||||||
|
<thead>
|
||||||
|
<tr><td rowspan="1" colspan="3">TestCategoryGroupings</td></tr>
|
||||||
|
</thead><tbody>
|
||||||
|
<tr>
|
||||||
|
<td>open</td>
|
||||||
|
<td>/wp-admin</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>clickAndWait</td>
|
||||||
|
<td>link=ComicPress</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>click</td>
|
||||||
|
<td>comicpress-tab-Category_Groups</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>storeXpathCount</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div</td>
|
||||||
|
<td>current_count</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>click</td>
|
||||||
|
<td>add-new-category-group</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>storeEval</td>
|
||||||
|
<td>storedVars['current_count']++</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>waitForElementPresent</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div[${current_count}]</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>storeXpathCount</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div</td>
|
||||||
|
<td>new_count</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>assertEval</td>
|
||||||
|
<td>${current_count}</td>
|
||||||
|
<td>${new_count}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>assertValue</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div[${new_count}]//input[contains(@name, "[name]")]</td>
|
||||||
|
<td>group</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>click</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div[${new_count}]//a[@class="delete-category-group-holder"]</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>assertConfirmation</td>
|
||||||
|
<td>Are you sure?</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>storeXpathCount</td>
|
||||||
|
<td>//div[@id="category-groups-holder"]/div</td>
|
||||||
|
<td>new_count</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>assertEval</td>
|
||||||
|
<td>${current_count} - 1</td>
|
||||||
|
<td>${new_count}</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tbody></table>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user