You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we have a use case where currently we used Ginkgo for System Levels E2E API Tests. We leverage the generate and bootstrap commands with the --template to be able to get team members up and running coding new test specs.
That said there are times where we want to modify our template with more variables to inject other metadata during rendering rather than hardcoding it in or modifying it afterwards. Below is an example where we would want to render in the values for .TestSpecName, .FrameworkImport, .TestFeature, .TestComponent, .TestId as part of the generate command of our test spec template.
If you guys are OK with this I would be interested in contributing this to the commands
package {{.Package }}
/* This was generated from a template file. Please feel free to update as necessary */
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"fmt"
"strings"
"time"
"encoding/json"
"context"
//framework imports edit as required
{{ .FrameworkImport }}
)
var _ = framework.{{ .TestSpecName }}SuiteDescribe("{{ .TestSpecName }} tests", Label("{{ .TestFeature }}"), func() {
/* note:
- You may need to implement specific implementation of the service/domain you are trying to test if it
not already there in the pkg/ packages
*/
defer GinkgoRecover()
var err error
var f *framework.Framework
// use 'f' to access common controllers or the specific service controllers within the framework
BeforeAll(func() {
// Initialize the tests controllers
f, err = framework.NewFramework()
Expect(err).NotTo(HaveOccurred())
})
Describe("{{ .TestSpecName }} scenario to test", Label("{{ .TestComponent }}"), func() {
// Declare variables here.
BeforeEach(func() {
// Initialize variables here.
// Assert setup here.
})
It("{{ .TestId }} does some test action", func() {
// Implement test and assertions here
})
})
})
The text was updated successfully, but these errors were encountered:
ok makes sense then. i'm planning on adding support for configuring ginkgo via a file and i'm going to be using JSON - so my preference would be that we use JSON instead of yaml for this.
Hi, we have a use case where currently we used Ginkgo for System Levels E2E API Tests. We leverage the
generate
andbootstrap
commands with the--template
to be able to get team members up and running coding new test specs.That said there are times where we want to modify our template with more variables to inject other metadata during rendering rather than hardcoding it in or modifying it afterwards. Below is an example where we would want to render in the values for
.TestSpecName
,.FrameworkImport
,.TestFeature
,.TestComponent
,.TestId
as part of thegenerate
command of our test spec template.If you guys are OK with this I would be interested in contributing this to the commands
The text was updated successfully, but these errors were encountered: