Beispiel #1
0
<?php

require_once dirname(__FILE__) . '/KindEditorDriver.php';
$driver = new KindEditorDriver('test/total.html');
$driver->html('');
// bold
$driver->clickToolbar('bold');
$driver->input('abc');
equals($driver->html(), '<strong>abc</strong>');
// fontsize
$driver->clickToolbar('fontsize');
$driver->selector('.ke-menu-item', 6)->mouseover()->click();
$driver->input('abc');
equals($driver->html(), '<strong>abc<span style="font-size:24px;">abc</span></strong>');
// removeformat
$driver->clickToolbar('removeformat');
$driver->input('123');
equals($driver->html(), '<strong>abc<span style="font-size:24px;">abc</span></strong>123');
$driver->close();
Beispiel #2
0
<?php

require_once dirname(__FILE__) . '/KindEditorDriver.php';
$driver = new KindEditorDriver('test/dialog.html');
// drag dialog
$prevTop = intval($driver->script("return KindEditor('.ke-dialog').css('top')"));
$prevLeft = intval($driver->script("return KindEditor('.ke-dialog').css('left')"));
$driver->selector('.ke-dialog-header')->drag(100, 200);
equals(intval($driver->script("return KindEditor('.ke-dialog').css('top')")), $prevTop + 200);
equals(intval($driver->script("return KindEditor('.ke-dialog').css('left')")), $prevLeft + 100);
// close dialog
$driver->selector('.ke-dialog-icon-close')->click();
$driver->close();
<?php

require_once dirname(__FILE__) . '/KindEditorDriver.php';
$testFiles = array('test/core.html', 'test/event.html', 'test/html.html', 'test/selector.html', 'test/node.html', 'test/range.html', 'test/cmd.html', 'test/editor.html');
$driver = new KindEditorDriver();
foreach ($testFiles as $file) {
    $driver->open($file);
    equals($driver->selector('.failed')->element->text(), '0');
}
$driver->close();