...

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

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

     1  package playwright
     2  
     3  type fileChooserImpl struct {
     4  	page          Page
     5  	elementHandle ElementHandle
     6  	isMultiple    bool
     7  }
     8  
     9  func (f *fileChooserImpl) Page() Page {
    10  	return f.page
    11  }
    12  
    13  func (f *fileChooserImpl) Element() ElementHandle {
    14  	return f.elementHandle
    15  }
    16  
    17  func (f *fileChooserImpl) IsMultiple() bool {
    18  	return f.isMultiple
    19  }
    20  
    21  // InputFile represents the input file for:
    22  // - FileChooser.SetFiles()
    23  // - ElementHandle.SetInputFiles()
    24  // - Page.SetInputFiles()
    25  type InputFile struct {
    26  	Name     string
    27  	MimeType string
    28  	Buffer   []byte
    29  }
    30  
    31  func (f *fileChooserImpl) SetFiles(files []InputFile, options ...ElementHandleSetInputFilesOptions) error {
    32  	return f.elementHandle.SetInputFiles(files, options...)
    33  }
    34  
    35  func newFileChooser(page Page, elementHandle ElementHandle, isMultiple bool) *fileChooserImpl {
    36  	return &fileChooserImpl{
    37  		page:          page,
    38  		elementHandle: elementHandle,
    39  		isMultiple:    isMultiple,
    40  	}
    41  }
    42  

View as plain text