Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27014 closed enhancement (fixed)

Incorporate the TinyMCE tests into our JS tests

Reported by: azaozz's profile azaozz Owned by:
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: javascript Cc:

Description

TinyMCE comes with a large number of unit tests. It also uses QUnit but the tests are set a bit differently.

Attachments (3)

27014.patch (4.0 MB) - added by azaozz 11 years ago.
27014.1.patch (3.9 MB) - added by azaozz 11 years ago.
27014.2.patch (3.9 MB) - added by azaozz 11 years ago.

Change History (12)

@azaozz
11 years ago

This ticket was mentioned in IRC in #wordpress-dev by azaozz. View the logs.


11 years ago

@azaozz
11 years ago

#2 @azaozz
11 years ago

Some of the files in 27014.1.patch are edited so TinyMCE can be loaded from /src/wp-includes/js. Also added a "WP" selection to the UI to deselect tests that do not apply to our integration (mostly the default plugins tests).

One advantage of having these tests is that we can add some more specifically for the schema, testing the backwards compatibility with HTML 4.

Version 0, edited 11 years ago by azaozz (next)

@azaozz
11 years ago

#3 @azaozz
11 years ago

In 27014.2.patch:

  • Add tests for obsolete HTML elements and attributes (html4 back-compat).
  • Exclude /tests/qunit/editor/* from Grunt tasks for now.

#4 @azaozz
11 years ago

In 27155:

Incorporate the TinyMCE tests into our JS tests:

  • Modified the original tests so TinyMCE can be loaded from /src/wp-includes/js/tinymce.
  • Added "WP" option to the UI to select only tests relevant to our integration (excludes most of the default plugins tests).
  • Added tests for obsolete HTML elements and attributes (html4 back-compat).

See #27014.

#5 @azaozz
11 years ago

In 27180:

TinyMCE tests: remove 'coverage' for now, has unsatisfied dependencies. Tweak the test runner so it auto-starts. See #27014.

#6 @azaozz
11 years ago

Running the TinyMCE tests from Grunt automatically together with the core tests won't work.

  • PhantomJS (used for core) cannot run TinyMCE properly. The reason is that a large part of TinyMCE deals with browser specific quirks and normalization. PhantomJS is WebKit based but is neither Chrome nor Safari. It works very well for "pure" JS but doesn't (and shouldn't) emulate browser specific quirks/problems with contenteditable, the DOM, etc.
  • Even if there is a JavaScript "runner" that emulates different browsers, don't think it will work well. We would be testing the quality of emulation together with the functionality in TinyMCE, and we need it for IE 7,8,9,10,11, latest Firefox, Chrome, Safari, iOS, Android, etc.

In that terms the best option is to run the TinyMCE tests by hand in all browsers. In Grunt we could launch the browser from Node.js and run the tests. Not sure if we want to go there though.

#7 @nacin
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Yeah, I think [27180] is good for now.

#8 @azaozz
11 years ago

In 27679:

Update the TinyMCE tests.

In 4.0.20 all tests were reworked. The 'testrunner' was removed and the PhantomJS Runner QUnit plugin was added making it possible to run the tests from cli. However it is still necessary to run the tests in all supported browsers to test the fixes for all browser quirks and normalization. Also all tests are loaded in one html file.

See #27014

#9 @azaozz
11 years ago

In 27680:

Two files weren't deleted in [27679], see #27014

Note: See TracTickets for help on using tickets.