Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4242 closed New Feature (fixed)

Enable running single test

Reported by: Garry Yao Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.1
Component: QA Version:
Keywords: Confirmed HasTest Cc:

Description (last modified by Garry Yao)

In unit testing, previously we've been used the following trick a lot to achieve:

  1. Force executing only one specific test:
  2. Running the test without the evolving of YUI runner, which means instead of having exceptions been caught by the runner, they were throwing to browser's default exception handling logic, which is more friendly for debugging.
    // Run one specific test without registering to YUI runner.
    window.onload = testCase.testName;
    

Now when adapting to our new testing system CKTester( #4218 ), the old approach doesn't work at all, so this ticket is intended to figure out a better way for achieving the above two goals without change CKTester.

One official way ( from YUI Test functionality ) is to use this kind of 'meta instructions' on a test case:

var oTestCase = new YAHOO.tool.TestCase({
	_should: {
		ignore: {
			testName: true //ignore this test
		}
	}
});

We should be easily extend it with certain new instructions to support our above desired functionality:

	_should: {
		ignoreAllBut: {
			testName: true // Ignore all tests except this, comment this line to toggle it.
		},
		throws: {
			testName: true // This test should throws exception instead of having it caught by runner.
		}
	}

With a little bit simplification, it could be written in the following form, which should be more easier to understand and modify.

	shouldIgnoreAllBut : [ 'testName' ],
	shouldThrows : [ 'testName' ]

Important Note: The browser's debugging mode should be turned on in order to make this working.

Attachments (3)

4242.patch (2.2 KB) - added by Garry Yao 8 years ago.
4242_2.patch (2.3 KB) - added by Garry Yao 8 years ago.
4242_3.patch (8.2 KB) - added by Garry Yao 8 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by Garry Yao

Keywords: HasTest added
Owner: set to Garry Yao
Status: newassigned

Changed 8 years ago by Garry Yao

Attachment: 4242.patch added

comment:2 Changed 8 years ago by Garry Yao

Keywords: Review? added

comment:3 Changed 8 years ago by Garry Yao

Fix a minor bug in the previous patch that one affiliate function - YAHOO.tool.TestCase.Wait was lost.

Changed 8 years ago by Garry Yao

Attachment: 4242_2.patch added

comment:4 Changed 8 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.1

comment:5 Changed 8 years ago by Garry Yao

Description: modified (diff)

Update with the opinions from Fred.

Changed 8 years ago by Garry Yao

Attachment: 4242_3.patch added

comment:6 Changed 8 years ago by Garry Yao

Make a new patch and update TC with [4123] and [4124].

comment:7 Changed 8 years ago by Garry Yao

Keywords: Review? removed

Changes committed with [4146].

comment:8 Changed 8 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

comment:9 Changed 8 years ago by Garry Yao

Post-fixed with [4283].

comment:10 Changed 8 years ago by Garry Yao

Description: modified (diff)
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy