This document contains a simple preliminary description of testcases on History interface of Webclient API.

1. Tests on back method.

Test IDActionExpected Result
basic/api/History_back_1:0Method back() invoked when backList is emptyMozilla doesn't crashes and no page loads
basic/api/History_back_1:1Method back() invoked when backList is not emptyMozilla doesn't crashes and load previous page
basic/api/History_back_2:0Method back() invoked when no URL loadedMozilla doesn't crashes and no page loads

2. Tests on canBack method.

Test IDActionExpected Result
basic/api/History_canBack_1:0Method canBack() invoked when backList is not emptyMozilla doesn't crashes and canBack return true
basic/api/History_canBack_1:1Method canBack() invoked when backList is emptyMozilla doesn't crashes and canBack return false
basic/api/History_canBack_2:0Method canBack() invoked when no URL loadedMozilla doesn't crashes and canBack return false

3. Tests on canForward method.

Test IDActionExpected Result
basic/api/History_canForward_1:0Method canForward() invoked when forwardList is not emptyMozilla doesn't crashes and canForward return true
basic/api/History_canForward_1:1Method canForward() invoked when forwardList is emptyMozilla doesn't crashes and canForward return false
basic/api/History_canForward_2:0Method canForward() invoked when no URL loadedMozilla doesn't crashes and canForward return false

4. Tests on clearHistory method.

Test IDActionExpected Result
basic/api/History_clearHistory_1:0Method clearHistory() invoked when no URL loadedMozilla doesn't crashes and history.length return true
basic/api/History_clearHistory_2:0Method clearHistory() invoked when some URL's are loadedMozilla doesn't crashes and clearHistory return false

5. Tests on forward method.

Test IDActionExpected Result
basic/api/History_forward_1:0Method forward() invoked when forwardList is emptyMozilla doesn't crashes and forward do nothing and do not thrown any exception
basic/api/History_forward_1:1Method forward() invoked when forwardList is not emptyMozilla doesn't crashes and forward load next URL
basic/api/History_forward_2:0Method forward() invoked when no URL loadedMozilla doesn't crashes and forward do nothing and do not thrown any exception

6. Tests on getBackList method.

Test IDActionExpected Result
basic/api/History_getBackList:0Method getBackList() invoked when backList is emptyMozilla doesn't crashes and getBackList return null
basic/api/History_getBackList:1Method getBackList() invoked when backList is not emptyMozilla doesn't crashes and getBackList return correct backList
basic/api/History_getBackList:2Method getBackList() invoked when no URL loadedMozilla doesn't crashes and getBackList return null
basic/api/History_getBackList:3Method getBackList() invoked when some URL's are loaded and neither method called beforeMozilla doesn't crashes and getBackList return correct BackList

7. Tests on getCurrentHistoryIndex method.

Test IDActionExpected Result
basic/api/History_getCurrentHistoryIndex:0Method getCurrentHistoryIndex() invoked when current URL is the first in historyMozilla doesn't crashes and getCurrentHistoryIndex return 0
basic/api/History_getCurrentHistoryIndex:1Method getCurrentHistoryIndex() invoked when current URL is the last in historyMozilla doesn't crashes and getCurrentHistoryIndex return correct length of history
basic/api/History_getCurrentHistoryIndex:2Method getCurrentHistoryIndex() invoked when current URL is in the middle of historyMozilla doesn't crashes and getCurrentHistoryIndex return correct index
basic/api/History_getCurrentHistoryIndex:3Method getCurrentHistoryIndex() invoked when current URL is the last in history and neither method called beforeMozilla doesn't crashes and getCurrentHistoryIndex return correct index

8. Tests on getForwardList method.

Test IDActionExpected Result
basic/api/History_getForwardList:0Method getForwardList() invoked when forwardList is empty (the last page is loaded)Mozilla doesn't crashes and getForwardList return empty array
basic/api/History_getForwardList:1Method getForwardList() invoked when forwardList is equal all historyMozilla doesn't crashes and getForwardList return correct forwardList
basic/api/History_getForwardList:2Method getForwardList() invoked when forwardList is a part of historyMozilla doesn't crashes and getForwardList return correct forwardList
basic/api/History_getForwardList:3Method getForwardList() invoked when forwardList is empty (the last page is loaded) and neither method called beforeMozilla doesn't crashes and getForwardList return correct forwardList

