...

Source file src/github.com/playwright-community/playwright-go/dialog.go

Documentation: github.com/playwright-community/playwright-go

     1  package playwright
     2  
     3  type dialogImpl struct {
     4  	channelOwner
     5  }
     6  
     7  func (d *dialogImpl) Type() string {
     8  	return d.initializer["type"].(string)
     9  }
    10  
    11  func (d *dialogImpl) Message() string {
    12  	return d.initializer["message"].(string)
    13  }
    14  
    15  func (d *dialogImpl) DefaultValue() string {
    16  	return d.initializer["defaultValue"].(string)
    17  }
    18  
    19  func (d *dialogImpl) Accept(promptTextInput ...string) error {
    20  	var promptText *string
    21  	if len(promptTextInput) == 1 {
    22  		promptText = &promptTextInput[0]
    23  	}
    24  	_, err := d.channel.Send("accept", map[string]interface{}{
    25  		"promptText": promptText,
    26  	})
    27  	return err
    28  }
    29  
    30  func (d *dialogImpl) Dismiss() error {
    31  	_, err := d.channel.Send("dismiss")
    32  	return err
    33  }
    34  
    35  func newDialog(parent *channelOwner, objectType string, guid string, initializer map[string]interface{}) *dialogImpl {
    36  	bt := &dialogImpl{}
    37  	bt.createChannelOwner(bt, parent, objectType, guid, initializer)
    38  	return bt
    39  }
    40  

View as plain text