// Wait for a specific event or events matching the given glob pattern, up to an
// optional Timeout duration.
Wait for a specific event or events matching the given glob pattern, up to an
optional Timeout duration.
// Wait for a specific event or events matching the given glob pattern up to an // optional Timeout duration .
func (self *Commands) WaitFor(event string, args *WaitForArgs) error {
	if args == nil {
		args = &WaitForArgs{}
	}
	defaults.SetDefaults(args)
	args.Timeout = utils.FudgeDuration(args.Timeout)
	if waiter, err := self.browser.Tab().CreateEventWaiter(event); err == nil {
		defer waiter.Remove()
		_, err := waiter.Wait(args.Timeout)
		return err
	} else {
		return err
	}
}
func ( self * Commands ) WaitFor ( event string , args * WaitForArgs ) error { if args == nil { args = & WaitForArgs { } } defaults . SetDefaults ( args ) args . Timeout = utils . FudgeDuration ( args . Timeout ) if waiter , err := self . browser . Tab ( ) . CreateEventWaiter ( event ) ; err == nil { defer waiter . Remove ( ) _ , err := waiter . Wait ( args . Timeout ) return err } else { return err } }
Wait for a specific event or events matching the given glob pattern, up to an
optional Timeout duration.
Wait for a specific event or events matching the given glob pattern up to an optional Timeout duration .
// wait for the first event matching the given pattern