浏览代码

Added manual couple of tests.

Piotrek Koszuliński 9 年之前
父节点
当前提交
64ee61409a

+ 9 - 0
packages/ckeditor5-typing/tests/manual/delete.html

@@ -0,0 +1,9 @@
+<head>
+	<link rel="stylesheet" href="%APPS_DIR%ckeditor/build/modules/amd/theme/ckeditor.css">
+</head>
+
+<div id="editor">
+	<h2>Heading 1</h2>
+	<h3>Heading 2</h3>
+	<p><em>This</em> is an <strong>editor</strong> instance.</p>
+</div>

+ 26 - 0
packages/ckeditor5-typing/tests/manual/delete.js

@@ -0,0 +1,26 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
+import { getData } from '/tests/engine/_utils/model.js';
+
+window.getData = getData;
+
+window.setInterval( function() {
+	console.log( getData( window.editor.document ) );
+}, 3000 );
+
+ClassicEditor.create( document.querySelector( '#editor' ), {
+	features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic', 'heading' ],
+	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+} )
+.then( editor => {
+	window.editor = editor;
+} )
+.catch( err => {
+	console.error( err.stack );
+} );

+ 8 - 0
packages/ckeditor5-typing/tests/manual/delete.md

@@ -0,0 +1,8 @@
+@bender-ui: collapsed
+
+## Delete feature
+
+Check:
+
+* collapsed selection (by letter, by word, whole line),
+* non-collapsed selections.

+ 9 - 0
packages/ckeditor5-typing/tests/manual/input.html

@@ -0,0 +1,9 @@
+<head>
+	<link rel="stylesheet" href="%APPS_DIR%ckeditor/build/modules/amd/theme/ckeditor.css">
+</head>
+
+<div id="editor">
+	<h2>Heading 1</h2>
+	<h3>Heading 2</h3>
+	<p><em>This</em> is an <strong>editor</strong> instance.</p>
+</div>

+ 24 - 0
packages/ckeditor5-typing/tests/manual/input.js

@@ -0,0 +1,24 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
+import { getData } from '/tests/engine/_utils/model.js';
+
+window.setInterval( function() {
+	console.log( getData( window.editor.document ) );
+}, 3000 );
+
+ClassicEditor.create( document.querySelector( '#editor' ), {
+	features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic', 'heading' ],
+	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+} )
+.then( editor => {
+	window.editor = editor;
+} )
+.catch( err => {
+	console.error( err.stack );
+} );

+ 27 - 0
packages/ckeditor5-typing/tests/manual/input.md

@@ -0,0 +1,27 @@
+@bender-ui: collapsed
+
+## Input (typing) feature
+
+Check:
+
+* normal typing,
+* typing into non-collapsed selection.
+
+### IME
+
+* Hiragana,
+* Spanish-ISO: accent (it's under `'`) + "a",
+* MacOS: long "a" press (accent balloon).
+
+### Undo
+
+* undo step = 20,
+* additional step marks:
+  * changing the selection,
+  * applying inline style to collapsed selection,
+  * any other changes.
+
+### Misc
+
+* spell checker,
+* Safari: autocorrection balloon.

+ 19 - 0
packages/ckeditor5-typing/tests/manual/rtl.html

@@ -0,0 +1,19 @@
+<head>
+	<link rel="stylesheet" href="%APPS_DIR%ckeditor/build/modules/amd/theme/ckeditor.css">
+</head>
+
+<h1>Editor 1: [dir=rtl]</h1>
+
+<div id="editor1" dir="rtl">
+	<h2>شششش</h2>
+	<h3>ززززز</h3>
+	<p><em>ئئئئ</em> يي يي <strong>ثثثث</strong> ببببب.</p>
+</div>
+
+<h1>Editor 2: [dir=ltr], mixed content</h1>
+
+<div id="editor2">
+	<h2>Heading 1</h2>
+	<h3>ششششششششش</h3>
+	<p><em>This</em> يي an <strong>زززززز</strong> instance.</p>
+</div>

+ 40 - 0
packages/ckeditor5-typing/tests/manual/rtl.js

@@ -0,0 +1,40 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
+import { getData } from '/tests/engine/_utils/model.js';
+
+const config = {
+	features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic', 'heading' ],
+	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+};
+
+window.setInterval( function() {
+	if ( window.editor1.editing.view.isFocused ) {
+		console.log( 'editor 1', getData( window.editor1.document ) );
+	}
+
+	if ( window.editor2.editing.view.isFocused ) {
+		console.log( 'editor 2', getData( window.editor2.document ) );
+	}
+}, 3000 );
+
+ClassicEditor.create( document.querySelector( '#editor1' ), config )
+.then( editor => {
+	window.editor1 = editor;
+} )
+.catch( err => {
+	console.error( err.stack );
+} );
+
+ClassicEditor.create( document.querySelector( '#editor2' ), config )
+.then( editor => {
+	window.editor2 = editor;
+} )
+.catch( err => {
+	console.error( err.stack );
+} );

+ 5 - 0
packages/ckeditor5-typing/tests/manual/rtl.md

@@ -0,0 +1,5 @@
+@bender-ui: collapsed
+
+## Typing feature – RTL support
+
+Check whathever comes to your mind. It should not blow up.