Skip to content

Commit 36533e7

Browse files
author
Devecor
committed
Upate doc test_guide
1 parent a32e07b commit 36533e7

4 files changed

Lines changed: 38 additions & 9 deletions

File tree

test/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,23 @@ Create a directory for test log files
4040
mkdir test-results
4141
```
4242

43-
Run any of one test suite which contains some test cases. for ecample
43+
Run any test suite which contains some test cases
4444
```sh
4545
cd codebang/test
4646
robot -X -d test-results --suite login_suite code_manager_test
4747
```
4848

49-
Or run the whole test suite
49+
Run one test case that is in a test suite
50+
```sh
51+
robot -X -d test-results --suite login_suite --test login_with_valid_user
52+
```
53+
54+
Run the smoke test with `-i tag`
55+
```sh
56+
robot -X -d test-results -i normal .
57+
```
58+
59+
Run the whole test suite
5060
```sh
5161
robot -X -d test-results .
5262
```
@@ -58,3 +68,11 @@ robot -X -d test-results .
5868
* Login With Invalid Username
5969
* Login With Invalid Password
6070
* Login With Invalid Username And Password
71+
72+
### Course
73+
* Add Course After Login
74+
* Add Course Before Login
75+
* Delete Course After Login
76+
* Rename Course After Login
77+
* Course Renaming Or Deletion Before Login
78+
* Switch Another Course After Login

test/code_manager_test/course_suite.robot

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ ${Another Course Name} linux-core
1313

1414
*** Test Cases ***
1515
Add Course After Login
16-
[Tags] normal
16+
[Tags] main normal
1717
Click Add Course Button
1818
Input Course Name ${Course Name}
1919
Confirm To Add Course
2020
Current Course Should Be ${Course Name}
21-
[Teardown] Run Keywords Delete Course ${Course Name} AND Logout
21+
[Teardown] Run Keywords
22+
... Delete Course ${Course Name} AND
23+
... Logout
2224

2325
Add Course Before Login
2426
[Tags] abnormal
@@ -28,7 +30,7 @@ Add Course Before Login
2830
[Teardown]
2931

3032
Delete Course After Login
31-
[Tags] normal
33+
[Tags] main normal
3234
Add Course ${Course Name}
3335
Select Course ${Course Name}
3436
Click Button To Delete Course
@@ -37,7 +39,7 @@ Delete Course After Login
3739
Course Should Be Deleted ${Course Name}
3840

3941
Rename Course After Login
40-
[Tags] normal
42+
[Tags] main normal
4143
Add Course ${Course Name}
4244
Select Course ${Course Name}
4345
Click Button To Rename Course

test/code_manager_test/login_suite.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ${Invalid User Password} wrong password
1313

1414
*** Test Cases ***
1515
Login With Valid User
16-
[Tags] normal
16+
[Tags] main normal
1717
Open Login Dialog
1818
Input User Name ${Valid User Name}
1919
Input User Password ${Valid Password}
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,18 @@ This is a tutorial for developer to prefect test cases of codebang. There is a [
5959
Suite Setup Open Codebang To Home Page
6060
Suite Teardown Close Browser
6161
```
62-
### Tags
62+
#### Keywords, cases and documentions
63+
See [How to write good test cases using Robot Framework](https://github.com/robotframework/HowToWriteGoodTestCases/blob/master/HowToWriteGoodTestCases.rst)
64+
65+
#### Tags
66+
In order to costomize **smoke test**, we should create test cases with `Tags`.A test case can specified with multiple tags.
67+
* Use the `main` for the most important test case, such as login, add course etc.
68+
* Use the `normal` for legal operations
69+
* Use the `abnormal` for iilegal operations
70+
* Continually updating...
6371

6472
## Reference
6573

6674
* [Robot Framework User Guide](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html)
67-
* [The home page of SeleniumLibrary](https://robotframework.org/SeleniumLibrary/)
75+
* [The home page of SeleniumLibrary](https://robotframework.org/SeleniumLibrary/)
76+
* [How to write good test cases using Robot Framework](https://github.com/robotframework/HowToWriteGoodTestCases/blob/master/HowToWriteGoodTestCases.rst)

0 commit comments

Comments
 (0)