This document is the test plan for the Dict project. You are expected to checkout the source code for the Dict project and load this test plan within Mozilla or Firefox (whichever browser you are testing).
There a few classes of test cases that have not yet been written. They are:
Furthermore, many of the test cases included in this test plan could be automated by converting this test plan from HTML to XUL and loading it with the "-chrome" flag.
The test cases in this group exercise defining words through the context menu using live DICT servers. This is the most common usage mode.
This test consists of a table of test cases. Each row is a separate test case. To run a test case, set your "default server" to the value in the "Server" column, select the value in the "Word" column, right-click, and define it using the context menu. The effect should match the description in the "Expected Result" column.
| Server | Word | Expected Result |
|---|---|---|
| any | embedded"quote | Bad Input |
| any | *?+- | Symbols should not show up as definable in the context menu |
| any | Define the word "text" within the text area. | |
| dict.org | student | Many definitions |
| dict.org | !@#$%student^*()-= | Remove leading and trailing non-word characters |
| dict.org | students | No definitions found, but only one match. Should return definition for "student" |
| dict.org | due | Many definitions in many databases. There should be four definitions under the heading "The Collaborative International Dictionary of English v.0.48" (as opposed to having four different headings from the same source). |
| dict.org | George Washington | Multi-word request. Should be defined as a U.S. president |
| dict.org | Goerge Washington | Multi-word request with no definitions and one match.
The president's name should be spelled correctly in the title bar.
This is a regression test for bug #5622. |
| dict.org |
Association for the Advancement of Retired Persons |
Multi-word request spanning different paragraphs.
This is a regression test for bug #15303. |
| dict.org | Bad Combination | Multi-word request with no definitions or matches. |
| dict.org | torpod | No definitions, two matches |
| dict.org | ja | No definitions, many matches |
| dict.org | AACP |
Many matches, most of which are abbreviations and should be capitalized.
This is a regression test for bug #9402. |
| dict.org | unknown-word | No definitions and no nearest matches |
| dict.org | quotation" | Should strip trailing quote and define "quotation" |
| dict.org | austrialia | Interesting formatting from the CIA World Factbook |
| dict.arabeyes.org | word | A word to define in Arabic.
The word should come back in Arabic script. This is a regression test for bug #5725. |
| dict.dvo.ru | разговор | The word translates to "colloquy".
This tests that Dict properly encodes words into UTF-8 before sending.
This is a regression test for bug #8121. |
| dict.dvo.ru | omawać | This word has only one match and should be defined as "OMAWAIĆ",
which translates to "TREAT".
This tests that Dict can decode and re-encode words in UTF-8 when doing the "auto-match". This is a regression test for bug #8121. |
| dict.dvo.ru | xxxразговорxxx | The word should look the same in the resulting "No Matches" page.
This tests that Dict decodes UTF-8 before displaying it in a JavaScript alert. This is a regression test for bug #8121. |
| dict.dvo.ru | азго | The word should look the same in the resulting "Closest Matches" page.
This tests that Dict decodes UTF-8 before displaying it in XUL. |
The test cases in this group exercise defining words through the context menu using a DICT server that was written to simulate failure modes and uncommon conditions.
This test consists of a table of test cases. Each row is a separate test case. Before running these tests, you must run testdictserver.pl and change your default server to "localhost". To run the test case, select the item the left column, right-click, and define it using the context menu. The expected results are in the right column.
| Test Case | Test Description |
|---|---|
| 20Matches | A word that has no exact matches, but has 20 close matches. The dict extension should show a list of the close matches. |
| AccessDenied530 | A word that returns that the server requires authentication to continue. The extension does not support authentication and it should report this fact to the user. |
| AccessDenied531 | A word that returns that the server requires authentication to continue. This time, the error code is 531 (use SHOW INFO) |
| AccessDenied532 | A word that returns that the server requires authentication to continue. This time, the error code is 532 (unknown mechanism) |
| CommandNotImplemented | A word that returns that the command is not implemented. This is meant to simulate a bug in the server; all servers must implement the DEFINE command. |
| CommandParameterNotImplemented | A word that returns that the command is not implemented. This is mean to simulate a bug in the server. |
| HangDefine | A word that does not elicit a server response. This simulates a very high-latency server, or a buggy one. The Dict client should eventually timeout |
| Long150ResponseLine | A word that returns a very long response line for status 150. According to RFC 2229, section 2.4.3, this is technically an illegal response from the server, since it exceeds the maximum line length of 1024. This is intended to overflow any static internal buffers that that the client may use. |
| LongDefinition | A word that returns a definition as a very long line. According to RFC 2229, section 2.4.3, this is technically an illegal response from the server, since it exceeds the maximum line length of 1024. This is intended to overflow any static internal buffers that that the client may use. |
| NotFound | A word that is not in the dictionary, nor are there any matches. The dict extension should should pop-up an error message indicating this. |
| OneMatch | A word that has no exact matches, but has one close match, one_definition. The dict extension should automatically retrieve the definition of the close match. The title bar of the definition window should be "one_definition". |
| QuotedPeriod | A word whose definition contains quoted periods the response. According to RFC 2229, section 2.4.3, if a line of text begins with two periods, the client must treat this as a single, literal period. |
| ServerShuttingDown | A word that returns that the server is shutting down. This is a legal response and the extension should pass this information on to the user. |
| ServerTemporarilyUnavailable | A word that returns that the server will be temporarily unavailable. This is a legal response and the extension should pass this information on to the user. |
| SyntaxErrorCommandNotRecognized | A word that returns an "illegal command" syntax error. This is mean to simulate a bug in the server. |
| SyntaxErrorIllegalParameters | A word that returns an "illegal parameter" syntax error. This is mean to simulate a bug in the server. |
| Two Words | A word that has a space in it. This verifies that the client properly quotes its input. |
| TwoMatches | A word that has no exact matches, but has two close matches, one_definition and two_definitions. The dict extension should show a list of the close matches. |
| one_definition | A word with one definition in one database. |
| two_definitions | A word with one definition in two databases. |
The test cases in this group exercise defining words using the "dict" protocol handler. Most users will not even know that this is possible. Indeed, this feature is supported for completeness and in hopes that someday some other URL-based project can use Dict as its engine.
NOTE: Only Firefox supports protocol handlers.
This test consists of a table of test cases. Each row is a separate test case. To run a test case, click on the URL in the left column. The expected results are in the right column.
| URL | Expected Result |
|---|---|
| dict://dict.org/d:due | Should return all definitions of "due" on dict.org. |
| dict://dict.org/d:due: | Should return all definitions of "due" on dict.org. (The extra colon should be ignored). |
| dict://dict.org/d:due:: | Should return all definitions of "due" on dict.org. (The extra colons should be ignored). |
| dict://dict.org/d:due:* | Should return all definitions of "due" from all dictionaries on dict.org. "Due" is only defined in The Collaborative International Dictionary of English, WordNet, Moby Thesaurus, and Bouvier's Law Dictionary. |
| dict://dict.org/d:due:wn | Should return all definitions of "due" from WordNet. |
| dict://dict.org/d:due:web1913 | Should return all definitions of "due" from Webster's Dictionary. |
| dict://dict.org/d:due:web1913: | Should return the definition of "due" from Webster's Dictionary. (The extra colon should be ignored). |
| dict://dict.org/d:due:web1913:2 |
Should return the second definition of "due" from Webster's Dictionary.
This should be:
"Webster's Revised Unabridged Dictionary (1913)"
"Webster's Revised Unabridged Dictionary (1913)"
Due \Due\, a. [OF. deu, F. d[^u], p. p. of devoir to owe, fr. L.
debere. See Debt, Habit, and cf. Duty.]
1. Owed, as a debt; that ought to be paid or done to or for
another; payable; owing and demandable.
2. Justly claimed as a right or property; proper; suitable;
becoming; appropriate; fit.
Her obedience, which is due to me. --Shak.
With dirges due, in sad array, Slow through the
churchway path we saw him borne. --Gray.
3. Such as (a thing) ought to be; fulfilling obligation;
proper; lawful; regular; appointed; sufficient; exact; as,
due process of law; due service; in due time.
4. Appointed or required to arrive at a given time; as, the
steamer was due yesterday.
5. Owing; ascribable, as to a cause.
This effect is due to the attraction of the sun.
--J. D.
Forbes.
This is a regression test for bug #6107. |
| dict://dict.org/d:due::1 |
Should return the third definition of "due" from Webster's Dictionary
(the default dictionary). This should be:
"The Collaborative International Dictionary of English v.0.48"
Due \Due\, adv. Directly; exactly; as, a due east course. |
| dict://dict.org/d:due:*:5 |
Should return the fifth definition of "due", which is from WordNet.
This should be:
"WordNet (r) 2.0"
Instead it returns the headings for two
databases and no definitions.
due
adj 1: owed and payable immediately or on demand; "payment is due"
[syn: owed] [ant: undue]
2: proper and appropriate; fitting; "richly deserved
punishment"; "due esteem" [syn: deserved]
3: scheduled to arrive; "the train is due in 15 minutes" [syn:
due]
4: suitable to or expected in the circumstances; "all due
respect"; "due cause to honor them"; "a long due
promotion"; "in due course" [ant: undue]
5: reasonable in the circumstances; "gave my comments due
consideration"; "exercising due care"
n 1: that which is deserved or owed; "give the devil his due"
2: a payment that is due (e.g., as the price of membership);
"the society dropped him for non-payment of dues"
adv : directly or exactly; straight; "went due North"
|
| dict://dict.org/d:due:*:15 | Should return an error saying that there is no definition by that index. Instead it returns the headings for two databases and no definitions. This is bug #9351. |
| dict://dict.org/d:abcdefghi | Should return a page complaining that no definitions were found. |
| dict://dict.org/d:george%20washington |
Should return the definition for George Washington (the First U.S. president).
This tests that the dict protocol handler can handle words with spaces in them.
This is a regression test for bug #7729. |
| dict://dict.org/d:students |
Should return that there are no definitions for "students".
Instead, it returns the definitions for "student". This is bug #6129. |
| dict://dict.org/d:due:doesnotexist |
Should return a page complaining that the requested database does not exist.
This is a regression test for bug #6107. |
| dict://dict.org/d:torpod |
Should return that no definitions were found.
Instead, it returns a list of closest matches. This is bug #6129. |
| dict://dict.org/d:torpod:jargon |
Should return that no definitions were found.
It should not return any close matches, because
there are no close matches in the "jargon" database.
This is a regression test for bug #8916. |
| dict://dict.arabeyes.org/d:due |
Should return a translation of the word "due" in Arabic.
This is a regression test for bug #6948. |
| dict://dict.dvo.ru/d:p%F4soben%FD |
The word should look like "pôsobený" in the resulting "No Matches" page.
This is a regression test for bug #8121. |
| dict://255.255.255.255/d:word |
The server does not exist. This should fail gracefully.
This is a regression test for bug #8906. |
The test cases in this group exercise matching words using the "dict" protocol handler. Most users will not even know that this is possible. Indeed, this feature is supported for completeness.
NOTE: Only Firefox supports protocol handlers.
This test consists of a table of test cases. Each row is a separate test case. To run a test case, click on the URL in the left column. The expected results are in the right column.
| URL | Expected Result |
|---|---|
| dict://dict.org/m:students | Should return "student" as the nearest match. |
| dict://dict.org/m:student::: | Should return one match of "student". The extra colons should be ignored. |
| dict://dict.org/m:student | Should return no matches. |
| dict://dict.org/m:students:wn | Should return a match for "student" in WordNet. |
| dict://dict.org/m:students:jargon | Should return that there are no matches. |
| dict://dict.org/m:stude::prefix | Should return lots of words beginning with "stude". |
| dict://dict.org/m:stude::prefix:1 | Should return exactly one match beginning with "stude". |
The test cases in this group exercise some JavaScript functions in Dict that don't depend on Mozilla's XPCOM engine or Mozilla's XUL engine. That is, it tests JavaScript functions that can be tested from HTML.
This test consists of a table of test cases. Each row is a separate test case. To run a test case, click on the URL in the left column. This will execute some tests that are implemented in JavaScript. The expected results are in the right column.
| JavaScript URL | Expected Result |
|---|---|
| Test UTF-8 conversions |
The test will exercise some functions that are defined in utf8.js. If all sub-tests pass, it will display some performance benchmarks in alert boxes, then report that all tests have completed. Anything else constitutes a failure. No errors or warnings should show up in the JavaScript Console. |
The test cases in this group exercise features that did not fit into the other test suites.
This test consists of a table of test cases. Each row is a separate test case. To run a test case, follow the instructions in the left column. The expected results are in the right column.
| Instructions | Expected Result |
|---|---|
| Go to File - Work Offline and make sure it is checked. Right click any word and try to define it. | Dict should display an informative error message that explains why it couldn't define the word. See bug #7664. |
| Go to File - Work Offline and make sure it is checked. Click on this link: define "word". | Dict should display an informative error message that couldn't define the word. See bug #7664. |