Paging function We often encounter the following features:
1, home, previous page, next page, end.
2, the total number of pages, the current page
3. Specify jump Page
4. Specify the number of bars to display per page
Of course, some are less than how many pages, all displayed in numbers, more than a few pages before the next page of control appears. This paper uses the above four points as a general use case to design it.
For tests with 1 page links or buttons, the main test points to check are:
1, there are countless data when the display of the control
2, on the home page, the first and last whether you can click
3, at the end of the next and last page can be clicked
4, in the non-home and non-final, four button function is correct
5. If the records in the list are still sorted by the specified sort sequence after the page turn
For the 2 total pages, the current number of pages, the main test points to check are:
1, the total number of pages is equal to the total record/Specify the number of pages per page
2, the current page is correct
For 3 specified jump pages, the main test points to check are:
1, whether can jump to the specified number of pages normally
2, the input of the number of jump page illegal when the processing
For 4 Specifies the number of bars per page, the main test points to check are:
1, whether there is a default to specify the number of bars per page
2, specify the number of bars per page, the list displays the number of records, the page is correct
3, the number of entries per page of illegal processing
After analyzing the test points above, it should be possible to design the use case.
Step 1: List no records
Expect:1, four page turn controls grayed out and not clickable
2, the list has the corresponding no data information hint
3. Number of pages cannot be specified
4. Cannot specify jump page
5, the total number of pages displayed as 0
6, the current page display is 0
Step 2: Number of records in the list <= the number of bars per page specified
Expect:1, four page turn controls grayed out and not clickable
2, the total number of pages displayed as 1
3, the current page display is 1
Step 3: Number of records in the list > number of bars per page specified
Expect:1, default on the first page, the current page is 1
2. The data of the list is sorted correctly according to the specified sort column
3, record number and database match
4, Total pages = number of records/number of bars per page specified
Step 4: Number of records in the list > the number of bars per page specified, on the homepage
Expect:1, home turn gray not click
2, the previous page to become gray can not click
3, the next page can be clicked, from (Specify the number of bars per page +1) record start display, current page +1
4, end can click, display the last page of records
Step 5: The number of records in the list > the number of bars per page specified, in the middle of a page
Expect:1, the first page can be clicked, displaying 1 to the record of the specified number of bars per sheet
2, the previous page can be clicked, display the previous page of records
3, next page can be clicked, from the next page of records
4, end can click, display the last page of records
5. The data of the list is sorted correctly according to the specified sort column
6, the current page is the pages
Step 6: Number of records in the list > the number of bars per page specified, at the end
Expect:1, the first page can be clicked, displaying 1 to the record of the specified number of bars per sheet
2, the previous page can be clicked, display the previous page of records
3, the next page to become gray is not clickable
4, the last turn gray can not click
5. The data of the list is sorted correctly according to the specified sort column
6. The number of pages currently in the last page
Step 7: Enter the number of bars per page as a positive integer
Expect:1, each page shows the number of bars updated to the specified number of bars
2, the record paging display that exceeds the specified number of bars
3. Total number of pages updated to list of records/pages per page
Step 8: Enter the number of bars per page 0
Expect:1, Tip "the number of bars per page must be an integer greater than 1"
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 9: Enter a negative number of display bars per page
Expect:1, Tip the number of bars per page must be an integer greater than 1
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 10: Enter the number of display bars per page longer than the specified length of the database <<<maxlen>>>
Expect:1, Tip the number of bars per page cannot exceed <<<maxlen>>> bit
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 11: Enter the number of display bars per page as a string, such as the number of pages in Chinese
Expect:1, Tip the number of bars per page must be an integer greater than 1
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 12: Enter the number of display bars per page as special characters, such as%
Expect:1, Tip the number of bars per page must be an integer greater than 1
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 13: Enter the number of display bars per page as an HTML string, such as <br>
Expect:1, Tip the number of bars per page must be an integer greater than 1
2, prompt after each page shows the number of bars restored to the last effective number of bars
Step 14: Enter the number of pages that are present for the jump
Expect:1, correctly jumps to the specified number of pages
Step 15: Enter the number of pages of the jump that do not exist or illegal values
Expect:1, jump page value is set to 1, display the first page of data
The use case above is the total number of pages, the current number of pages are rubbed into the page control test cases.
Test cases for page turn functionality