9. Tests on getHistory method.

Test IDActionExpected Result
basic/api/History_getHistory_1:0Method getHistory() invoked when history contains only 1 htmlMozilla doesn't crashes and getHistory return araay with 1 element
basic/api/History_getHistory_2:0Method getHistory() invoked when current page is the first in historyMozilla doesn't crashes and getHistory return correct array
basic/api/History_getHistory_2:1Method getHistory() invoked when current page in the middle of historyMozilla doesn't crashes and getHistory return correct array
basic/api/History_getHistory_2:2Method getHistory() invoked when current page in the end of historyMozilla doesn't crashes and getHistory return correct array

10. Tests on getHistoryEntry method.

Test IDActionExpected Result
basic/api/History_getHistoryEntry:0Method getHistoryEntry() invoked with arg = INTEGER.MAX_VALUEMozilla doesn't crashes and getHistoryEntry return null (or thrown Exception)
basic/api/History_getHistoryEntry:1Method getHistoryEntry() invoked with arg = INTEGER.MIN_VALUEMozilla doesn't crashes and getHistoryEntry return null (or thrown Exception)
basic/api/History_getHistoryEntry:2Method getHistoryEntry() invoked with arg = 0Mozilla doesn't crashes and getHistoryEntry return a first entry of history
basic/api/History_getHistoryEntry:3Method getHistoryEntry() invoked with arg equals a history.lengthMozilla doesn't crashes and getHistoryEntry return last entry of history

11. Tests on getHistoryLength method.

Test IDActionExpected Result
basic/api/History_getHistoryLength_1:0Method getHistoryLength() invoked with some loaded pagesMozilla doesn't crashes and getHistoryLength return correct value
basic/api/History_getHistoryLength_2:0Method getHistoryLength() invoked when none URL's loadedMozilla doesn't crashes and getHistoryLength return 0

12. Tests on getURLForIndex method.

Test IDActionExpected Result
basic/api/History_getURLForIndex:0Method getURLForIndex() invoked with arg = INTEGER.MAX_VALUEMozilla doesn't crashes and getURLForIndex return null (or thrown Exception)
basic/api/History_getURLForIndex:1Method getURLForIndex() invoked with arg = INTEGER.MIN_VALUEMozilla doesn't crashes and getURLForIndex return null (or thrown Exception)
basic/api/History_getURLForIndex:2Method getURLForIndex() invoked with arg = 0Mozilla doesn't crashes and getURLForIndex return a first URL of history
basic/api/History_getURLForIndex:3Method getURLForIndex() invoked with arg equals a history.lengthMozilla doesn't crashes and getURLForIndex return last URL of history

13. Tests on setCurrentHistoryIndex method.

Test IDActionExpected Result
basic/api/History_setCurrentHistoryIndex_1:0Method setCurrentHistoryIndex() invoked with arg = INTEGER.MAX_VALUEMozilla doesn't crashes and setCurrentHistoryIndex do not load any URL (or thrown Exception)
basic/api/History_setCurrentHistoryIndex_1:1Method setCurrentHistoryIndex() invoked with arg = INTEGER.MIN_VALUEMozilla doesn't crashes and setCurrentHistoryIndex do not load any URL (or thrown Exception)
basic/api/History_setCurrentHistoryIndex_1:2Method setCurrentHistoryIndex() invoked with arg = 0Mozilla doesn't crashes and setCurrentHistoryIndex load a first URL of history
basic/api/History_setCurrentHistoryIndex_1:3Method setCurrentHistoryIndex() invoked with 0Mozilla doesn't crashes and setCurrentHistoryIndex load correct URL
basic/api/History_setCurrentHistoryIndex_1:4Method setCurrentHistoryIndex() invoked with arg = history.lengthMozilla doesn't crashes and setCurrentHistoryIndex load last URL of history
basic/api/History_setCurrentHistoryIndex_2:0Method setCurrentHistoryIndex() invoked with history = null Mozilla doesn't crashes and setCurrentHistoryIndex do not load any URL