playwright.controller.InputFile
playwright.controller.InputFile(page, id)Controller for shiny.express.ui.input_file.
Attributes
| Name | Description |
|---|---|
| expect | Expectation method equivalent to playwright.expect(self.loc). |
| id | The browser DOM id of the UI element. |
| loc | Playwright Locator of the UI element. |
| loc_button | Playwright Locator of the button. |
| loc_container | Playwright Locator for the container of the UI element. |
| loc_file_display | Playwright Locator of the file display. |
| loc_label | Playwright Locator for the label of the UI element. |
| loc_progress | Playwright Locator of the progress bar. |
| page | Playwright Page of the Shiny app. |
Methods
| Name | Description |
|---|---|
| expect_accept | Expect the accept attribute to have a specific value. |
| expect_button_label | Expect the button label to have a specific value. |
| expect_capture | Expect the capture attribute to have a specific value. |
| expect_complete | Expect the file upload to be complete. |
| expect_label | Expect the label of the input to have a specific text. |
| expect_multiple | Expect the multiple attribute to have a specific value. |
| expect_width | Expect the width of the input file to have a specific value. |
| set | Set the file upload. |
expect_accept
playwright.controller.InputFile.expect_accept(value, *, timeout=None)Expect the accept attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | list[str] | AttrValue |
The expected value of the accept attribute. |
required |
| timeout | Timeout |
The timeout for the expectation. Defaults to None. |
None |
expect_capture
playwright.controller.InputFile.expect_capture(value, *, timeout=None)Expect the capture attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | Literal[‘environment’, ‘user’] | None | The expected value of the capture attribute. |
required |
| timeout | Timeout |
The timeout for the expectation. Defaults to None. |
None |
expect_complete
playwright.controller.InputFile.expect_complete(timeout=None)Expect the file upload to be complete.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| timeout | Timeout |
The timeout for the expectation. Defaults to None. |
None |
expect_label
playwright.controller.InputFile.expect_label(value, *, timeout=None)Expect the label of the input to have a specific text.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | PatternOrStr |
The expected text value of the label. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
expect_multiple
playwright.controller.InputFile.expect_multiple(value, *, timeout=None)Expect the multiple attribute to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | bool | The expected value of the multiple attribute. |
required |
| timeout | Timeout |
The timeout for the expectation. Defaults to None. |
None |
expect_width
playwright.controller.InputFile.expect_width(value, *, timeout=None)Expect the width of the input file to have a specific value.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| value | StyleValue |
The expected value of the width. | required |
| timeout | Timeout |
The maximum time to wait for the expectation to be fulfilled. Defaults to None. |
None |
set
playwright.controller.InputFile.set(
file_path,
*,
timeout=None,
expect_complete_timeout=30 * 1000,
)Set the file upload.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| file_path | str | pathlib.Path | FilePayload | list[str | pathlib.Path] | list[FilePayload] |
The path to the file to upload. | required |
| timeout | Timeout |
The timeout for the action. Defaults to None. |
None |
| expect_complete_timeout | Timeout |
The timeout for the expectation that the upload is complete. Defaults to 30 * 1000. |
30 * 1000 |