diff --git a/CHANGES.md b/CHANGES.md index 370d5a8118c..45a434c988a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ API Changes: * [#2962](https://github.com/ckeditor/ckeditor-dev/issues/2962): Added the [`CKEDITOR.tools.promise`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_promise.html) class. * [#2924](https://github.com/ckeditor/ckeditor-dev/issues/2924): Added the [`CKEDITOR.tools.style.border`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools_style_border.html) object wrapping CSS border style helpers under single type. * [#2495](https://github.com/ckeditor/ckeditor-dev/issues/2495): [Table Selection](https://ckeditor.com/cke4/addon/tableselection) plugin can be now disabled for the given table by the `data-cke-tableselection-ignored` attribute. +* [#2692](https://github.com/ckeditor/ckeditor-dev/issues/2692): Plugins can now expose information about supported environment by implementing [`pluginDefinition.isSupportedEnvironment`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_pluginDefinition.html#method-isSupportedEnvironment) method. Other Changes: diff --git a/core/plugindefinition.js b/core/plugindefinition.js index ba031e906d3..ff8311cdba8 100644 --- a/core/plugindefinition.js +++ b/core/plugindefinition.js @@ -189,3 +189,29 @@ * * @property {String} [icons] */ + +/** + * A function which should be implemented if a plugin is not supported on every + * available environment according to + * [Browser Compatibility](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_browsers.html) + * or specific editor configuration. + * + * This function won't be called by the plugin loader itself and it's not required for a proper + * plugin initialization. However, it's recommended to implement the function if a plugin + * has environment requirements. This information may be important for related features + * and testing environment. + * + * ```javascript + * CKEDITOR.plugins.add( 'sample', { + * isSupportedEnvironment: function( editor ) { + * // Plugin supported only on modern browsers. + * return !CKEDITOR.env.ie || CKEDITOR.env.edge; + * } + * } ); + * ``` + * + * @since 4.12.0 + * @method isSupportedEnvironment + * @param {CKEDITOR.editor} editor + * @returns {Boolean} Information if the plugin is supported in the current environment. + */ diff --git a/core/plugins.js b/core/plugins.js index a5ade6be2ce..dc2d9a9477f 100644 --- a/core/plugins.js +++ b/core/plugins.js @@ -47,6 +47,12 @@ CKEDITOR.plugins.load = CKEDITOR.tools.override( CKEDITOR.plugins.load, function '.png' ); } } + + // Plugin is supported by default (#2692). + plugin.isSupportedEnvironment = plugin.isSupportedEnvironment || function() { + return true; + }; + initialized[ pluginName ] = 1; } diff --git a/core/selection.js b/core/selection.js index eb93cc1dfd6..13a77b4e304 100644 --- a/core/selection.js +++ b/core/selection.js @@ -2020,9 +2020,8 @@ // Handle special case - fake selection of table cells. if ( editor && editor.plugins.tableselection && - CKEDITOR.plugins.tableselection.isSupportedEnvironment && - isTableSelection( ranges ) && - !isSelectingTable && + editor.plugins.tableselection.isSupportedEnvironment() && + isTableSelection( ranges ) && !isSelectingTable && !ranges[ 0 ]._getTableElement( { table: 1 } ).hasAttribute( 'data-cke-tableselection-ignored' ) ) { performFakeTableSelection.call( this, ranges ); diff --git a/plugins/autocomplete/plugin.js b/plugins/autocomplete/plugin.js index ec76666ab99..354533206ec 100644 --- a/plugins/autocomplete/plugin.js +++ b/plugins/autocomplete/plugin.js @@ -11,6 +11,9 @@ requires: 'textwatcher', onLoad: function() { CKEDITOR.document.appendStyleSheet( this.path + 'skins/default.css' ); + }, + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version > 8; } } ); diff --git a/plugins/balloontoolbar/plugin.js b/plugins/balloontoolbar/plugin.js index 697851bd406..11b72c81bf6 100644 --- a/plugins/balloontoolbar/plugin.js +++ b/plugins/balloontoolbar/plugin.js @@ -614,6 +614,10 @@ CKEDITOR.plugins.add( 'balloontoolbar', { requires: 'balloonpanel', + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version > 8; + }, + beforeInit: function( editor ) { if ( !cssLoaded ) { // Load fallback styles. diff --git a/plugins/codesnippet/plugin.js b/plugins/codesnippet/plugin.js index 6c612bc0b09..94010f59b12 100644 --- a/plugins/codesnippet/plugin.js +++ b/plugins/codesnippet/plugin.js @@ -10,14 +10,16 @@ 'use strict'; ( function() { - var isBrowserSupported = !CKEDITOR.env.ie || CKEDITOR.env.version > 8; - CKEDITOR.plugins.add( 'codesnippet', { requires: 'widget,dialog', lang: 'ar,az,bg,ca,cs,da,de,de-ch,el,en,en-au,en-gb,eo,es,es-mx,et,eu,fa,fi,fr,fr-ca,gl,he,hr,hu,id,it,ja,km,ko,ku,lt,lv,nb,nl,no,oc,pl,pt,pt-br,ro,ru,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% icons: 'codesnippet', // %REMOVE_LINE_CORE% hidpi: true, // %REMOVE_LINE_CORE% + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version > 8; + }, + beforeInit: function( editor ) { editor._.codesnippet = {}; @@ -105,7 +107,7 @@ init: function( callback ) { var that = this; - if ( isBrowserSupported ) { + if ( editor.plugins.codesnippet.isSupportedEnvironment() ) { CKEDITOR.scriptLoader.load( path + 'lib/highlight/highlight.pack.js', function() { that.hljs = window.hljs; callback(); @@ -313,7 +315,7 @@ callback = function( formatted ) { // IE8 (not supported browser) have issue with new line chars, when using innerHTML. // It will simply strip it. - that.parts.code.setHtml( isBrowserSupported ? + that.parts.code.setHtml( editor.plugins.codesnippet.isSupportedEnvironment() ? formatted : formatted.replace( newLineRegex, '
' ) ); }; diff --git a/plugins/easyimage/plugin.js b/plugins/easyimage/plugin.js index e7adcc5a8c9..3ee9e51a945 100644 --- a/plugins/easyimage/plugin.js +++ b/plugins/easyimage/plugin.js @@ -494,10 +494,6 @@ } }; - function isSupportedBrowser() { - return !CKEDITOR.env.ie || CKEDITOR.env.version >= 11; - } - function addUploadButtonToToolbar( editor ) { editor.ui.addButton( BUTTON_PREFIX + 'Upload', { label: editor.lang.easyimage.commands.upload, @@ -535,8 +531,12 @@ CKEDITOR.dialog.add( 'easyimageAlt', this.path + 'dialogs/easyimagealt.js' ); }, + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version >= 11; + }, + init: function( editor ) { - if ( !isSupportedBrowser() ) { + if ( !this.isSupportedEnvironment() ) { return; } loadStyles( editor, this ); @@ -545,7 +545,7 @@ // Widget must be registered after init in case that link plugin is dynamically loaded e.g. via // `config.extraPlugins`. afterInit: function( editor ) { - if ( !isSupportedBrowser() ) { + if ( !this.isSupportedEnvironment() ) { return; } var styles = getStylesForEditor( editor ); diff --git a/plugins/emoji/plugin.js b/plugins/emoji/plugin.js index 2bd5e3f64cd..05e1ec019a8 100644 --- a/plugins/emoji/plugin.js +++ b/plugins/emoji/plugin.js @@ -549,8 +549,12 @@ icons: 'emojipanel', hidpi: true, + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version >= 11; + }, + beforeInit: function() { - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) { + if ( !this.isSupportedEnvironment() ) { return; } if ( !stylesLoaded ) { @@ -560,7 +564,7 @@ }, init: function( editor ) { - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) { + if ( !this.isSupportedEnvironment() ) { return; } diff --git a/plugins/mathjax/plugin.js b/plugins/mathjax/plugin.js index 92e1f828681..b7564ca8745 100644 --- a/plugins/mathjax/plugin.js +++ b/plugins/mathjax/plugin.js @@ -18,6 +18,10 @@ icons: 'mathjax', hidpi: true, // %REMOVE_LINE_CORE% + isSupportedEnvironment: function() { + return !CKEDITOR.env.ie || CKEDITOR.env.version > 8; + }, + init: function( editor ) { var cls = editor.config.mathJaxClass || 'math-tex'; diff --git a/plugins/mentions/plugin.js b/plugins/mentions/plugin.js index 58a3bec3b4a..e95174ae6c8 100644 --- a/plugins/mentions/plugin.js +++ b/plugins/mentions/plugin.js @@ -26,6 +26,9 @@ self.instances.push( new Mentions( editor, config ) ); } ); } ); + }, + isSupportedEnvironment: function( editor ) { + return editor.plugins.autocomplete.isSupportedEnvironment( editor ); } } ); diff --git a/plugins/tableselection/plugin.js b/plugins/tableselection/plugin.js index f809f519728..b341d37147e 100644 --- a/plugins/tableselection/plugin.js +++ b/plugins/tableselection/plugin.js @@ -1149,20 +1149,16 @@ var editable = editor.editable(); editable.attachListener( editable, 'keydown', getTableOnKeyDownListener( editor ), null, null, -1 ); editable.attachListener( editable, 'keypress', tableKeyPressListener, null, null, -1 ); - }, - - /** - * Determines whether table selection is supported in the current environment. - * - * @property {Boolean} - * @private - */ - isSupportedEnvironment: !( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) + } }; CKEDITOR.plugins.add( 'tableselection', { requires: 'clipboard,tabletools', + isSupportedEnvironment: function() { + return !( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ); + }, + onLoad: function() { // We can't alias these features earlier, as they could be still not loaded. tabletools = CKEDITOR.plugins.tabletools; @@ -1176,7 +1172,7 @@ init: function( editor ) { // Disable unsupported browsers. - if ( !CKEDITOR.plugins.tableselection.isSupportedEnvironment ) { + if ( !this.isSupportedEnvironment() ) { return; } diff --git a/plugins/uploadfile/plugin.js b/plugins/uploadfile/plugin.js index f162bee610b..d1e9b93d1e4 100644 --- a/plugins/uploadfile/plugin.js +++ b/plugins/uploadfile/plugin.js @@ -10,7 +10,7 @@ requires: 'uploadwidget,link', init: function( editor ) { // Do not execute this paste listener if it will not be possible to upload file. - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { + if ( !this.isSupportedEnvironment() ) { return; } @@ -37,6 +37,10 @@ this.replaceWith( '' + upload.fileName + '' ); } } ); + }, + + isSupportedEnvironment: function() { + return CKEDITOR.plugins.clipboard.isFileApiSupported; } } ); } )(); diff --git a/plugins/uploadimage/plugin.js b/plugins/uploadimage/plugin.js index 16174079da3..a85bfa5d501 100644 --- a/plugins/uploadimage/plugin.js +++ b/plugins/uploadimage/plugin.js @@ -40,9 +40,13 @@ ); }, + isSupportedEnvironment: function() { + return CKEDITOR.plugins.clipboard.isFileApiSupported; + }, + init: function( editor ) { // Do not execute this paste listener if it will not be possible to upload file. - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { + if ( !this.isSupportedEnvironment() ) { return; } diff --git a/plugins/uploadwidget/plugin.js b/plugins/uploadwidget/plugin.js index ddfac47eaa5..574c1e4a42f 100644 --- a/plugins/uploadwidget/plugin.js +++ b/plugins/uploadwidget/plugin.js @@ -15,6 +15,10 @@ // because otherwise wrong widget may handle upload placeholder element (e.g. image2 plugin would handle image). // `data-widget` attribute is allowed only in the elements which has also `data-cke-upload-id` attribute. editor.filter.allow( '*[!data-widget,!data-cke-upload-id]' ); + }, + + isSupportedEnvironment: function() { + return CKEDITOR.plugins.clipboard.isFileApiSupported; } } ); diff --git a/tests/_benderjs/ckeditor/static/tools.js b/tests/_benderjs/ckeditor/static/tools.js index ac3af71ee66..ecddb409c63 100644 --- a/tests/_benderjs/ckeditor/static/tools.js +++ b/tests/_benderjs/ckeditor/static/tools.js @@ -59,6 +59,46 @@ } ); bender.tools = { + /** + * Ignores test case when the given plugin is not supported on the testing + * environment. Uses {@link CKEDITOR.pluginDefinition#isSupportedEnvironment} to + * verify if plugin is supported. + * + * Works for both manual and unit tests. + * + * @param pluginName pluginName Plugin name to check. + * @param CKEDITOR.editor [editor] Editor instance passsed as an argument + * to the {@link CKEDITOR.pluginDefinition#isSupportedEnvironment} method. + */ + ignoreUnsupportedEnvironment: function( pluginName, editor ) { + if ( editor ) { + if ( editor.status === 'ready' ) { + ignoreUnsupportedEnvironment(); + } else { + editor.once( 'instanceReady', ignoreUnsupportedEnvironment ); + } + return; + } + + if ( CKEDITOR.plugins.registered[ pluginName ] ) { + ignoreUnsupportedEnvironment(); + } else { + CKEDITOR.once( pluginName + 'PluginReady', ignoreUnsupportedEnvironment ); + } + + function ignoreUnsupportedEnvironment() { + var plugin = editor ? editor.plugins[ pluginName ] : CKEDITOR.plugins.registered[ pluginName ]; + + if ( !plugin.isSupportedEnvironment( editor ) ) { + if ( bender.testData.manual ) { + bender.ignore(); + } else { + assert.ignore(); + } + } + } + }, + /** * Creates an array from an object. * diff --git a/tests/core/plugins/plugins.html b/tests/core/plugins/plugins.html index 65cde717c2b..67ea7a1ed81 100644 --- a/tests/core/plugins/plugins.html +++ b/tests/core/plugins/plugins.html @@ -1 +1,2 @@ - \ No newline at end of file + + diff --git a/tests/core/plugins/plugins.js b/tests/core/plugins/plugins.js index 8082744f2d7..bac838c7e3b 100644 --- a/tests/core/plugins/plugins.js +++ b/tests/core/plugins/plugins.js @@ -103,5 +103,32 @@ bender.test( assert.isFalse( result, 'Conflicts not detected.' ); assert.isFalse( spy.called ); + }, + + // (#2692) + 'test supported environment': function() { + CKEDITOR.plugins.add( 'envdefault', {} ); + CKEDITOR.plugins.add( 'envcustom', { + isSupportedEnvironment: function() { + return false; + } + } ); + + var editor = CKEDITOR.replace( 'env', { + plugins: 'wysiwygarea,envdefault,envcustom', + on: { + instanceReady: function() { + resume( function() { + assert.isTrue( editor.plugins.envdefault.isSupportedEnvironment(), + 'Plugin should be supported by default' ); + + assert.isFalse( editor.plugins.envcustom.isSupportedEnvironment(), + 'Plugin should allow for custom isSupportedEnvironment implementation' ); + } ); + } + } + } ); + + wait(); } } ); diff --git a/tests/plugins/autocomplete/autocomplete.js b/tests/plugins/autocomplete/autocomplete.js index e20cb6d557c..94641de65c2 100644 --- a/tests/plugins/autocomplete/autocomplete.js +++ b/tests/plugins/autocomplete/autocomplete.js @@ -33,9 +33,7 @@ bender.test( { setUp: function() { - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'autocomplete' ); }, 'test API exists': function() { diff --git a/tests/plugins/autocomplete/focus.js b/tests/plugins/autocomplete/focus.js index 73798f711f1..31b188ffc45 100644 --- a/tests/plugins/autocomplete/focus.js +++ b/tests/plugins/autocomplete/focus.js @@ -13,9 +13,7 @@ bender.test( { setUp: function() { - if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'autocomplete' ); }, 'test preventDefault is called on mousedown': function() { diff --git a/tests/plugins/autocomplete/manual/__template__.html b/tests/plugins/autocomplete/manual/__template__.html index 1e3b6f7d1a0..8b45d7f7771 100644 --- a/tests/plugins/autocomplete/manual/__template__.html +++ b/tests/plugins/autocomplete/manual/__template__.html @@ -6,9 +6,7 @@ diff --git a/tests/plugins/easyimage/manual/easyimage.html b/tests/plugins/easyimage/manual/easyimage.html index e5734d63648..0d84cb936be 100644 --- a/tests/plugins/easyimage/manual/easyimage.html +++ b/tests/plugins/easyimage/manual/easyimage.html @@ -31,9 +31,7 @@

Inline editor

diff --git a/tests/plugins/easyimage/manual/progressbar.html b/tests/plugins/easyimage/manual/progressbar.html index 8c0a415e6f7..2ebbf870cbe 100644 --- a/tests/plugins/easyimage/manual/progressbar.html +++ b/tests/plugins/easyimage/manual/progressbar.html @@ -26,10 +26,13 @@

Sample editor

diff --git a/tests/plugins/emoji/manual/dropdown/dropdownfiltering.md b/tests/plugins/emoji/manual/dropdown/dropdownfiltering.md index e774f1ab24a..b65c3052fd5 100644 --- a/tests/plugins/emoji/manual/dropdown/dropdownfiltering.md +++ b/tests/plugins/emoji/manual/dropdown/dropdownfiltering.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.0, feature, emoji, 2062 @bender-ckeditor-plugins: wysiwygarea, toolbar, elementspath, sourcearea, emoji, clipboard, undo, stylescombo, format @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Type any search string diff --git a/tests/plugins/emoji/manual/dropdown/dropdownfocus.md b/tests/plugins/emoji/manual/dropdown/dropdownfocus.md index 1b5b61d3986..17d5b712edd 100644 --- a/tests/plugins/emoji/manual/dropdown/dropdownfocus.md +++ b/tests/plugins/emoji/manual/dropdown/dropdownfocus.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.0, feature, emoji, 2062 @bender-ckeditor-plugins: wysiwygarea, toolbar, elementspath, sourcearea, emoji, clipboard, undo, stylescombo, format @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Start to move around it with `Tab`, `Shift + tab` and arrow keys. diff --git a/tests/plugins/emoji/manual/dropdown/dropdowninputoutline.html b/tests/plugins/emoji/manual/dropdown/dropdowninputoutline.html index e3c2aa55b75..6ff6f61aa97 100644 --- a/tests/plugins/emoji/manual/dropdown/dropdowninputoutline.html +++ b/tests/plugins/emoji/manual/dropdown/dropdowninputoutline.html @@ -11,9 +11,7 @@

Right to left editor:

diff --git a/tests/plugins/emoji/manual/dropdown/outlinestyle.md b/tests/plugins/emoji/manual/dropdown/outlinestyle.md index b4f117c0d65..9c1170c1832 100644 --- a/tests/plugins/emoji/manual/dropdown/outlinestyle.md +++ b/tests/plugins/emoji/manual/dropdown/outlinestyle.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.3, bug, emoji, 2572 @bender-ckeditor-plugins: wysiwygarea, toolbar, elementspath, sourcearea, emoji, clipboard, undo, stylescombo, format @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Move focus (blue rectangular border) to `nature and animals` group. diff --git a/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.html b/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.html index cdb53f6f705..a4591ad93ec 100644 --- a/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.html +++ b/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.html @@ -5,9 +5,11 @@

Classic editor

diff --git a/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.md b/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.md index 5134fd8903b..9b28c0ccb77 100644 --- a/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.md +++ b/tests/plugins/emoji/manual/dropdown/pointercursorinnavigation.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.3, bug, emoji, 2592 @bender-ckeditor-plugins: wysiwygarea, toolbar, elementspath, sourcearea, emoji, clipboard, undo, stylescombo, format @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Move cursor over group navigation at top of dropdown. diff --git a/tests/plugins/emoji/manual/dropdown/scrollpagebug.html b/tests/plugins/emoji/manual/dropdown/scrollpagebug.html index b6b70077478..b557a7f2cdc 100644 --- a/tests/plugins/emoji/manual/dropdown/scrollpagebug.html +++ b/tests/plugins/emoji/manual/dropdown/scrollpagebug.html @@ -10,9 +10,7 @@

Classic editor

diff --git a/tests/plugins/emoji/manual/dropdown/scrollpagebug.md b/tests/plugins/emoji/manual/dropdown/scrollpagebug.md index dfbf938450e..cc36e011bf8 100644 --- a/tests/plugins/emoji/manual/dropdown/scrollpagebug.md +++ b/tests/plugins/emoji/manual/dropdown/scrollpagebug.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.1, bug, emoji, 2571, 4.11.3, 2592 @bender-ckeditor-plugins: wysiwygarea, toolbar, emoji @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Click into emoji group. diff --git a/tests/plugins/emoji/manual/dropdown/statusbar.md b/tests/plugins/emoji/manual/dropdown/statusbar.md index 36a758d892b..7221e1b4fca 100644 --- a/tests/plugins/emoji/manual/dropdown/statusbar.md +++ b/tests/plugins/emoji/manual/dropdown/statusbar.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.0, bug, emoji, 2561 @bender-ckeditor-plugins: wysiwygarea, toolbar, emoji @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Move cursor over emoji icon to show up status bar at the bottom of the panel. diff --git a/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.html b/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.html index cdb53f6f705..a4591ad93ec 100644 --- a/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.html +++ b/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.html @@ -5,9 +5,11 @@

Classic editor

diff --git a/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.md b/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.md index 253cae7a7cc..bbb70389759 100644 --- a/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.md +++ b/tests/plugins/emoji/manual/dropdown/statusbaricontopmargin.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.3, bug, emoji, 2572 @bender-ckeditor-plugins: wysiwygarea, toolbar, elementspath, sourcearea, emoji, clipboard, undo, stylescombo, format @bender-ui: collapsed -@bender-include: ../../_helpers/tools.js 1. Open emoji dropdown. 2. Search for `wastebasket` emoji. diff --git a/tests/plugins/emoji/manual/emoji.html b/tests/plugins/emoji/manual/emoji.html index 7cb58c8345c..ddb92943c07 100644 --- a/tests/plugins/emoji/manual/emoji.html +++ b/tests/plugins/emoji/manual/emoji.html @@ -27,9 +27,8 @@
This is header H6
diff --git a/tests/plugins/emoji/manual/repeated.md b/tests/plugins/emoji/manual/repeated.md index 922380a6a87..b0796ac446c 100644 --- a/tests/plugins/emoji/manual/repeated.md +++ b/tests/plugins/emoji/manual/repeated.md @@ -1,7 +1,6 @@ @bender-tags: 4.11.0, bug, emoji, 2394 @bender-ckeditor-plugins: wysiwygarea, sourcearea, emoji @bender-ui: collapsed -@bender-include: ../_helpers/tools.js ## For both editors: diff --git a/tests/plugins/emoji/manual/sortingorder.html b/tests/plugins/emoji/manual/sortingorder.html index 8d1b5590717..0447cfabd71 100644 --- a/tests/plugins/emoji/manual/sortingorder.html +++ b/tests/plugins/emoji/manual/sortingorder.html @@ -6,9 +6,8 @@ diff --git a/tests/plugins/emoji/manual/spacerequired.md b/tests/plugins/emoji/manual/spacerequired.md index b416966de9b..9df30a0b1a8 100644 --- a/tests/plugins/emoji/manual/spacerequired.md +++ b/tests/plugins/emoji/manual/spacerequired.md @@ -1,7 +1,6 @@ @bender-tags: 4.10.1, bug, emoji, 2195 @bender-ckeditor-plugins: wysiwygarea, sourcearea, emoji @bender-ui: collapsed -@bender-include: ../_helpers/tools.js ## For both editors: diff --git a/tests/plugins/emoji/manual/twoeditors.html b/tests/plugins/emoji/manual/twoeditors.html index 98279420574..99769b6477c 100644 --- a/tests/plugins/emoji/manual/twoeditors.html +++ b/tests/plugins/emoji/manual/twoeditors.html @@ -11,9 +11,8 @@

Editor two

diff --git a/tests/plugins/image/manual/easyimageimage2.html b/tests/plugins/image/manual/easyimageimage2.html index 84d943cc994..03344d5dc0b 100644 --- a/tests/plugins/image/manual/easyimageimage2.html +++ b/tests/plugins/image/manual/easyimageimage2.html @@ -1,9 +1,11 @@
diff --git a/tests/plugins/image2/init.js b/tests/plugins/image2/init.js index 789ccd93ea6..a7454b85695 100644 --- a/tests/plugins/image2/init.js +++ b/tests/plugins/image2/init.js @@ -1,6 +1,5 @@ /* bender-tags: editor,widget */ /* bender-include: ../easyimage/_helpers/tools.js */ -/* global easyImageTools */ ( function() { 'use strict'; @@ -8,10 +7,6 @@ bender.test( { // (#1791) 'test plugin init when easyimage is active': function() { - if ( easyImageTools.isUnsupportedEnvironment() ) { - assert.ignore(); - } - var spy = sinon.spy( CKEDITOR, 'warn' ); bender.editorBot.create( { @@ -24,6 +19,8 @@ spy.restore(); + bender.tools.ignoreUnsupportedEnvironment( 'easyimage', editor ); + assert.isTrue( spy.calledWith( 'editor-plugin-conflict', { plugin: 'image2', replacedWith: 'easyimage' } ) ); assert.isUndefined( editor.commands.image, 'Command' ); assert.isUndefined( editor.widgets.registered.image, 'Widget' ); diff --git a/tests/plugins/image2/manual/easyimage.html b/tests/plugins/image2/manual/easyimage.html index d7e257be45f..7f5a26af920 100644 --- a/tests/plugins/image2/manual/easyimage.html +++ b/tests/plugins/image2/manual/easyimage.html @@ -1,10 +1,12 @@
diff --git a/tests/plugins/mentions/manual/casesensitive.html b/tests/plugins/mentions/manual/casesensitive.html index 484cf029079..ff9214a91e0 100644 --- a/tests/plugins/mentions/manual/casesensitive.html +++ b/tests/plugins/mentions/manual/casesensitive.html @@ -4,12 +4,7 @@ diff --git a/tests/plugins/mentions/manual/diacritic.html b/tests/plugins/mentions/manual/diacritic.html index 716e7ad3db9..e6a30b443e0 100644 --- a/tests/plugins/mentions/manual/diacritic.html +++ b/tests/plugins/mentions/manual/diacritic.html @@ -2,14 +2,13 @@ diff --git a/tests/plugins/mentions/manual/mentions.html b/tests/plugins/mentions/manual/mentions.html index 40d085f5fb8..43074ceb21d 100644 --- a/tests/plugins/mentions/manual/mentions.html +++ b/tests/plugins/mentions/manual/mentions.html @@ -5,11 +5,6 @@ diff --git a/tests/plugins/mentions/manual/viewTemplate.html b/tests/plugins/mentions/manual/viewTemplate.html index d501fcc3f83..34788164e4b 100644 --- a/tests/plugins/mentions/manual/viewTemplate.html +++ b/tests/plugins/mentions/manual/viewTemplate.html @@ -1,12 +1,7 @@
diff --git a/tests/plugins/mentions/mentions.js b/tests/plugins/mentions/mentions.js index fa17c025ef3..6014e44d7f4 100644 --- a/tests/plugins/mentions/mentions.js +++ b/tests/plugins/mentions/mentions.js @@ -15,9 +15,7 @@ bender.test( { setUp: function() { - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'mentions', this.editor ); }, tearDown: function() { diff --git a/tests/plugins/table/fakeselectionadvancetab.js b/tests/plugins/table/fakeselectionadvancetab.js index 67be0f53bca..9080b8fdad9 100644 --- a/tests/plugins/table/fakeselectionadvancetab.js +++ b/tests/plugins/table/fakeselectionadvancetab.js @@ -8,12 +8,12 @@ bender.test( { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + // #579 'test advance table dialog for ignorig selection class': function() { - if ( !CKEDITOR.plugins.tableselection.isSupportedEnvironment ) { - assert.ignore(); - } - var bot = this.editorBot; // Add table with fake selection. diff --git a/tests/plugins/table/manual/fakeselectionadvancetab.html b/tests/plugins/table/manual/fakeselectionadvancetab.html index 99f166f9d8f..f6fae9c0570 100644 --- a/tests/plugins/table/manual/fakeselectionadvancetab.html +++ b/tests/plugins/table/manual/fakeselectionadvancetab.html @@ -25,10 +25,6 @@ diff --git a/tests/plugins/tableselection/_helpers/tableselection.js b/tests/plugins/tableselection/_helpers/tableselection.js index caf5c79eedc..7119b54c6a9 100644 --- a/tests/plugins/tableselection/_helpers/tableselection.js +++ b/tests/plugins/tableselection/_helpers/tableselection.js @@ -36,30 +36,7 @@ for ( i = 0; i < ranges.length; i++ ) { ranges[ i ]._getTableElement().addClass( addSelected ? 'selected' : 'cke_marked' ); } - }, - - /* - * Modifies testSuite by adding entries in `_should.ignore` object for each method/property, if - * the current environment is not supported. - * - * @param {Object} testSuite - * @param {Boolean} [check] Custom check to be considered in addition to the default one. - */ - ignoreUnsupportedEnvironment: function( testSuite, check ) { - testSuite._should = testSuite._should || {}; - testSuite._should.ignore = testSuite._should.ignore || {}; - - for ( var key in testSuite ) { - if ( ( typeof check !== 'undefined' && !check ) || !this.isSupportedEnvironment ) { - testSuite._should.ignore[ key ] = true; - } - } - }, - - /* - * @property {Boolean} isSupportedEnvironment Whether table selection supports current environment. - */ - isSupportedEnvironment: !( CKEDITOR.env.ie && CKEDITOR.env.version < 11 ) + } }; function shrinkSelections( editor ) { diff --git a/tests/plugins/tableselection/getcellsbetween.js b/tests/plugins/tableselection/getcellsbetween.js index 3f1140db3e5..7fc32d62cbc 100644 --- a/tests/plugins/tableselection/getcellsbetween.js +++ b/tests/plugins/tableselection/getcellsbetween.js @@ -14,6 +14,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test getCellsBetween': function( editor, bot ) { var editable = editor.editable(), first, @@ -90,7 +93,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/clipboard/pasteflow.js b/tests/plugins/tableselection/integrations/clipboard/pasteflow.js index c42af4b7922..da96a4c39f1 100644 --- a/tests/plugins/tableselection/integrations/clipboard/pasteflow.js +++ b/tests/plugins/tableselection/integrations/clipboard/pasteflow.js @@ -1,7 +1,6 @@ /* bender-tags: tableselection, clipboard */ /* bender-ckeditor-plugins: undo,tableselection */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -51,6 +50,10 @@ } var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + 'test paste flow (tabular content)': function( editor, bot ) { testPasteFlow( bot, 'tabular-paste', '2cells1row' ); }, @@ -62,7 +65,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/clipboard/pastemerge.js b/tests/plugins/tableselection/integrations/clipboard/pastemerge.js index aef26f65952..a3684436c48 100644 --- a/tests/plugins/tableselection/integrations/clipboard/pastemerge.js +++ b/tests/plugins/tableselection/integrations/clipboard/pastemerge.js @@ -1,7 +1,7 @@ /* bender-tags: tableselection, clipboard */ /* bender-ckeditor-plugins: undo,tableselection */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers, createPasteTestCase */ +/* global createPasteTestCase */ ( function() { 'use strict'; @@ -11,6 +11,10 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + 'test doesnt break regular paste': function( editor ) { bender.tools.setHtmlWithSelection( editor, '

foo^bar

' ); bender.tools.emulatePaste( editor, '

bam

' ); @@ -72,7 +76,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/clipboard/pastenested.js b/tests/plugins/tableselection/integrations/clipboard/pastenested.js index c81dbd8e62f..eef2b6b046f 100644 --- a/tests/plugins/tableselection/integrations/clipboard/pastenested.js +++ b/tests/plugins/tableselection/integrations/clipboard/pastenested.js @@ -2,7 +2,7 @@ /* bender-ckeditor-plugins: undo,tableselection */ /* bender-ckeditor-remove-plugins: dialogadvtab */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers, createPasteTestCase */ +/* global createPasteTestCase */ ( function() { 'use strict'; @@ -15,6 +15,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test paste 2x1 table into nested 2x1 table': createPasteTestCase( 'nested-2x1-2x1', 'paste-2x1' ), 'test paste 2x2 table into nested 2x1 table': createPasteTestCase( 'nested-2x1-2x2', 'paste-2x2' ), 'test paste 1x1 table into nested 2x1 table': createPasteTestCase( 'nested-2x1-1x1', 'paste-1x1' ), @@ -27,7 +30,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/clipboard/pastewrapped.js b/tests/plugins/tableselection/integrations/clipboard/pastewrapped.js index e5edd0ffcfd..29a1cc0fbd8 100644 --- a/tests/plugins/tableselection/integrations/clipboard/pastewrapped.js +++ b/tests/plugins/tableselection/integrations/clipboard/pastewrapped.js @@ -2,13 +2,15 @@ /* bender-ckeditor-plugins: tableselection */ /* bender-ckeditor-remove-plugins: dialogadvtab */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, // (#2403) 'test pasting table': function() { var editor = CKEDITOR.inline( CKEDITOR.document.getById( 'wrapped' ), { @@ -31,8 +33,6 @@ } }; - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/clipboard/xss.js b/tests/plugins/tableselection/integrations/clipboard/xss.js index 87a95e069f5..ca76861480b 100644 --- a/tests/plugins/tableselection/integrations/clipboard/xss.js +++ b/tests/plugins/tableselection/integrations/clipboard/xss.js @@ -1,7 +1,6 @@ /* bender-tags: tableselection, clipboard */ /* bender-ckeditor-plugins: undo,tableselection */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -22,6 +21,12 @@ var tests = { setUp: function() { + if ( !CKEDITOR.env.ie && !CKEDITOR.env.iOS ) { + assert.ignore(); + } + + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + window.attack = sinon.spy(); }, @@ -45,7 +50,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests, !CKEDITOR.env.ie && !CKEDITOR.env.iOS ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/core/getextractselectedhtml.js b/tests/plugins/tableselection/integrations/core/getextractselectedhtml.js index bec2c044a3b..0518fd60bcb 100644 --- a/tests/plugins/tableselection/integrations/core/getextractselectedhtml.js +++ b/tests/plugins/tableselection/integrations/core/getextractselectedhtml.js @@ -19,6 +19,10 @@ } var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + // (https://dev.ckeditor.com/ticket/13884) 'test getSelectedHtml with multiple ranges': function( editor ) { bender.tools.testInputOut( 'multipleRanges', function( input, expected ) { @@ -91,7 +95,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); }() ); diff --git a/tests/plugins/tableselection/integrations/core/selection.js b/tests/plugins/tableselection/integrations/core/selection.js index ed86f23236d..de7bcebeaad 100644 --- a/tests/plugins/tableselection/integrations/core/selection.js +++ b/tests/plugins/tableselection/integrations/core/selection.js @@ -1,7 +1,6 @@ /* bender-tags: tableselection, selection */ /* bender-ckeditor-plugins: basicstyles,undo,tableselection,sourcearea,toolbar */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -93,6 +92,9 @@ } var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, tearDown: function() { if ( this._oldVerbosity !== undefined ) { // Some tests might override verbosity, restore it if requested. @@ -101,7 +103,7 @@ } }, - 'Check if selection is in table': function() { + 'test check if selection is in table': function() { var editor = this.editor, editable = editor.editable(), selection = editor.getSelection(), @@ -196,7 +198,12 @@ assert.isTrue( selection.isInTable(), 'Only cell in the table.' ); }, - 'Make fake table selection': function() { + 'test make fake table selection': function() { + // Ignores for Edge (#1944). + if ( CKEDITOR.env.edge ) { + assert.ignore(); + } + var editor = this.editor, selection = editor.getSelection(), initialRev = selection.rev, @@ -237,7 +244,12 @@ clearTableSelection( editor.editable() ); }, - 'Reset fake-selection': function() { + 'test reset fake-selection': function() { + // Ignores for Edge (#1944). + if ( CKEDITOR.env.edge ) { + assert.ignore(); + } + var editor = this.editor, selection = editor.getSelection(), ranges; @@ -263,7 +275,7 @@ clearTableSelection( editor.editable() ); }, - 'Fire selectionchange event': function() { + 'test fire selectionchange event': function() { var editor = this.editor, selectionChange = 0, selection = editor.getSelection(), @@ -291,7 +303,7 @@ }, 50 ); }, - 'isInTable allowPartially test (collapsed range)': function() { + 'test isInTable allowPartially test (collapsed range)': function() { var editor = this.editor; bender.tools.setHtmlWithSelection( editor, CKEDITOR.document.getById( 'allowPartiallyIssue' ).getHtml() ); @@ -302,7 +314,7 @@ }, // (#2945) - 'Test selecting ignored element': function() { + 'test selecting ignored element': function() { var editor = this.editor, selection = editor.getSelection(); @@ -321,7 +333,7 @@ }, // (#2945) - 'Test selecting ignored element (ranges)': function() { + 'test selecting ignored element (ranges)': function() { var editor = this.editor, selection = editor.getSelection(); @@ -340,7 +352,7 @@ assert.isNotNull( selection.getSelectedText(), 'getSelectedText() should not be null' ); }, - 'Change selection': function() { + 'test change selection': function() { var editor = this.editor, ranges; @@ -377,7 +389,7 @@ }, 50 ); }, - 'Fake-selection bookmark': function() { + 'test fake-selection bookmark': function() { var editor = this.editor, selection = editor.getSelection(), ranges, @@ -411,7 +423,7 @@ clearTableSelection( editor.editable() ); }, - 'Fake-selection bookmark (serializable)': function() { + 'test fake-selection bookmark (serializable)': function() { var editor = this.editor, selection = editor.getSelection(), ranges, @@ -448,7 +460,7 @@ clearTableSelection( editor.editable() ); }, - 'Fake-selection bookmark 2': function() { + 'test fake-selection bookmark 2': function() { var editor = this.editor, selection = editor.getSelection(), ranges, @@ -479,7 +491,7 @@ clearTableSelection( editor.editable() ); }, - 'Fake-selection bookmark 2 (normalized)': function() { + 'test fake-selection bookmark 2 (normalized)': function() { var editor = this.editor, selection = editor.getSelection(), ranges, @@ -513,7 +525,7 @@ clearTableSelection( editor.editable() ); }, - 'Get text from fake table selection': function() { + 'test get text from fake table selection': function() { var editor = this.editor, selection = editor.getSelection(), ranges; @@ -530,7 +542,7 @@ clearTableSelection( editor.editable() ); }, - 'Table fake selection does not create undo snapshots': function() { + 'test table fake selection does not create undo snapshots': function() { var editor = this.editor, selection = editor.getSelection(), ranges; @@ -554,7 +566,7 @@ clearTableSelection( editor.editable() ); }, - 'Table fake selection undo': function() { + 'test table fake selection undo': function() { var editor = this.editor, selection = editor.getSelection(), ranges; @@ -589,7 +601,7 @@ clearTableSelection( editor.editable() ); }, - 'Navigating left inside table fake selection': function() { + 'test navigating left inside table fake selection': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -624,7 +636,7 @@ clearTableSelection( editor.editable() ); }, - 'Navigating up inside table fake selection': function() { + 'test navigating up inside table fake selection': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -659,7 +671,7 @@ clearTableSelection( editor.editable() ); }, - 'Navigating right inside table fake selection': function() { + 'test navigating right inside table fake selection': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -694,7 +706,7 @@ clearTableSelection( editor.editable() ); }, - 'Navigating down inside table fake selection': function() { + 'test navigating down inside table fake selection': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -729,7 +741,7 @@ clearTableSelection( editor.editable() ); }, - 'Overwriting content in table fake selection via keypress': function() { + 'test overwriting content in table fake selection via keypress': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -758,7 +770,7 @@ clearTableSelection( editor.editable() ); }, - 'Not overwriting content in table fake selection via keypress when no character is produced': function() { + 'test not overwriting content in table fake selection via keypress when no character is produced': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -792,7 +804,7 @@ clearTableSelection( editor.editable() ); }, - 'Not overwriting content in table fake selection via keypress when Ctrl is pressed': function() { + 'test not overwriting content in table fake selection via keypress when Ctrl is pressed': function() { var editor = this.editor, selection = editor.getSelection(), prevented = false, @@ -826,7 +838,7 @@ clearTableSelection( editor.editable() ); }, - 'Simulating opening context menu in the same table': function() { + 'test simulating opening context menu in the same table': function() { var editor = this.editor, selection = editor.getSelection(), realSelection, @@ -868,7 +880,7 @@ wait(); }, - 'Simulating opening context menu in the nested table': function() { + 'test simulating opening context menu in the nested table': function() { var editor = this.editor, selection = editor.getSelection(), realSelection, @@ -911,7 +923,7 @@ wait(); }, - 'Simulating opening context menu in the different table': function() { + 'test simulating opening context menu in the different table': function() { var editor = this.editor, selection = editor.getSelection(), realSelection, @@ -951,7 +963,7 @@ wait(); }, - 'Simulating opening context menu in the paragraph': function() { + 'test simulating opening context menu in the paragraph': function() { var editor = this.editor, selection = editor.getSelection(), realSelection, @@ -989,7 +1001,7 @@ wait(); }, - 'Simulating opening context menu in the same table (WebKit, macOS)': function() { + 'test simulating opening context menu in the same table (WebKit, macOS)': function() { // Webkits on macOS contrary to other browsers will collapse the selection and anchor it in a text node. if ( !CKEDITOR.env.webkit ) { assert.ignore(); @@ -1041,7 +1053,7 @@ wait(); }, - 'Simulating opening context menu in the nested table (WebKit, macOS)': function() { + 'test simulating opening context menu in the nested table (WebKit, macOS)': function() { // Webkits on macOS contrary to other browsers will collapse the selection and anchor it in a text node. if ( !CKEDITOR.env.webkit ) { assert.ignore(); @@ -1092,7 +1104,7 @@ wait(); }, - 'Simulating opening context menu in the different table (WebKit, macOS)': function() { + 'test simulating opening context menu in the different table (WebKit, macOS)': function() { // Webkits on macOS contrary to other browsers will collapse the selection and anchor it in a text node. if ( !CKEDITOR.env.webkit ) { assert.ignore(); @@ -1145,12 +1157,5 @@ } }; - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - - // Ignores for Edge (#1944). - var shouldIgnore = !tableSelectionHelpers.isSupportedEnvironment || CKEDITOR.env.edge; - tests._should.ignore[ 'Make fake table selection' ] = shouldIgnore; - tests._should.ignore[ 'Reset fake-selection' ] = shouldIgnore; - bender.test( tests ); }() ); diff --git a/tests/plugins/tableselection/integrations/core/style.js b/tests/plugins/tableselection/integrations/core/style.js index 5afc359c85d..a517a19656d 100644 --- a/tests/plugins/tableselection/integrations/core/style.js +++ b/tests/plugins/tableselection/integrations/core/style.js @@ -19,6 +19,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test apply to/remove from multiple table cell selection': function( editor, editorBot ) { var selection = editor.getSelection(), ranges = [], @@ -49,7 +52,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); }() ); diff --git a/tests/plugins/tableselection/integrations/enterkey/enterkey.js b/tests/plugins/tableselection/integrations/enterkey/enterkey.js index fd6f618f655..7e61bfb560a 100644 --- a/tests/plugins/tableselection/integrations/enterkey/enterkey.js +++ b/tests/plugins/tableselection/integrations/enterkey/enterkey.js @@ -2,7 +2,6 @@ /* bender-ckeditor-plugins: table,tableselection,wysiwygarea,enterkey,undo */ /* bender-ckeditor-remove-plugins: entities */ /* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -84,6 +83,9 @@ var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test press enter key in selected table': function( editor, bot ) { var expectedResult = prepareEditorAndGetExpectedResult( editor, bot ); editor.fire( 'saveSnapshot' ); @@ -108,6 +110,5 @@ }; tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/image/imageurl.js b/tests/plugins/tableselection/integrations/image/imageurl.js index e2504077b58..66170436b5c 100644 --- a/tests/plugins/tableselection/integrations/image/imageurl.js +++ b/tests/plugins/tableselection/integrations/image/imageurl.js @@ -1,7 +1,5 @@ /* bender-tags: tableselection,2235,4.12.0 */ /* bender-ckeditor-plugins: tableselection */ -/* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -9,6 +7,10 @@ bender.editor = true; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + 'Is whole cell fake selected when img inside is selected': function() { var editor = this.editor, bot = this.editorBot, @@ -20,8 +22,6 @@ } }; - // Tests should be ignored in browsers which don't support tableselection plugin, i.e. IE < 11 - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/image2/manual/deselectwidget.html b/tests/plugins/tableselection/integrations/image2/manual/deselectwidget.html index 633ac9c4638..3ac66cacb91 100644 --- a/tests/plugins/tableselection/integrations/image2/manual/deselectwidget.html +++ b/tests/plugins/tableselection/integrations/image2/manual/deselectwidget.html @@ -21,14 +21,11 @@ + if ( bender.tools.env.mobile ) { + bender.ignore(); + } + + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + + CKEDITOR.replace( 'editor', { extraPlugins: 'image2' } ); + \ No newline at end of file diff --git a/tests/plugins/tableselection/integrations/image2/paste.js b/tests/plugins/tableselection/integrations/image2/paste.js index 6e37554f1ff..fc8c22bf23f 100644 --- a/tests/plugins/tableselection/integrations/image2/paste.js +++ b/tests/plugins/tableselection/integrations/image2/paste.js @@ -1,7 +1,5 @@ /* bender-tags: editor,unit,widget */ /* bender-ckeditor-plugins: image2,undo,tableselection */ -/* bender-include: ../../_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -63,7 +61,10 @@ } var tests = { - 'the copied image to table shoud be initialized (collapsed selection)': function( editor, bot ) { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, + 'test the copied image to table shoud be initialized (collapsed selection)': function( editor, bot ) { bot.setHtmlWithSelection( '
Cel^l
' ); editor.undoManager.reset(); @@ -72,7 +73,7 @@ } ); }, - 'the copied image to table shoud be initialized (multiple selection)': function( editor, bot ) { + 'test the copied image to table shoud be initialized (multiple selection)': function( editor, bot ) { bot.setHtmlWithSelection( '[][]
Cell 1Cell 2
' ); editor.undoManager.reset(); @@ -84,7 +85,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/link/link.js b/tests/plugins/tableselection/integrations/link/link.js index f341280e824..86fe1990444 100644 --- a/tests/plugins/tableselection/integrations/link/link.js +++ b/tests/plugins/tableselection/integrations/link/link.js @@ -29,6 +29,9 @@ removedAnchoredTable = CKEDITOR.document.getById( 'table-with-anchors-removed' ).findOne( 'table' ); var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test create link': function() { var editor = this.editor, bot = this.editorBot, @@ -244,7 +247,5 @@ } }; - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/selectall/selectall.js b/tests/plugins/tableselection/integrations/selectall/selectall.js index 5b16c258da6..f9483626927 100644 --- a/tests/plugins/tableselection/integrations/selectall/selectall.js +++ b/tests/plugins/tableselection/integrations/selectall/selectall.js @@ -35,6 +35,9 @@ var getRangesForCells = tableSelectionHelpers.getRangesForCells, table = CKEDITOR.document.findOne( '#table table' ), tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test selectAll command after table selection (paragraph + table)': function( editor, bot ) { var editable = editor.editable(), ranges; @@ -145,7 +148,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/integrations/tabletools/tabletools.js b/tests/plugins/tableselection/integrations/tabletools/tabletools.js index 5829254215d..0184535b5e2 100644 --- a/tests/plugins/tableselection/integrations/tabletools/tabletools.js +++ b/tests/plugins/tableselection/integrations/tabletools/tabletools.js @@ -20,6 +20,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test insert row before': function( editor, bot ) { doCommandTest( bot, 'rowInsertBefore', { 'case': 'add-row-before', cells: [ 0 ] } ); doCommandTest( bot, 'rowInsertBefore', { 'case': 'add-row-before-2', cells: [ 1 ] } ); @@ -179,10 +182,10 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - // Ignores for Edge (#1944). - var shouldIgnore = !tableSelectionHelpers.isSupportedEnvironment || CKEDITOR.env.edge; + var shouldIgnore = CKEDITOR.env.edge; + tests._should = tests._should || {}; + tests._should.ignore = tests._should.ignore || {}; tests._should.ignore[ 'test merge cells (classic)' ] = shouldIgnore; tests._should.ignore[ 'test merge cells (inline)' ] = shouldIgnore; tests._should.ignore[ 'test merge one cell (classic)' ] = shouldIgnore; diff --git a/tests/plugins/tableselection/keyboard.js b/tests/plugins/tableselection/keyboard.js index 7889d46ad2b..7365b53ce66 100644 --- a/tests/plugins/tableselection/keyboard.js +++ b/tests/plugins/tableselection/keyboard.js @@ -16,6 +16,9 @@ var getRangesForCells = tableSelectionHelpers.getRangesForCells; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test backspace in the middle': function( editor, bot ) { bender.tools.testInputOut( 'emptyTable', function( source, expected ) { bender.tools.setHtmlWithSelection( editor, source ); @@ -205,7 +208,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/manual/blur.html b/tests/plugins/tableselection/manual/blur.html index de8b6414616..7418af6601b 100644 --- a/tests/plugins/tableselection/manual/blur.html +++ b/tests/plugins/tableselection/manual/blur.html @@ -80,10 +80,12 @@

Inline editor

diff --git a/tests/plugins/tableselection/manual/cellbackground.html b/tests/plugins/tableselection/manual/cellbackground.html index f9d8eee5063..4f60e0dd64f 100644 --- a/tests/plugins/tableselection/manual/cellbackground.html +++ b/tests/plugins/tableselection/manual/cellbackground.html @@ -12,9 +12,11 @@ diff --git a/tests/plugins/tableselection/manual/contextmenu.html b/tests/plugins/tableselection/manual/contextmenu.html index 5d2d6960802..edec6c6f491 100644 --- a/tests/plugins/tableselection/manual/contextmenu.html +++ b/tests/plugins/tableselection/manual/contextmenu.html @@ -73,10 +73,12 @@ diff --git a/tests/plugins/tableselection/manual/editortypes.html b/tests/plugins/tableselection/manual/editortypes.html index de8b6414616..7418af6601b 100644 --- a/tests/plugins/tableselection/manual/editortypes.html +++ b/tests/plugins/tableselection/manual/editortypes.html @@ -80,10 +80,12 @@

Inline editor

diff --git a/tests/plugins/tableselection/manual/integrations/basicstyles/basicstyles.html b/tests/plugins/tableselection/manual/integrations/basicstyles/basicstyles.html index 04c944efc53..29f7aa6e3ad 100644 --- a/tests/plugins/tableselection/manual/integrations/basicstyles/basicstyles.html +++ b/tests/plugins/tableselection/manual/integrations/basicstyles/basicstyles.html @@ -38,10 +38,12 @@ diff --git a/tests/plugins/tableselection/manual/integrations/clipboard/merge.html b/tests/plugins/tableselection/manual/integrations/clipboard/merge.html index 123d20ee89b..2b8fabba885 100644 --- a/tests/plugins/tableselection/manual/integrations/clipboard/merge.html +++ b/tests/plugins/tableselection/manual/integrations/clipboard/merge.html @@ -38,10 +38,12 @@ diff --git a/tests/plugins/tableselection/manual/integrations/clipboard/nestedtable.html b/tests/plugins/tableselection/manual/integrations/clipboard/nestedtable.html index ee5b76ebd83..cb3bbe61407 100644 --- a/tests/plugins/tableselection/manual/integrations/clipboard/nestedtable.html +++ b/tests/plugins/tableselection/manual/integrations/clipboard/nestedtable.html @@ -39,10 +39,12 @@ diff --git a/tests/plugins/tableselection/manual/integrations/enterkey/enterkey.html b/tests/plugins/tableselection/manual/integrations/enterkey/enterkey.html index 7130168ecf8..6ec925dc883 100644 --- a/tests/plugins/tableselection/manual/integrations/enterkey/enterkey.html +++ b/tests/plugins/tableselection/manual/integrations/enterkey/enterkey.html @@ -120,10 +120,12 @@

Inline editor:

diff --git a/tests/plugins/tableselection/manual/integrations/link/edit.html b/tests/plugins/tableselection/manual/integrations/link/edit.html index 904876df913..fae575a6dff 100644 --- a/tests/plugins/tableselection/manual/integrations/link/edit.html +++ b/tests/plugins/tableselection/manual/integrations/link/edit.html @@ -44,10 +44,12 @@

Inline editor

diff --git a/tests/plugins/tableselection/manual/keystrokes.html b/tests/plugins/tableselection/manual/keystrokes.html index 04c944efc53..29f7aa6e3ad 100644 --- a/tests/plugins/tableselection/manual/keystrokes.html +++ b/tests/plugins/tableselection/manual/keystrokes.html @@ -38,10 +38,12 @@ diff --git a/tests/plugins/tableselection/manual/native.html b/tests/plugins/tableselection/manual/native.html index 97104dc2e23..a44396bfbaa 100644 --- a/tests/plugins/tableselection/manual/native.html +++ b/tests/plugins/tableselection/manual/native.html @@ -71,10 +71,12 @@

Inline editor

diff --git a/tests/plugins/tableselection/manual/nestedtable.html b/tests/plugins/tableselection/manual/nestedtable.html index c6d885da972..06ec3a40178 100644 --- a/tests/plugins/tableselection/manual/nestedtable.html +++ b/tests/plugins/tableselection/manual/nestedtable.html @@ -32,9 +32,11 @@ diff --git a/tests/plugins/tableselection/manual/nestedtablescroll.html b/tests/plugins/tableselection/manual/nestedtablescroll.html index 646c37cb4c3..1ffaa412ab9 100644 --- a/tests/plugins/tableselection/manual/nestedtablescroll.html +++ b/tests/plugins/tableselection/manual/nestedtablescroll.html @@ -29,10 +29,12 @@ diff --git a/tests/plugins/tableselection/manual/pastenestedtable.html b/tests/plugins/tableselection/manual/pastenestedtable.html index d0783e4f7f8..9b3e1067c4c 100644 --- a/tests/plugins/tableselection/manual/pastenestedtable.html +++ b/tests/plugins/tableselection/manual/pastenestedtable.html @@ -25,9 +25,11 @@

Editor

diff --git a/tests/plugins/tableselection/manual/readonly.html b/tests/plugins/tableselection/manual/readonly.html index ae3ed94db87..a287281598f 100644 --- a/tests/plugins/tableselection/manual/readonly.html +++ b/tests/plugins/tableselection/manual/readonly.html @@ -22,10 +22,12 @@ diff --git a/tests/plugins/tableselection/manual/scrollmouseover.html b/tests/plugins/tableselection/manual/scrollmouseover.html index f56e56ff486..8bac5b1fe34 100644 --- a/tests/plugins/tableselection/manual/scrollmouseover.html +++ b/tests/plugins/tableselection/manual/scrollmouseover.html @@ -11,6 +11,12 @@ diff --git a/tests/plugins/tableselection/manual/selectionleak.html b/tests/plugins/tableselection/manual/selectionleak.html index 22c9e09b1c1..41ac6ed35ad 100644 --- a/tests/plugins/tableselection/manual/selectionleak.html +++ b/tests/plugins/tableselection/manual/selectionleak.html @@ -19,9 +19,11 @@ diff --git a/tests/plugins/tableselection/manual/selectionstyling.html b/tests/plugins/tableselection/manual/selectionstyling.html index b30accb0a33..30e89945bc9 100644 --- a/tests/plugins/tableselection/manual/selectionstyling.html +++ b/tests/plugins/tableselection/manual/selectionstyling.html @@ -22,9 +22,11 @@ diff --git a/tests/plugins/tableselection/manual/styleleak.html b/tests/plugins/tableselection/manual/styleleak.html index d8a323e91a4..342bb2b3e8c 100644 --- a/tests/plugins/tableselection/manual/styleleak.html +++ b/tests/plugins/tableselection/manual/styleleak.html @@ -9,9 +9,11 @@ diff --git a/tests/plugins/tableselection/manual/tableselection.html b/tests/plugins/tableselection/manual/tableselection.html index 2c57e021138..47f8f589d82 100644 --- a/tests/plugins/tableselection/manual/tableselection.html +++ b/tests/plugins/tableselection/manual/tableselection.html @@ -498,10 +498,12 @@

Nested table

diff --git a/tests/plugins/tableselection/nativeenterkey.js b/tests/plugins/tableselection/nativeenterkey.js index e1a71c9294d..d340a0cbc18 100644 --- a/tests/plugins/tableselection/nativeenterkey.js +++ b/tests/plugins/tableselection/nativeenterkey.js @@ -1,7 +1,6 @@ /* bender-tags: editor,unit,tableselection */ /* bender-ckeditor-plugins: table,tableselection,wysiwygarea,undo */ /* bender-include: ./_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -38,6 +37,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test tableselection without enterkey plugin': function( editor, bot ) { var expectedResult = TABLE_WITH_SELECTION.replace( /(\[|\])/g, '' ).replace( 'BB', ' ' ).replace( 'YY', ' ' ); bot.setHtmlWithSelection( TABLE_WITH_SELECTION ); @@ -66,6 +68,5 @@ }; tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); bender.test( tests ); } )(); diff --git a/tests/plugins/tableselection/rightclick.js b/tests/plugins/tableselection/rightclick.js index 5f33a0d40ca..3ff4891ecbf 100644 --- a/tests/plugins/tableselection/rightclick.js +++ b/tests/plugins/tableselection/rightclick.js @@ -1,7 +1,6 @@ /* bender-tags: tableselection */ /* bender-ckeditor-plugins: tableselection */ /* bender-include: ./_helpers/tableselection.js */ -/* global tableSelectionHelpers */ ( function() { 'use strict'; @@ -14,6 +13,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, 'test select inner cells right click unselected inner cell': test( { select: { inner: true, @@ -34,7 +36,7 @@ index: 1 } } ), - 'select outer cells right click unselected outer cell': test( { + 'test select outer cells right click unselected outer cell': test( { select: { inner: false, indexes: [ 1, 2, 3 ] @@ -77,7 +79,6 @@ }; tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); bender.test( tests ); diff --git a/tests/plugins/tableselection/scrollmouseover.js b/tests/plugins/tableselection/scrollmouseover.js index f41eded6059..205fc1bfe78 100644 --- a/tests/plugins/tableselection/scrollmouseover.js +++ b/tests/plugins/tableselection/scrollmouseover.js @@ -22,6 +22,9 @@ }; var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, // #515 'test mouseover on scrollbar': function( editor, bot ) { var editable = editor.editable(); diff --git a/tests/plugins/tableselection/tableselection.js b/tests/plugins/tableselection/tableselection.js index 2103470b3fb..b140e6765ac 100644 --- a/tests/plugins/tableselection/tableselection.js +++ b/tests/plugins/tableselection/tableselection.js @@ -21,6 +21,9 @@ } var tests = { + setUp: function() { + bender.tools.ignoreUnsupportedEnvironment( 'tableselection' ); + }, // (#tp2247) 'test overriding cell background': function( editor ) { bender.tools.setHtmlWithSelection( editor, CKEDITOR.document.getById( 'cellBackground' ).getValue() ); @@ -84,6 +87,11 @@ }, 'test simulating merge cells from context menu ': function( editor ) { + // Ignores for Edge (#1944). + if ( CKEDITOR.env.edge ) { + assert.ignore(); + } + var selection = editor.getSelection(), expected = '' + '
Cell 1.1Cell 1.2
Cell 2.2
Cell 1.3
Cell 2.1Cell 2.3
', @@ -286,12 +294,5 @@ tests = bender.tools.createTestsForEditors( CKEDITOR.tools.object.keys( bender.editors ), tests ); - tableSelectionHelpers.ignoreUnsupportedEnvironment( tests ); - - // Ignores for Edge (#1944). - var shouldIgnore = !tableSelectionHelpers.isSupportedEnvironment || CKEDITOR.env.edge; - tests._should.ignore[ 'test simulating merge cells from context menu (classic)' ] = shouldIgnore; - tests._should.ignore[ 'test simulating merge cells from context menu (inline)' ] = shouldIgnore; - bender.test( tests ); } )(); diff --git a/tests/plugins/uploadfile/uploadfile.js b/tests/plugins/uploadfile/uploadfile.js index b55e3d14d86..d88ae87b00e 100644 --- a/tests/plugins/uploadfile/uploadfile.js +++ b/tests/plugins/uploadfile/uploadfile.js @@ -75,9 +75,7 @@ bender.test( { }, setUp: function() { - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'uploadfile' ); var editorName; diff --git a/tests/plugins/uploadimage/manual/configerror.html b/tests/plugins/uploadimage/manual/configerror.html index c4f395cca73..b8f52bc3c09 100644 --- a/tests/plugins/uploadimage/manual/configerror.html +++ b/tests/plugins/uploadimage/manual/configerror.html @@ -3,5 +3,9 @@ \ No newline at end of file + var editor = CKEDITOR.replace( 'editor' ); + + editor.once( 'instanceReady', function() { + bender.tools.ignoreUnsupportedEnvironment( 'uploadimage' ); + } ); + diff --git a/tests/plugins/uploadimage/uploadimage.js b/tests/plugins/uploadimage/uploadimage.js index eeb974bb4f1..d911bb845e6 100644 --- a/tests/plugins/uploadimage/uploadimage.js +++ b/tests/plugins/uploadimage/uploadimage.js @@ -71,9 +71,7 @@ }, setUp: function() { - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'uploadimage' ); var editorName; diff --git a/tests/plugins/uploadwidget/additionalrequestparameters.js b/tests/plugins/uploadwidget/additionalrequestparameters.js index c82a3446925..45505e74270 100644 --- a/tests/plugins/uploadwidget/additionalrequestparameters.js +++ b/tests/plugins/uploadwidget/additionalrequestparameters.js @@ -104,9 +104,7 @@ bender.test( { setUp: function() { - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); // IE doesn't support File constructor, so there is a need to mimic it. if ( typeof MSBlobBuilder === 'function' ) diff --git a/tests/plugins/uploadwidget/bindnotifications.js b/tests/plugins/uploadwidget/bindnotifications.js index 489783a81ee..d387578eb49 100644 --- a/tests/plugins/uploadwidget/bindnotifications.js +++ b/tests/plugins/uploadwidget/bindnotifications.js @@ -45,9 +45,7 @@ bender.test( { }, setUp: function() { - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); notificationShowStub.reset(); notificationUpdateStub.reset(); diff --git a/tests/plugins/uploadwidget/manual/__template__.html b/tests/plugins/uploadwidget/manual/__template__.html index 790f48db0ba..ab054be56a3 100644 --- a/tests/plugins/uploadwidget/manual/__template__.html +++ b/tests/plugins/uploadwidget/manual/__template__.html @@ -1,16 +1,13 @@ - \ No newline at end of file + editor.once( 'instanceReady', function() { + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); + } ); + diff --git a/tests/plugins/uploadwidget/manual/abortupload.html b/tests/plugins/uploadwidget/manual/abortupload.html index 7b3df1061b7..2e719c53988 100644 --- a/tests/plugins/uploadwidget/manual/abortupload.html +++ b/tests/plugins/uploadwidget/manual/abortupload.html @@ -5,10 +5,12 @@ uploadUrl: '%BASE_PATH%', on: { instanceReady: function( evt ) { - if ( !CKEDITOR.fileTools.isFileUploadSupported || bender.tools.env.mobile ) { + if ( bender.tools.env.mobile ) { return bender.ignore(); } + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); + var editor = evt.editor; editor.widgets.registered.uploadimage.onAbort = function() { editor.showNotification( 'You are awesome!' ); diff --git a/tests/plugins/uploadwidget/manual/droponemptydocument.html b/tests/plugins/uploadwidget/manual/droponemptydocument.html index cbd39bc11a6..1e80066078d 100644 --- a/tests/plugins/uploadwidget/manual/droponemptydocument.html +++ b/tests/plugins/uploadwidget/manual/droponemptydocument.html @@ -1,15 +1,11 @@ - -
diff --git a/tests/plugins/uploadwidget/manual/droponnotallowedparts.html b/tests/plugins/uploadwidget/manual/droponnotallowedparts.html index 2f8f3805b98..7514b4535e2 100644 --- a/tests/plugins/uploadwidget/manual/droponnotallowedparts.html +++ b/tests/plugins/uploadwidget/manual/droponnotallowedparts.html @@ -1,7 +1,3 @@ - -

Classic instance

@@ -31,8 +27,10 @@

Div Editing Area

} ) ]; - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 10 ) { - document.getElementById( 'ignore' ).style.display = 'block'; + for ( var i = 0; i < editors.length; i++ ) { + editors[ i ].once( 'instanceReady', function() { + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); + } ); } function showNotifications() { diff --git a/tests/plugins/uploadwidget/manual/editorremoval.html b/tests/plugins/uploadwidget/manual/editorremoval.html index 550d3943dd9..f0599b50d21 100644 --- a/tests/plugins/uploadwidget/manual/editorremoval.html +++ b/tests/plugins/uploadwidget/manual/editorremoval.html @@ -8,7 +8,7 @@

Output

diff --git a/tests/plugins/uploadwidget/manual/noserverresponseencoding.html b/tests/plugins/uploadwidget/manual/noserverresponseencoding.html index a4a7596f0be..1694698af5b 100644 --- a/tests/plugins/uploadwidget/manual/noserverresponseencoding.html +++ b/tests/plugins/uploadwidget/manual/noserverresponseencoding.html @@ -1,21 +1,17 @@ - -
diff --git a/tests/plugins/uploadwidget/manual/skipnotification.html b/tests/plugins/uploadwidget/manual/skipnotification.html index 34342098284..92cd2043b66 100644 --- a/tests/plugins/uploadwidget/manual/skipnotification.html +++ b/tests/plugins/uploadwidget/manual/skipnotification.html @@ -7,6 +7,10 @@ uploadUrl: '%BASE_PATH%' } ); + editor.once( 'instanceReady', function() { + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); + } ); + editor.on( 'widgetDefinition', function( evt ) { var definition = evt.data; @@ -14,8 +18,4 @@ definition.skipNotifications = true; } } ); - - if ( CKEDITOR.env.ie && CKEDITOR.env.version < 10 ) { - bender.ignore(); - } diff --git a/tests/plugins/uploadwidget/uploadwidget.js b/tests/plugins/uploadwidget/uploadwidget.js index 098fb092ea3..25434f7a824 100644 --- a/tests/plugins/uploadwidget/uploadwidget.js +++ b/tests/plugins/uploadwidget/uploadwidget.js @@ -93,9 +93,7 @@ }, setUp: function() { - if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) { - assert.ignore(); - } + bender.tools.ignoreUnsupportedEnvironment( 'uploadwidget' ); fileTools = CKEDITOR.fileTools; resumeAfter = bender.tools.resumeAfter;