forked from playwright-community/playwright-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file_chooser.go
41 lines (34 loc) · 919 Bytes
/
file_chooser.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package playwright
type fileChooserImpl struct {
page Page
elementHandle ElementHandle
isMultiple bool
}
func (f *fileChooserImpl) Page() Page {
return f.page
}
func (f *fileChooserImpl) Element() ElementHandle {
return f.elementHandle
}
func (f *fileChooserImpl) IsMultiple() bool {
return f.isMultiple
}
// InputFile represents the input file for:
// - FileChooser.SetFiles()
// - ElementHandle.SetInputFiles()
// - Page.SetInputFiles()
type InputFile struct {
Name string
MimeType string
Buffer []byte
}
func (f *fileChooserImpl) SetFiles(files []InputFile, options ...ElementHandleSetInputFilesOptions) error {
return f.elementHandle.SetInputFiles(files, options...)
}
func newFileChooser(page Page, elementHandle ElementHandle, isMultiple bool) *fileChooserImpl {
return &fileChooserImpl{
page: page,
elementHandle: elementHandle,
isMultiple: isMultiple,
}
}