Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

WEB Common Test case-- text input Box

Shulou Source: shulou.com Published: 2022-06-03 07:08:11 10月01日 Update

For ordinary text input boxes, you usually check the following points:

1. Chinese and English spaces

two。 The beginning and end of a string contain spaces

3. There are spaces in the middle of the string

4. Letter

5. Figures

6. Chinese

7. Special character

8. Null/NULL

9. Ultra-long character

10. Html format string

Serial number

Input

Expected output

one

Chinese space

Cannot be empty

two

English space

Cannot be empty

three

The string begins with a space

Saved successfully, automatically filter the first space

four

There are spaces in the middle of the string

Saved successfully

five

The end of the string is a space

Saved successfully, automatically filter trailing spaces

six

Letter

Saved successfully

seven

Figures

Saved successfully

eight

Chinese

Saved successfully

nine

~! @ # ¥

Saved successfully

ten

Null

Saved successfully

eleven

NULL

Saved successfully

twelve

Super long Chinese

No more than how many Chinese characters

thirteen

Very long English / numbers

No more than how many characters

fourteen

Html format string

Saved successfully

For the text input box of the expense class, you usually check the following points:

1. Normal integer

two。 Normal decimal

3. Negative number

4. An integer that begins / ends with 0

5. A decimal that begins / ends with 0 (not 0. How many of these)

6. Ultra-long integer

7. Super-long decimal

8. Start / end with a decimal point

9. Chinese and English spaces

10. Letter

11. Special characters

twelve。 Chinese

13. 0

14. More than 1 decimal point

If you can enter xxxxxxxx.xx at most

Serial number

Input

Expected output

one

Normal integer

Save successfully, automatically join. 00

two

Normal decimal

Saved successfully

three

Negative number

Saved successfully

four

An integer that begins with 0

Error prompted, cannot start with 0

five

An integer that ends with 0

Saved successfully

six

A decimal that begins with 0 (not 0.)

Error prompted, cannot start with 0

seven

A decimal ending with 0

Saved successfully, keep 0

eight

The integer part is very long.

Error is prompted. The integer cannot exceed 8 bits.

nine

The decimal part is very long.

Saved successfully, rounding to intercept the top 2 places

ten

Start with a decimal point

Save successfully, automatically add 0 in front

eleven

End with a decimal point

Save successfully, automatically filter the decimal point

twelve

Chinese space

Cannot be empty

thirteen

English space

Cannot be empty

fourteen

Letter

Cannot be entered

fifteen

Special character

Cannot be entered

sixteen

Chinese

Cannot be entered

seventeen

0

Saved successfully

eighteen

More than 1 decimal point

Error prompt. The decimal point cannot be more than 1.

Tags: Success decimal space character input beginning integer string decimal point Chinese letter error prompt special number part English text Chinese and English format Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB vpn NVidia MySQL Docker