diff --git a/cmd/test/cli/cli_cb_test.go b/cmd/test/cli/cli_cb_test.go index 635e1399f7fd0d6dc1cf041fa4413a4b97ff822b..7ebcc76bdeb93234eef54b107e1d46aa56ba5bc4 100644 --- a/cmd/test/cli/cli_cb_test.go +++ b/cmd/test/cli/cli_cb_test.go @@ -25,7 +25,7 @@ type CbSuite struct { func (s *CbSuite) BeforeEach(t provider.T) { t.ID("1591") - t.AddSubSuite("命令行-提交失败结果为禅道中缺陷") + commonTestHelper.ReplaceLabel(t, "命令行-提交失败结果为禅道中缺陷") } func (s *CbSuite) TestCbSuite(t provider.T) { t.Require().Equal("Success", testCb()) diff --git a/cmd/test/cli/cli_ci_test.go b/cmd/test/cli/cli_ci_test.go index b5fb2d58311315023e331ac5da89321afdd48a38..c16ea975aacdcdcbda5a4ed4c4037b95f7450f80 100644 --- a/cmd/test/cli/cli_ci_test.go +++ b/cmd/test/cli/cli_ci_test.go @@ -33,7 +33,7 @@ type CiSuite struct { func (s *CiSuite) BeforeEach(t provider.T) { t.ID("5431") - t.AddSubSuite("命令行-同步用例信息到禅道") + commonTestHelper.ReplaceLabel(t, "命令行-同步用例信息到禅道") } func (s *CiSuite) TestCiSuite(t provider.T) { t.Require().Equal("Success", testCi()) diff --git a/cmd/test/cli/cli_clean_test.go b/cmd/test/cli/cli_clean_test.go index 443272abc049479fdce7bdcc53041c03d9f8d659..05abc183e672e6e4786cf9fe151997e33e540cbf 100644 --- a/cmd/test/cli/cli_clean_test.go +++ b/cmd/test/cli/cli_clean_test.go @@ -2,13 +2,14 @@ package main import ( "fmt" - commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" "os" "regexp" "runtime" "testing" "time" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" + expect "github.com/easysoft/zentaoatf/pkg/lib/expect" "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" @@ -24,7 +25,7 @@ type CleanSuite struct { func (s *CleanSuite) BeforeEach(t provider.T) { t.ID("1595") - t.AddSubSuite("命令行-清除测试日志") + commonTestHelper.ReplaceLabel(t, "命令行-清除测试日志") } func (s *CleanSuite) TestCleanSuite(t provider.T) { t.Require().Equal("Success", testClean()) diff --git a/cmd/test/cli/cli_co_test.go b/cmd/test/cli/cli_co_test.go index 6aa632e9a7c7778b89de0adf144ccf60818be3b9..0ac907bc64a614593cfa9082c32d82943dcff456 100644 --- a/cmd/test/cli/cli_co_test.go +++ b/cmd/test/cli/cli_co_test.go @@ -56,7 +56,7 @@ type CoSuite struct { func (s *CoSuite) BeforeEach(t provider.T) { t.ID("1580") - t.AddSubSuite("命令行-co") + commonTestHelper.ReplaceLabel(t, "命令行-从禅道同步用例") if runtime.GOOS == "windows" { productDir = ".\\product1" diff --git a/cmd/test/cli/cli_cr_test.go b/cmd/test/cli/cli_cr_test.go index 550c371f9b99059422ce08122ee9e6ad44cf822f..21077cd6b8cb57b074a415bf173d69ede2ca5f7e 100644 --- a/cmd/test/cli/cli_cr_test.go +++ b/cmd/test/cli/cli_cr_test.go @@ -28,12 +28,11 @@ type CrSuite struct { func (s *CrSuite) BeforeEach(t provider.T) { t.ID("1590") - t.AddSubSuite("命令行-提交测试结果到禅道") + commonTestHelper.ReplaceLabel(t, "命令行-提交测试结果到禅道") } func (s *CrSuite) TestAutoCr(t provider.T) { t.ID("7558") - t.AddSubSuite("命令行-提交测试结果到禅道免确认") caseInfo := apiTest.GetCaseResult(1) lastId := caseInfo["Id"].(int64) @@ -60,7 +59,6 @@ func (s *CrSuite) TestAutoCr(t provider.T) { func (s *CrSuite) TestCr(t provider.T) { t.ID("1590") - t.AddSubSuite("命令行-提交测试结果到禅道") caseInfo := apiTest.GetCaseResult(1) lastId := caseInfo["Id"].(int64) diff --git a/cmd/test/cli/cli_expect_test.go b/cmd/test/cli/cli_expect_test.go index 6be7525e8475e4f9b84c65348f66840ed9e7f59f..f3e4dc5c5b9ce87824226e725927ab3e1e8b8e7a 100644 --- a/cmd/test/cli/cli_expect_test.go +++ b/cmd/test/cli/cli_expect_test.go @@ -26,7 +26,7 @@ type ExpectSuite struct { func (s *ExpectSuite) BeforeEach(t provider.T) { t.ID("5429") - t.AddSubSuite("命令行-生成独立的期待结果文件") + commonTestHelper.ReplaceLabel(t, "命令行-生成独立的期待结果文件") } func (s *ExpectSuite) TestExpectSuite(t provider.T) { t.Require().Equal("Success", testExpect()) diff --git a/cmd/test/cli/cli_extract_test.go b/cmd/test/cli/cli_extract_test.go index 2f3c08724ba0602601f198bc33263338141b402d..35d5eb3042b77855eed8292cce1d31ac19f6e9b2 100644 --- a/cmd/test/cli/cli_extract_test.go +++ b/cmd/test/cli/cli_extract_test.go @@ -26,7 +26,7 @@ type ExtractSuite struct { func (s *ExtractSuite) BeforeEach(t provider.T) { t.ID("5430") - t.AddSubSuite("命令行-提取分散在脚本中的注释") + commonTestHelper.ReplaceLabel(t, "命令行-提取分散在脚本中的注释") } func (s *ExtractSuite) TestExtractSuite(t provider.T) { t.Require().Equal("Success", testExtract()) diff --git a/cmd/test/cli/cli_help_test.go b/cmd/test/cli/cli_help_test.go index 30632f199bf840637993092716dc9e22dc2faaad..29193ffb72433d154c20a81fd1c0eec94af3ff06 100644 --- a/cmd/test/cli/cli_help_test.go +++ b/cmd/test/cli/cli_help_test.go @@ -22,7 +22,7 @@ type HelpSuite struct { func (s *HelpSuite) BeforeEach(t provider.T) { t.ID("1578") - t.AddSubSuite("命令行-查看帮助") + commonTestHelper.ReplaceLabel(t, "命令行-查看帮助") } func (s *HelpSuite) TestHelpSuite(t provider.T) { t.Require().Equal("Success", testHelp()) diff --git a/cmd/test/cli/cli_list_test.go b/cmd/test/cli/cli_list_test.go index c577d411a8a932553168abb2d33eb828b82c6ea9..3def9a2f57ec676e307114f2a31bb1e3c405c998 100644 --- a/cmd/test/cli/cli_list_test.go +++ b/cmd/test/cli/cli_list_test.go @@ -19,7 +19,7 @@ type ListSuite struct { func (s *ListSuite) BeforeEach(t provider.T) { t.ID("1592") - t.AddSubSuite("命令行-查看脚本列表") + commonTestHelper.ReplaceLabel(t, "命令行-查看脚本列表") } func (s *ListSuite) TestListSuite(t provider.T) { t.Require().Equal("Success", testLs(commonTestHelper.GetZtfPath()+fmt.Sprintf(" list %scmd/test/demo", constTestHelper.RootPath), regexp.MustCompile("Found 7 test cases|发现7个用例"))) diff --git a/cmd/test/cli/cli_run_test.go b/cmd/test/cli/cli_run_test.go index 418c1bbda81dc77bae94ca0e0e5d9104f65e7ebe..657f68ef2fcf2bcd942002041aead54c3894ec7e 100644 --- a/cmd/test/cli/cli_run_test.go +++ b/cmd/test/cli/cli_run_test.go @@ -41,7 +41,7 @@ func (s *RunSuite) BeforeEach(t provider.T) { } else { os.RemoveAll(fmt.Sprintf("%s/cmd/test/demo/php/product1", constTestHelper.RootPath)) } - t.AddSubSuite("命令行-run") + commonTestHelper.ReplaceLabel(t, "命令行-运行脚本") } func (s *RunSuite) TestRunZtfFile(t provider.T) { diff --git a/cmd/test/cli/cli_run_unit_test.go b/cmd/test/cli/cli_run_unit_test.go index d38ff75a30e50ba7a90b22eec04a101f36732b83..1ae72c6267fe922e00278429b46dee96ccf69403 100644 --- a/cmd/test/cli/cli_run_unit_test.go +++ b/cmd/test/cli/cli_run_unit_test.go @@ -14,6 +14,7 @@ import ( "strings" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file" "github.com/go-git/go-git/v5" @@ -31,7 +32,7 @@ func (s *RunUnitSuit) BeforeEach(t provider.T) { } else { os.RemoveAll(fmt.Sprintf("%s/cmd/test/demo/php/product1", constTestHelper.RootPath)) } - t.AddSubSuite("命令行-run") + commonTestHelper.ReplaceLabel(t, "命令行-运行单元测试") } func (s *RunUnitSuit) TestRunTestng(t provider.T) { diff --git a/cmd/test/cli/cli_set_test.go b/cmd/test/cli/cli_set_test.go index 6993e05ce6c8b752b9934d9f30f726c8b641300c..31791e5236b86ef44c8f40c9def1fcdf1169e74e 100644 --- a/cmd/test/cli/cli_set_test.go +++ b/cmd/test/cli/cli_set_test.go @@ -46,7 +46,7 @@ type SetSuite struct { func (s *SetSuite) BeforeEach(t provider.T) { t.ID("1579") - t.AddSubSuite("命令行-set") + commonTestHelper.ReplaceLabel(t, "命令行-设置") } func (s *SetSuite) TestChSetSuite(t provider.T) { @@ -110,7 +110,7 @@ func testSet(language string) (ret string) { for _, lang := range langArray { out, err := child.Expect(regexp.MustCompile("Please set script|请设置"), time.Second*5) if err != nil { - return fmt.Sprintf("expect %s, actual %s", lang, err.Error()) + return fmt.Sprintf("expect Please set script|请设置%s, actual %s", lang, err.Error()) } sendMsg := "" diff --git a/cmd/test/cli/cli_version_test.go b/cmd/test/cli/cli_version_test.go index df5e4a42a756326f6e2b947d7231631a5301f622..9c48f5a6e2977a80e4d34ef31e2b94a20892ba16 100644 --- a/cmd/test/cli/cli_version_test.go +++ b/cmd/test/cli/cli_version_test.go @@ -22,7 +22,7 @@ type VersionSuite struct { func (s *VersionSuite) BeforeEach(t provider.T) { t.ID("7534") - t.AddSubSuite("命令行-查看ZTF版本") + commonTestHelper.ReplaceLabel(t, "命令行-查看ZTF版本") } func (s *VersionSuite) TestVersionSuite(t provider.T) { t.Require().Equal("Success", testVersion()) diff --git a/cmd/test/cli/cli_view_test.go b/cmd/test/cli/cli_view_test.go index 1576c2181f5c6437f77c50149f3fd4ed4c1242b7..2cab09a5d97ee9af0968b06b9c4af814e896b426 100644 --- a/cmd/test/cli/cli_view_test.go +++ b/cmd/test/cli/cli_view_test.go @@ -19,7 +19,7 @@ type ViewSuite struct { func (s *ViewSuite) BeforeEach(t provider.T) { t.ID("1593") - t.AddSubSuite("命令行-查看脚本详情") + commonTestHelper.ReplaceLabel(t, "命令行-查看脚本详情") } func (s *ViewSuite) TestViewSuite(t provider.T) { t.Require().Equal("Success", testView(commonTestHelper.GetZtfPath()+fmt.Sprintf(" view %scmd/test/demo/1_string_match_fail.php", constTestHelper.RootPath), regexp.MustCompile("check string matches pattern"))) diff --git a/cmd/test/helper/common/allure.go b/cmd/test/helper/common/allure.go new file mode 100644 index 0000000000000000000000000000000000000000..e796aea0beeb6a6605f65821f9ea06f5e6e1ed8d --- /dev/null +++ b/cmd/test/helper/common/allure.go @@ -0,0 +1,11 @@ +package commonTestHelper + +import ( + "github.com/ozontech/allure-go/pkg/allure" + "github.com/ozontech/allure-go/pkg/framework/provider" +) + +func ReplaceLabel(t provider.T, value string) { + label := allure.Label{Name: "suite", Value: value} + t.ReplaceLabel(&label) +} diff --git a/cmd/test/restapi/api_bug_test.go b/cmd/test/restapi/api_bug_test.go index 871d5926f470f4d50c334ff02427d9dc6a446a98..632ada47249edcaac78b00ef45f822cb976019d0 100644 --- a/cmd/test/restapi/api_bug_test.go +++ b/cmd/test/restapi/api_bug_test.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -10,7 +13,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "testing" ) const ( @@ -28,7 +30,7 @@ type BugApiSuite struct { func (s *BugApiSuite) BeforeEach(t provider.T) { t.ID("0") - t.AddSubSuite("BugApi") + commonTestHelper.ReplaceLabel(t, "BugApi") } func (s *BugApiSuite) TestBugListApi(t provider.T) { diff --git a/cmd/test/restapi/api_case_test.go b/cmd/test/restapi/api_case_test.go index 5b031518328be15182c357f9383799eed6199fbf..c5829b8f0b4c4fcc8f31d477bdbeee9d36b7c88d 100644 --- a/cmd/test/restapi/api_case_test.go +++ b/cmd/test/restapi/api_case_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -25,7 +26,7 @@ type CaseApiSuite struct { } func (s *CaseApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("CaseApi") + commonTestHelper.ReplaceLabel(t, "CaseApi") } func (s *CaseApiSuite) TestCaseListApi(t provider.T) { diff --git a/cmd/test/restapi/api_module_test.go b/cmd/test/restapi/api_module_test.go index 1acb99e7dbe35fc42ff58ae41637f7c82379877a..e38cbf7f15a2ed7934366a11024f1eb3ca49fae6 100644 --- a/cmd/test/restapi/api_module_test.go +++ b/cmd/test/restapi/api_module_test.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -9,7 +12,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "testing" ) func TestModuleApi(t *testing.T) { @@ -21,7 +23,7 @@ type ModuleApiSuite struct { } func (s *ModuleApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("ModuleApi") + commonTestHelper.ReplaceLabel(t, "ModuleApi") } func (s *ModuleApiSuite) TestModuleListForCaseApi(t provider.T) { diff --git a/cmd/test/restapi/api_product_test.go b/cmd/test/restapi/api_product_test.go index bc296552ff8f008ea21a5dd82557ab29a987ed83..c0e6786d216a40f8fa789daebb726084e53f2a27 100644 --- a/cmd/test/restapi/api_product_test.go +++ b/cmd/test/restapi/api_product_test.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -9,7 +12,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "testing" ) func TestProductApi(t *testing.T) { @@ -21,7 +23,7 @@ type ProductApiSuite struct { } func (s *ProductApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("ProductApi") + commonTestHelper.ReplaceLabel(t, "ProductApi") } func (s *ProductApiSuite) TestProductListApi(t provider.T) { diff --git a/cmd/test/restapi/api_result_test.go b/cmd/test/restapi/api_result_test.go index 1e264c891186bf31f2752fcbd352cfb7f0ba82a9..dc4d930b13a4f26d562d6701194436ccbeca8edf 100644 --- a/cmd/test/restapi/api_result_test.go +++ b/cmd/test/restapi/api_result_test.go @@ -3,6 +3,10 @@ package main import ( "encoding/json" "fmt" + "log" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -12,8 +16,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "log" - "testing" ) func TestResultApi(t *testing.T) { @@ -25,7 +27,7 @@ type ResultApiSuite struct { } func (s *ResultApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("SuiteApi") + commonTestHelper.ReplaceLabel(t, "SuiteApi") } func (s *ResultApiSuite) TestResultSubmitZtfResultApi(t provider.T) { diff --git a/cmd/test/restapi/api_suite_test.go b/cmd/test/restapi/api_suite_test.go index c49f888843bdd9a979b1a9e90bb9d699e881da33..b7a010ea15041cf1480ba45694f4144c41ed8e55 100644 --- a/cmd/test/restapi/api_suite_test.go +++ b/cmd/test/restapi/api_suite_test.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -9,7 +12,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "testing" ) func TestSuiteApi(t *testing.T) { @@ -21,7 +23,7 @@ type SuiteApiSuite struct { } func (s *SuiteApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("SuiteApi") + commonTestHelper.ReplaceLabel(t, "SuiteApi") } func (s *SuiteApiSuite) TestSuiteListApi(t provider.T) { diff --git a/cmd/test/restapi/api_task_test.go b/cmd/test/restapi/api_task_test.go index 8b2e364a1e8976fd2418c3b330074877eedb468b..2df456e58e326da8307665dea87931ec608919f3 100644 --- a/cmd/test/restapi/api_task_test.go +++ b/cmd/test/restapi/api_task_test.go @@ -2,6 +2,9 @@ package main import ( "fmt" + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/easysoft/zentaoatf/cmd/test/restapi/config" @@ -9,7 +12,6 @@ import ( "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" "github.com/tidwall/gjson" - "testing" ) func TestTaskApi(t *testing.T) { @@ -21,7 +23,7 @@ type TaskApiSuite struct { } func (s *TaskApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("TaskApi") + commonTestHelper.ReplaceLabel(t, "TaskApi") } func (s *TaskApiSuite) TestTaskListApi(t provider.T) { diff --git a/cmd/test/restapi/api_token_test.go b/cmd/test/restapi/api_token_test.go index 5e6ad102ef28d854b1cd45482eb8bdc0f73182eb..d1a3addfd2c55651436c447f7db7b265e18d632e 100644 --- a/cmd/test/restapi/api_token_test.go +++ b/cmd/test/restapi/api_token_test.go @@ -1,10 +1,12 @@ package main import ( + "testing" + + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" httpHelper "github.com/easysoft/zentaoatf/cmd/test/helper/http" "github.com/ozontech/allure-go/pkg/framework/provider" "github.com/ozontech/allure-go/pkg/framework/suite" - "testing" ) func TestTokenApi(t *testing.T) { @@ -16,7 +18,7 @@ type TokenApiSuite struct { } func (s *TokenApiSuite) BeforeEach(t provider.T) { - t.AddSubSuite("TokenApi") + commonTestHelper.ReplaceLabel(t, "TokenApi") } func (s *TokenApiSuite) TestTokenApi(t provider.T) { diff --git a/cmd/test/ui/ui_bug_test.go b/cmd/test/ui/ui_bug_test.go index 37e49e2f85e1b5b01d4c179c852b6f56284a5f41..671e2540753c5f624f53d644dbeed73806f2d663 100644 --- a/cmd/test/ui/ui_bug_test.go +++ b/cmd/test/ui/ui_bug_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" "github.com/easysoft/zentaoatf/cmd/test/ui/conf" @@ -15,7 +16,7 @@ import ( func ScriptBug(t provider.T) { t.ID("5747") - t.AddParentSuite("查看bug列表") + commonTestHelper.ReplaceLabel(t, "客户端-查看bug列表") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -44,7 +45,7 @@ func ScriptBug(t provider.T) { func ScriptsBug(t provider.T) { t.ID("5748") - t.AddParentSuite("查看bug列表") + commonTestHelper.ReplaceLabel(t, "客户端-查看bug列表") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_interpreter_test.go b/cmd/test/ui/ui_interpreter_test.go index ddb57b68763d133d1a9566bae6cd058716225e6c..84b6dcf8c17673a4ac72421e803bd3b97fd03cc7 100644 --- a/cmd/test/ui/ui_interpreter_test.go +++ b/cmd/test/ui/ui_interpreter_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" plwConf "github.com/easysoft/zentaoatf/cmd/test/ui/conf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func CreateInterpreter(t provider.T) { t.ID("5744") - t.AddParentSuite("管理解析器") + commonTestHelper.ReplaceLabel(t, "客户端-管理解析器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -50,7 +51,7 @@ func CreateInterpreter(t provider.T) { func EditInterpreter(t provider.T) { t.ID("5745") - t.AddParentSuite("管理解析器") + commonTestHelper.ReplaceLabel(t, "客户端-管理解析器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -71,7 +72,7 @@ func EditInterpreter(t provider.T) { func DeleteInterpreter(t provider.T) { t.ID("5465") - t.AddParentSuite("管理解析器") + commonTestHelper.ReplaceLabel(t, "客户端-管理解析器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_language_test.go b/cmd/test/ui/ui_language_test.go index f24baf52f446aa17ecc89bcc0e485a16d3d2525f..4750744b15def755fedf8c84f862c69d52b9cc45 100644 --- a/cmd/test/ui/ui_language_test.go +++ b/cmd/test/ui/ui_language_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" "github.com/ozontech/allure-go/pkg/framework/provider" @@ -11,7 +12,7 @@ import ( func SwitchLanguage(t provider.T) { t.ID("5464") - t.AddParentSuite("设置界面语言") + commonTestHelper.ReplaceLabel(t, "客户端-设置界面语言") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_log_test.go b/cmd/test/ui/ui_log_test.go index 7ae3a86f8eb60dfd67bc3c6ced88dd92b0ef5714..53c56da1680111a36d1a913af27452bd16885e5e 100644 --- a/cmd/test/ui/ui_log_test.go +++ b/cmd/test/ui/ui_log_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwConf "github.com/easysoft/zentaoatf/cmd/test/ui/conf" @@ -13,7 +14,7 @@ import ( func CollapseLog(t provider.T) { t.ID("5502") - t.AddParentSuite("脚本执行日志") + commonTestHelper.ReplaceLabel(t, "客户端-管理脚本执行日志") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -42,7 +43,7 @@ func CollapseLog(t provider.T) { func FullScreenLog(t provider.T) { t.ID("5749") - t.AddParentSuite("脚本执行日志") + commonTestHelper.ReplaceLabel(t, "客户端-管理脚本执行日志") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -63,7 +64,7 @@ func FullScreenLog(t provider.T) { func ClearLog(t provider.T) { t.ID("7540") - t.AddParentSuite("清除测试执行日志") + commonTestHelper.ReplaceLabel(t, "客户端-管理脚本执行日志") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -83,6 +84,6 @@ func ClearLog(t provider.T) { func TestUiLog(t *testing.T) { runner.Run(t, "客户端-展开折叠执行日志", CollapseLog) - runner.Run(t, "客户端-最大化脚本执行日志", FullScreenLog) + runner.Run(t, "客户端-最大化管理脚本执行日志", FullScreenLog) runner.Run(t, "客户端-清空执行日志", ClearLog) } diff --git a/cmd/test/ui/ui_product_test.go b/cmd/test/ui/ui_product_test.go index 1af869262315f56cc4c96c91cd5533c612096a74..9afeac05199acb85cacaa1f9b35b809dd7f46c3c 100644 --- a/cmd/test/ui/ui_product_test.go +++ b/cmd/test/ui/ui_product_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -14,7 +15,7 @@ import ( func SwitchProduct(t provider.T) { t.ID("5496") - t.AddParentSuite("切换禅道产品") + commonTestHelper.ReplaceLabel(t, "客户端-切换禅道产品") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_proxy_test.go b/cmd/test/ui/ui_proxy_test.go index 8df897b4b18d5181d79713a6e7a75c3079505945..8f7436426cc50c77c9950412471ee705a94739e9 100644 --- a/cmd/test/ui/ui_proxy_test.go +++ b/cmd/test/ui/ui_proxy_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" plwConf "github.com/easysoft/zentaoatf/cmd/test/ui/conf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func CreateProxy(t provider.T) { t.ID("5740") - t.AddParentSuite("设置界面语言") + commonTestHelper.ReplaceLabel(t, "客户端-管理代理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -50,7 +51,7 @@ func CreateProxy(t provider.T) { } func EditProxy(t provider.T) { t.ID("5741") - t.AddParentSuite("设置界面语言") + commonTestHelper.ReplaceLabel(t, "客户端-管理代理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -72,7 +73,7 @@ func EditProxy(t provider.T) { } func DeleteProxy(t provider.T) { t.ID("5742") - t.AddParentSuite("设置界面语言") + commonTestHelper.ReplaceLabel(t, "客户端-管理代理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_result_test.go b/cmd/test/ui/ui_result_test.go index 8efb3155a9bcdb0aa73c62dbc9c72b5a0cd6e1bc..e0bd1ba6f705f012209c00f80895cd594671aa6c 100644 --- a/cmd/test/ui/ui_result_test.go +++ b/cmd/test/ui/ui_result_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" apiTest "github.com/easysoft/zentaoatf/cmd/test/helper/zentao/api" ztfTest "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" @@ -19,11 +20,11 @@ import ( func Detail(t provider.T) { t.ID("5489") - t.AddParentSuite("测试结果") + commonTestHelper.ReplaceLabel(t, "客户端-管理测试结果") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() - ztfTest.SelectSite(webpage) + ztfTest.SelectSite(webpage, "") ztfTest.ExpandWorspace(webpage) ztfTest.RunScript(webpage, "1_string_match.php") @@ -55,7 +56,7 @@ func Detail(t provider.T) { func SubmitResult(t provider.T) { t.ID("5499") - t.AddParentSuite("测试结果") + commonTestHelper.ReplaceLabel(t, "客户端-管理测试结果") caseInfo := apiTest.GetCaseResult(1) lastId := caseInfo["Id"].(int64) @@ -86,7 +87,7 @@ func SubmitResult(t provider.T) { func SubmitBug(t provider.T) { t.ID("5500") - t.AddParentSuite("测试结果") + commonTestHelper.ReplaceLabel(t, "客户端-管理测试结果") lastId := apiTest.GetLastBugId() @@ -108,7 +109,7 @@ func SubmitBug(t provider.T) { func SubmitBugTwoStep(t provider.T) { t.ID("5500") - t.AddParentSuite("测试结果") + commonTestHelper.ReplaceLabel(t, "客户端-管理测试结果") lastId := apiTest.GetLastBugId() @@ -134,8 +135,8 @@ func SubmitBugTwoStep(t provider.T) { } func TestUiResult(t *testing.T) { - runner.Run(t, "客户端-查看测试结果详情", Detail) - runner.Run(t, "客户端-提交禅道用例脚本测试结果", SubmitResult) + runner.Run(t, "客户端-查看管理测试结果详情", Detail) + runner.Run(t, "客户端-提交禅道用例脚本管理测试结果", SubmitResult) runner.Run(t, "客户端-提交禅道失败用例为缺陷", SubmitBug) runner.Run(t, "客户端-提交禅道部分失败用例为缺陷", SubmitBugTwoStep) } diff --git a/cmd/test/ui/ui_run_from_result_test.go b/cmd/test/ui/ui_run_from_result_test.go index 9f753fe84ed67b6bd17d5af3b6c23bc297d5766c..b77f2bdea848e004b0997ab4783449a2e49bd26f 100644 --- a/cmd/test/ui/ui_run_from_result_test.go +++ b/cmd/test/ui/ui_run_from_result_test.go @@ -4,6 +4,7 @@ import ( "strings" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func RunReExecFailCase(t provider.T) { t.ID("5491") - t.AddParentSuite("测试结果页面执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-结果中重新执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -54,7 +55,7 @@ func RunReExecFailCase(t provider.T) { func RunReExecAllCase(t provider.T) { t.ID("5750") - t.AddParentSuite("测试结果页面执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-结果中重新执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_run_statistic_test.go b/cmd/test/ui/ui_run_statistic_test.go index b77f1a4138d71b2951d88912ce848085449ae1b4..6ea901c6b8b7dc4df9106f19cf2a00dc3625d0f1 100644 --- a/cmd/test/ui/ui_run_statistic_test.go +++ b/cmd/test/ui/ui_run_statistic_test.go @@ -4,6 +4,7 @@ import ( "strconv" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -16,7 +17,7 @@ var runStatisticPage playwright.Page func RunFailStatistic(t provider.T) { t.ID("5487") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行统计信息") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -52,7 +53,7 @@ func RunFailStatistic(t provider.T) { func RunSuccessStatistic(t provider.T) { t.ID("5487") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行统计信息") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -93,7 +94,7 @@ func RunSuccessStatistic(t provider.T) { func RunBugStatistic(t provider.T) { t.ID("5487") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行统计信息") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_run_test.go b/cmd/test/ui/ui_run_test.go index 0d074fc2fb9e2441d353de5ed8ab6ac76a3f9b09..86b4e6e00aae56e57041de5607889667117e4f35 100644 --- a/cmd/test/ui/ui_run_test.go +++ b/cmd/test/ui/ui_run_test.go @@ -19,7 +19,7 @@ import ( func RunScript(t provider.T) { t.ID("5743") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -52,7 +52,7 @@ func RunScript(t provider.T) { func CheckStep(t provider.T) { t.ID("7609") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -89,7 +89,7 @@ func CheckStep(t provider.T) { func RunScriptByRightClick(t provider.T) { t.ID("5479") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -120,7 +120,7 @@ func RunScriptByRightClick(t provider.T) { func RunNoInterpreterScript(t provider.T) { t.ID("5501") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -135,7 +135,7 @@ func RunNoInterpreterScript(t provider.T) { func RunSelectedScripts(t provider.T) { t.ID("5481") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -173,7 +173,7 @@ func RunSelectedScripts(t provider.T) { func RunOpenedAndLast(t provider.T) { t.ID("5484") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -227,7 +227,7 @@ func RunOpenedAndLast(t provider.T) { func RunAll(t provider.T) { t.ID("5485") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") os.RemoveAll(commonTestHelper.GetZtfProductPath()) os.Remove(commonTestHelper.GetPhpWorkspacePath() + "1.php") @@ -268,7 +268,7 @@ func RunAll(t provider.T) { func RunWorkspace(t provider.T) { t.ID("5482") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -315,7 +315,7 @@ func RunWorkspace(t provider.T) { func RunDir(t provider.T) { t.ID("5480") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -344,7 +344,7 @@ func RunDir(t provider.T) { func RunUseProxy(t provider.T) { t.ID("5746") - t.AddParentSuite("执行脚本") + commonTestHelper.ReplaceLabel(t, "客户端-执行脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_run_unit_test.go b/cmd/test/ui/ui_run_unit_test.go index 75e779ac109355bfefced0aa9f20a1e031098fa6..0874c04cd8229c950705042b2434b2b061aa38d8 100644 --- a/cmd/test/ui/ui_run_unit_test.go +++ b/cmd/test/ui/ui_run_unit_test.go @@ -46,7 +46,7 @@ func RunTestNG(t provider.T) { shellUtils.ExeShellWithOutputInDir("mvn clean package test", testngDir) t.ID("5432") - t.AddParentSuite("执行单元测试") + commonTestHelper.ReplaceLabel(t, "客户端-执行单元测试") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_script_test.go b/cmd/test/ui/ui_script_test.go index 6854bcdcf8c0c3547d57706477e390f1cff5bed4..a3a20d6aa2fe1569678bfe8397e0a6fed64fbc49 100644 --- a/cmd/test/ui/ui_script_test.go +++ b/cmd/test/ui/ui_script_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func SaveScript(t provider.T) { t.ID("5470") - t.AddParentSuite("禅道站点脚本") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() ztfTestHelper.SelectSite(webpage, "") @@ -42,7 +43,7 @@ func SaveScript(t provider.T) { func ViewScript(t provider.T) { t.ID("5469") - t.AddParentSuite("禅道站点脚本") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() ztfTestHelper.SelectSite(webpage, "") @@ -54,7 +55,7 @@ func ViewScript(t provider.T) { func SwitchScript(t provider.T) { t.ID("7583") - t.AddParentSuite("脚本切换和关闭") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点脚本") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -79,7 +80,7 @@ func SwitchScript(t provider.T) { } func TestUiScript(t *testing.T) { - runner.Run(t, "客户端-编辑保存禅道站点脚本", SaveScript) - runner.Run(t, "客户端-显示禅道站点脚本", ViewScript) - runner.Run(t, "客户端-切换禅道站点脚本", SwitchScript) + runner.Run(t, "客户端-编辑保存管理禅道站点脚本", SaveScript) + runner.Run(t, "客户端-显示管理禅道站点脚本", ViewScript) + runner.Run(t, "客户端-切换管理禅道站点脚本", SwitchScript) } diff --git a/cmd/test/ui/ui_server_test.go b/cmd/test/ui/ui_server_test.go index 264dac4ee187e73f68fbd58466aec04a83866e24..449f64707120d87e3ad2c1cbef90fdf38435770b 100644 --- a/cmd/test/ui/ui_server_test.go +++ b/cmd/test/ui/ui_server_test.go @@ -3,6 +3,7 @@ package main import ( "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" plwConf "github.com/easysoft/zentaoatf/cmd/test/ui/conf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func CreateServer(t provider.T) { t.ID("5737") - t.AddParentSuite("管理服务器") + commonTestHelper.ReplaceLabel(t, "客户端-管理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -34,7 +35,7 @@ func CreateServer(t provider.T) { func EditServer(t provider.T) { t.ID("5738") - t.AddParentSuite("管理服务器") + commonTestHelper.ReplaceLabel(t, "客户端-管理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -55,7 +56,7 @@ func EditServer(t provider.T) { func DeleteServer(t provider.T) { t.ID("5739") - t.AddParentSuite("管理服务器") + commonTestHelper.ReplaceLabel(t, "客户端-管理服务器") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_site_test.go b/cmd/test/ui/ui_site_test.go index 6baa53396a3f7bb0e51f1f15ecc3bc0a3120152b..c137a2bb2b62cfd33fc0e32e6a5de2039f29864a 100644 --- a/cmd/test/ui/ui_site_test.go +++ b/cmd/test/ui/ui_site_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" plwConf "github.com/easysoft/zentaoatf/cmd/test/ui/conf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -14,7 +15,7 @@ import ( func CreateSite(t provider.T) { t.ID("5466") - t.AddParentSuite("配置禅道站点") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -38,7 +39,7 @@ func CreateSite(t provider.T) { func CreateSiteWithFullUrl(t provider.T) { t.ID("7575") - t.AddParentSuite("禅道站点URL格式兼容") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -56,13 +57,13 @@ func CreateSiteWithFullUrl(t provider.T) { locator.FillNth(3, constTestHelper.ZentaoPassword) webpage.Click("text=确定") - webpage.WaitForSelector("fmt.Sprintf(".list-item-content span:has-text('%s')", constTestHelper.SiteName)") + webpage.WaitForSelector(fmt.Sprintf(".list-item-content span:has-text('%s')", constTestHelper.SiteName)) locator = webpage.Locator(".list-item-content span", playwright.PageLocatorOptions{HasText: constTestHelper.SiteName}) } func EditSite(t provider.T) { t.ID("5466") - t.AddParentSuite("配置禅道站点") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -94,11 +95,11 @@ func EditSite(t provider.T) { webpage.Click("#siteFormModal>>.modal-action>>span:has-text(\"确定\")") webpage.WaitForSelector(fmt.Sprintf(".list-item-content span:has-text('%s-update')", constTestHelper.SiteName)) - locator = webpage.Locator(".list-item-content span", playwright.PageLocatorOptions{HasText: constTestHelper.SiteName+"-update"}) + locator = webpage.Locator(".list-item-content span", playwright.PageLocatorOptions{HasText: constTestHelper.SiteName + "-update"}) } func DeleteSite(t provider.T) { t.ID("5466") - t.AddParentSuite("配置禅道站点") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -113,7 +114,7 @@ func DeleteSite(t provider.T) { webpage.WaitForTimeout(1000) webpage.Click(":nth-match(.modal-action > button, 1)") - webpage.WaitForSelector("fmt.Sprintf(".list-item-content span:has-text('%s')", constTestHelper.SiteName)", playwright.PageWaitForSelectorOptions{State: playwright.WaitForSelectorStateDetached}) + webpage.WaitForSelector(fmt.Sprintf(".list-item-content span:has-text('%s')", constTestHelper.SiteName), playwright.PageWaitForSelectorOptions{State: playwright.WaitForSelectorStateDetached}) plwConf.DisableErr() defer plwConf.EnableErr() diff --git a/cmd/test/ui/ui_workspace_filter_test.go b/cmd/test/ui/ui_workspace_filter_test.go index 09ea875b1960cb127048ad1e5034cca3629ddc86..6aed0b4f2175f903f721cb7c4c102cd6c4a75dff 100644 --- a/cmd/test/ui/ui_workspace_filter_test.go +++ b/cmd/test/ui/ui_workspace_filter_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + commonTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/common" constTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/conf" ztfTestHelper "github.com/easysoft/zentaoatf/cmd/test/helper/ztf" plwHelper "github.com/easysoft/zentaoatf/cmd/test/ui/helper" @@ -13,7 +14,7 @@ import ( func FilterDir(t provider.T) { t.ID("5494") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-过滤禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -35,7 +36,7 @@ func FilterDir(t provider.T) { } func FilterSuite(t provider.T) { t.ID("5495") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-过滤禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -58,7 +59,7 @@ func FilterSuite(t provider.T) { } func ByModule(t provider.T) { t.ID("5493") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-过滤禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -79,7 +80,7 @@ func ByModule(t provider.T) { } func FilterTask(t provider.T) { t.ID("5496") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-过滤禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/cmd/test/ui/ui_workspace_test.go b/cmd/test/ui/ui_workspace_test.go index bdc8f82c53e2e76786bf3419deff6e6aae628ffd..e0a03c9e105f1816ab0bdf5847c22bea70bfba70 100644 --- a/cmd/test/ui/ui_workspace_test.go +++ b/cmd/test/ui/ui_workspace_test.go @@ -29,7 +29,7 @@ var ( func MangeWorkspace(t provider.T) { t.ID("5468") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -45,7 +45,7 @@ func MangeWorkspace(t provider.T) { func MangeLocalWorkspace(t provider.T) { t.ID("5467") - t.AddParentSuite("管理本地站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理本地站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -204,7 +204,7 @@ func syncCaseFromZentaoSuite(t provider.T) { func SyncTwoCaseFromZentao(t provider.T) { t.ID("5752") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -236,7 +236,7 @@ func SyncTwoCaseFromZentao(t provider.T) { func SyncToZentao(t provider.T) { t.ID("5431") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") //update script title scriptPath := filepath.Join(workspacePath, "2_webpage_extract.php") @@ -266,7 +266,7 @@ func SyncToZentao(t provider.T) { func Copy(t provider.T) { t.ID("5474") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) defer os.RemoveAll(syncDir) @@ -299,7 +299,7 @@ func Copy(t provider.T) { func ClipAndCopyDir(t provider.T) { t.ID("5473,7593") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") CopyDir(t) ClipDir(t) @@ -377,7 +377,7 @@ func ClipDir(t provider.T) { func CreateScript(t provider.T) { // t.ID("7596") - // t.AddParentSuite("管理禅道站点下工作目录") + // commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -400,7 +400,7 @@ func CreateScript(t provider.T) { func RenameScript(t provider.T) { t.ID("7596") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) @@ -431,7 +431,7 @@ func RenameScript(t provider.T) { func CreateDir(t provider.T) { // t.ID("7596") - // t.AddParentSuite("管理禅道站点下工作目录") + // commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() @@ -454,7 +454,7 @@ func CreateDir(t provider.T) { func RenameDir(t provider.T) { t.ID("7595") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) defer os.RemoveAll(syncDir) @@ -481,7 +481,7 @@ func RenameDir(t provider.T) { func DeleteScript(t provider.T) { t.ID("5478") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) scriptPath := filepath.Join(workspacePath, "product1", "1.php") @@ -514,7 +514,7 @@ func DeleteScript(t provider.T) { } func DeleteDir(t provider.T) { t.ID("5477") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) defer os.RemoveAll(syncDir) @@ -562,7 +562,7 @@ func DeleteWorkspace(t provider.T, webpage plwHelper.Webpage) { } func Clip(t provider.T) { t.ID("5476") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") fileUtils.MkDirIfNeeded(syncDir) scriptPath := filepath.Join(workspacePath, "product1", "1.php") @@ -595,7 +595,7 @@ func Clip(t provider.T) { func Collapse(t provider.T) { t.ID("5472") - t.AddParentSuite("管理禅道站点下工作目录") + commonTestHelper.ReplaceLabel(t, "客户端-管理禅道站点下工作目录") webpage, _ := plwHelper.OpenUrl(constTestHelper.ZtfUrl, t) defer webpage.Close() diff --git a/go.mod b/go.mod index c4948bd12512c15fe471f8f1376c1b8feec9ee17..4cf43eafdb101af468b910881f2b0824d92f5552 100644 --- a/go.mod +++ b/go.mod @@ -36,6 +36,7 @@ require ( github.com/mitchellh/mapstructure v1.4.2 // indirect github.com/nats-io/nats-server/v2 v2.7.2 // indirect github.com/otiai10/copy v1.7.0 + github.com/ozontech/allure-go/pkg/allure v0.6.4 // indirect github.com/ozontech/allure-go/pkg/framework v0.6.18 github.com/playwright-community/playwright-go v0.2000.1 github.com/robfig/cron/v3 v3.0.1 diff --git a/internal/pkg/helper/exec/report-unit.go b/internal/pkg/helper/exec/report-unit.go index 60c21bbc0a7a5adbb47f717760ca02ca1afa7e8c..d9ea4479f0ac60c6187f815d6d6dc68aa0191fcf 100644 --- a/internal/pkg/helper/exec/report-unit.go +++ b/internal/pkg/helper/exec/report-unit.go @@ -4,7 +4,6 @@ import ( "encoding/json" "encoding/xml" "fmt" - "github.com/jinzhu/copier" "io/ioutil" "os" "path" @@ -15,6 +14,8 @@ import ( "strings" "time" + "github.com/jinzhu/copier" + commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts" commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain" websocketHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/websocket" @@ -147,7 +148,7 @@ func genUnitFailedMsg(failedCaseLines []string, failedCaseLinesDesc []string) st msg := divider msg += "\n" + color.New(color.Bold, color.FgHiWhite).Sprint(i118Utils.Sprintf("failed_scripts")) + "\n" - msg += strings.Join(failedCaseLines, "\n") + msg += strings.Join(failedCaseLines, "\n") + "\n" msg += strings.Join(failedCaseLinesDesc, "\n") msg += "\n\n" + divider diff --git a/internal/pkg/helper/exec/result.go b/internal/pkg/helper/exec/result.go index 339f72ae7be258df9550d76263b538d10af7df40..ce92a43f703a17a82561f38154c905e91c9268c2 100644 --- a/internal/pkg/helper/exec/result.go +++ b/internal/pkg/helper/exec/result.go @@ -86,8 +86,8 @@ func ValidateCaseResult(execParams commDomain.ExecParams, langType string, statusWithColor, status := GenStatusTxt(csResult.Status) - msg := fmt.Sprintf(format, execParams.ScriptIdx+1, len(execParams.CasesToRun), status, path, csTitle, execParams.Secs) - msgWithColor := fmt.Sprintf(format, execParams.ScriptIdx+1, len(execParams.CasesToRun), statusWithColor, path, csTitle, execParams.Secs) + msg := fmt.Sprintf(format, len(execParams.Report.FuncResult), len(execParams.CasesToRun), status, path, csTitle, execParams.Secs) + msgWithColor := fmt.Sprintf(format, len(execParams.Report.FuncResult), len(execParams.CasesToRun), statusWithColor, path, csTitle, execParams.Secs) // print each case result if commConsts.ExecFrom == commConsts.FromClient {