Skip to content

Commit fc6aef8

Browse files
committed
add test management
1 parent edb47f8 commit fc6aef8

File tree

5 files changed

+444
-4
lines changed

5 files changed

+444
-4
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
package io.fluentqa.erupts.base.model;
2+
3+
4+
import lombok.Data;
5+
import xyz.erupt.annotation.EruptField;
6+
import xyz.erupt.annotation.sub_field.Edit;
7+
import xyz.erupt.annotation.sub_field.EditType;
8+
import xyz.erupt.annotation.sub_field.View;
9+
import xyz.erupt.annotation.sub_field.sub_edit.BoolType;
10+
import xyz.erupt.annotation.sub_field.sub_edit.Search;
11+
12+
import javax.persistence.MappedSuperclass;
13+
import java.time.LocalDate;
14+
15+
16+
@MappedSuperclass
17+
@Data
18+
public class NamedTimeStatusModel extends ModelWithValidFlagVo {
19+
@EruptField(
20+
views = @View(
21+
title = "名称"
22+
),
23+
edit = @Edit(
24+
title = "名称",
25+
type = EditType.INPUT, search = @Search, notNull = true
26+
)
27+
)
28+
private String name;
29+
@EruptField(
30+
views = @View(
31+
title = "详细"
32+
),
33+
edit = @Edit(
34+
title = "详细",
35+
type = EditType.INPUT, search = @Search, notNull = true
36+
)
37+
)
38+
private String detail;
39+
@EruptField(
40+
views = @View(
41+
title = "开始时间"
42+
),
43+
edit = @Edit(
44+
title = "开始时间",
45+
type = EditType.DATE, search = @Search, notNull = true,
46+
boolType = @BoolType
47+
)
48+
)
49+
private LocalDate startDate;
50+
@EruptField(
51+
views = @View(
52+
title = "预计完成时间"
53+
),
54+
edit = @Edit(
55+
title = "预计完成时间",
56+
type = EditType.DATE, search = @Search, notNull = true,
57+
boolType = @BoolType
58+
)
59+
)
60+
private LocalDate estimatedCompletedDate;
61+
@EruptField(
62+
views = @View(
63+
title = "完成时间"
64+
),
65+
edit = @Edit(
66+
title = "完成时间",
67+
type = EditType.DATE, search = @Search, notNull = true,
68+
boolType = @BoolType
69+
)
70+
)
71+
private LocalDate completedDate;
72+
@EruptField(
73+
views = @View(
74+
title = "当前状态"
75+
),
76+
edit = @Edit(
77+
title = "当前状态",
78+
type = EditType.INPUT, search = @Search, notNull = true,
79+
boolType = @BoolType
80+
)
81+
)
82+
private String status;
83+
}

fluent-erupts/fluent-tc/src/main/java/io/fluentqa/tc/model/TestCase.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import io.fluentqa.erupts.base.handlers.SqlTagFetchHandler;
44
import io.fluentqa.erupts.base.model.ModelWithValidFlagVo;
5+
import io.fluentqa.pm.product.model.Product;
56
import io.fluentqa.pm.product.model.ProductModuleValidFlagVo;
67
import lombok.Data;
78
import xyz.erupt.annotation.Erupt;
@@ -12,9 +13,13 @@
1213
import xyz.erupt.annotation.sub_field.EditType;
1314
import xyz.erupt.annotation.sub_field.View;
1415
import xyz.erupt.annotation.sub_field.sub_edit.CodeEditorType;
16+
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTreeType;
1517
import xyz.erupt.annotation.sub_field.sub_edit.Search;
18+
import xyz.erupt.annotation.sub_field.sub_edit.TagsType;
1619

1720
import javax.persistence.Entity;
21+
import javax.persistence.JoinColumn;
22+
import javax.persistence.ManyToOne;
1823
import javax.persistence.Table;
1924

2025
/**
@@ -28,18 +33,35 @@
2833
linkTree = @LinkTree(field = "product"))
2934
@Table(name = "test_cases")
3035
public class TestCase extends ModelWithValidFlagVo {
36+
@ManyToOne
37+
@JoinColumn(name = "product_id")
38+
@EruptField(
39+
views = @View(title = "产品名称",column = "name"),
40+
edit = @Edit(
41+
search = @Search,
42+
title = "产品选择",
43+
type = EditType.REFERENCE_TREE,
44+
desc = "动态获取产品",
45+
referenceTreeType = @ReferenceTreeType(
46+
pid = "parent.id"))
47+
)
48+
private Product product;
3149

3250
@EruptField(
3351
views = @View(
3452
title = "功能点"
3553
),
3654
edit = @Edit(
3755
title = "功能点",
38-
type = EditType.INPUT, search = @Search, notNull = true
56+
type = EditType.TAGS, search = @Search(vague = true), notNull = true,
57+
tagsType = @TagsType(
58+
fetchHandler = SqlTagFetchHandler.class,
59+
fetchHandlerParams = "select distinct feature from test_cases where valid=true"
60+
)
3961
)
62+
4063
)
4164
private String feature;
42-
4365
@EruptField(
4466
views = @View(
4567
title = "用例描述"
@@ -66,8 +88,8 @@ public class TestCase extends ModelWithValidFlagVo {
6688
title = "用例前提条件"
6789
),
6890
edit = @Edit(
69-
title = "用例优先级",
70-
type = EditType.INPUT
91+
title = "用例前提条件",
92+
type = EditType.INPUT, search = @Search, notNull = true
7193
)
7294
)
7395
private String precondition;
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package io.fluentqa.tc.model;
2+
3+
4+
import io.fluentqa.erupts.base.model.NamedTimeStatusModel;
5+
import io.fluentqa.pm.product.model.Product;
6+
import xyz.erupt.annotation.Erupt;
7+
import xyz.erupt.annotation.EruptField;
8+
import xyz.erupt.annotation.sub_erupt.LinkTree;
9+
import xyz.erupt.annotation.sub_erupt.Power;
10+
import xyz.erupt.annotation.sub_erupt.Tree;
11+
import xyz.erupt.annotation.sub_field.Edit;
12+
import xyz.erupt.annotation.sub_field.EditType;
13+
import xyz.erupt.annotation.sub_field.View;
14+
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTreeType;
15+
import xyz.erupt.annotation.sub_field.sub_edit.Search;
16+
17+
import javax.persistence.*;
18+
import java.util.Set;
19+
20+
/**
21+
* 1. 创建测试计划
22+
* 2. 上传test case 文件,或者指定文件地址
23+
* 3. 生成测试用例-后台异步执行
24+
* 4.
25+
* 2.
26+
*/
27+
@Entity
28+
@Table(name = "test_plans")
29+
@Erupt(name = "测试计划管理",
30+
power = @Power(importable = true, export = true)
31+
,linkTree = @LinkTree(field = "testRequirement")
32+
)
33+
public class TestPlan extends NamedTimeStatusModel {
34+
35+
@EruptField(
36+
views = @View(
37+
title = "负责人"
38+
),
39+
edit = @Edit(
40+
title = "负责人",
41+
type = EditType.INPUT, search = @Search, notNull = true
42+
)
43+
)
44+
private String owner;
45+
46+
@ManyToOne
47+
@JoinColumn(name = "tr_id")
48+
@EruptField(
49+
views = @View(title = "需求名称", column = "name"),
50+
edit = @Edit(
51+
search = @Search,
52+
title = "需求选择",
53+
type = EditType.REFERENCE_TREE,
54+
desc = "动态需求",
55+
referenceTreeType = @ReferenceTreeType(
56+
pid = "parent.id"))
57+
)
58+
private TestRequirement testRequirement;
59+
60+
@JoinTable(name = "test_plan_cases",
61+
joinColumns = @JoinColumn(name = "test_plan_id", referencedColumnName = "id"),
62+
inverseJoinColumns = @JoinColumn(name = "test_case_id", referencedColumnName = "id"))
63+
@ManyToMany(fetch = FetchType.EAGER)
64+
@EruptField(
65+
views = @View(title = "包含用例"),
66+
edit = @Edit(
67+
title = "包含用例",
68+
type = EditType.TAB_TABLE_REFER
69+
)
70+
)
71+
private Set<TestCase> testCases;
72+
}

0 commit comments

Comments
 (0)