github.com/argoproj/argo-cd/v3@v3.2.1/test/e2e/fixture/notification/context.go (about) 1 package notification 2 3 import ( 4 "testing" 5 "time" 6 7 "github.com/argoproj/argo-cd/v3/test/e2e/fixture" 8 ) 9 10 // this implements the "given" part of given/when/then 11 type Context struct { 12 t *testing.T 13 } 14 15 func Given(t *testing.T) *Context { 16 t.Helper() 17 fixture.EnsureCleanState(t) 18 return &Context{t: t} 19 } 20 21 func (c *Context) And(block func()) *Context { 22 block() 23 return c 24 } 25 26 func (c *Context) When() *Actions { 27 time.Sleep(fixture.WhenThenSleepInterval) 28 return &Actions{context: c} 29 }