11/*
2- Copyright 2023 API Testing Authors.
2+ Copyright 2023-2024 API Testing Authors.
33
44Licensed under the Apache License, Version 2.0 (the "License");
55you may not use this file except in compliance with the License.
@@ -163,6 +163,10 @@ func (o *runOption) preRunE(cmd *cobra.Command, args []string) (err error) {
163163 case "" , "std" :
164164 o .reportWriter = runner .NewResultWriter (writer )
165165 case "pdf" :
166+ if o .reportFile == "" {
167+ err = fmt .Errorf ("report file is required for pdf report" )
168+ return
169+ }
166170 o .reportWriter = runner .NewPDFResultWriter (writer )
167171 case "prometheus" :
168172 if o .reportFile == "" {
@@ -189,7 +193,7 @@ func (o *runOption) preRunE(cmd *cobra.Command, args []string) (err error) {
189193 var swaggerAPI apispec.SwaggerAPI
190194 if o .swaggerURL != "" {
191195 if swaggerAPI .Swagger , err = apispec .ParseURLToSwagger (o .swaggerURL ); err == nil {
192- o .reportWriter .WithAPIConverage (& swaggerAPI )
196+ o .reportWriter .WithAPICoverage (& swaggerAPI )
193197 }
194198 }
195199 }
@@ -360,7 +364,7 @@ func (o *runOption) runSuite(loader testing.Loader, dataContext map[string]inter
360364 runLogger .Info ("run test suite" , "name" , testSuite .Name , "filter" , caseFilter )
361365 for _ , testCase := range testSuite .Items {
362366 if caseFilterObj != nil {
363- if filter , ok := caseFilterObj .([]string ); ok && len (filter ) > 0 {
367+ if filter , ok := caseFilterObj .([]string ); ok && len (filter ) > 0 {
364368 match := false
365369 for _ , ff := range filter {
366370 if strings .Contains (testCase .Name , ff ) {
0 commit comments