finish filename filters admin and associated selenium test

This commit is contained in:
John Bintz 2010-01-20 07:43:30 -05:00
parent 001f51fe65
commit 85c46dbc3a
3 changed files with 90 additions and 3 deletions

View File

@ -207,6 +207,13 @@ function comicpress_admin() {
) as $key) {
$comicpress_options['comicpress_config'][$key] = wp_filter_nohtml_kses($_REQUEST[$key]);
}
if (isset($_REQUEST['comic_filename_filters'])) {
$comicpress_options['comic_filename_filters'] = comicpress_save_options_comic_filename_filters($_REQUEST['comic_filename_filters']);
} else {
$comicpress_options['comic_filename_filters'] = array();
}
$tab = 'config';
update_option('comicpress_options',$comicpress_options);
}

View File

@ -159,7 +159,6 @@
<input type="text" size="7" name="mini_comic_width" id="mini_comic_width" value="<?php echo $comicpress_options['comicpress_config']['mini_comic_width']; ?>" />
</td>
</tr>
<?php
$cpmh = new ComicPressMediaHandling();
@ -168,7 +167,6 @@
$filters['default'] = $cpmh->default_filter;
}
?>
<tr>
<th scope="row"><label><?php _e('Comic Filename Filters', 'comicpress'); ?></label></th>
<td colspan="2">
@ -194,7 +192,7 @@
</label>\
<label>\
<strong>Filter:</strong>\
<input type="text" size="60" name="comic_filename_filters[' + key + '][name]" value="' + data.filter + '" />\
<input type="text" size="60" name="comic_filename_filters[' + key + '][filter]" value="' + data.filter + '" />\
</label>\
<a href="#">Remove</a>\
</div>');

View File

@ -21,6 +21,43 @@
<td>//div[@id='comicpress-tab-config']/span</td>
<td></td>
</tr>
<!--Remove existing filters-->
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>filter_count</td>
</tr>
<tr>
<td>while</td>
<td>${filter_count} &gt; 0</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//div[@id='comicpress-comic-filename-filters-holder']/div[1]/a</td>
<td></td>
</tr>
<tr>
<td>assertConfirmation</td>
<td>Are you sure?</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>filter_count</td>
</tr>
<tr>
<td>endWhile</td>
<td></td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<!--Add and remove works-->
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
@ -46,6 +83,26 @@
<td>(${new_filter_count}) == (${filter_count} + 1)</td>
<td>true</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count} + 1)</td>
<td>true</td>
</tr>
<tr>
<td>click</td>
<td>//div[@id='comicpress-comic-filename-filters-holder']/div[2]/a</td>
@ -66,6 +123,31 @@
<td>(${new_filter_count}) == (${filter_count})</td>
<td>true</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>comicpress_save_config</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
<tr>
<td>storeXpathCount</td>
<td>//div[@id=&quot;comicpress-comic-filename-filters-holder&quot;]/div</td>
<td>new_filter_count</td>
</tr>
<tr>
<td>assertEval</td>
<td>(${new_filter_count}) == (${filter_count})</td>
<td>true</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>ComicPress Settings SAVED!</td>
<td></td>
</tr>
</tbody></table>
</body>