-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add form action #35
Add form action #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Good simple logic.
Please:
1.) Do not ignore Pull Request template. Fill it please so that the reviewer would see the changes and motivation. Look for other PRs in hostory for examples.
2.) Do not ignore PEP8. It is one of the main aspects of Python. Use black
for formatting.
Pull Request: Add FillForm Class for Form Automation
Overview
This pull request introduces a new class FillForm, designed to automate the process of filling out and submitting forms on a webpage. The FillForm class allows users to specify input fields with their corresponding values and optional delays, as well as interact with a submit button if provided.
New Feature
Class: FillForm
This class extends PuppeteerServiceAction and is used to fill out forms based on CSS selectors. It also handles optional delays between keystrokes and submits the form if a submit button is specified.
Class Definition
The FillForm class is defined as follows:
Key Points
input_mapping: A dictionary that maps CSS selectors to input details. Each selector is paired with a dictionary containing:
value: The text to be entered into the input element.
delay (optional): Delay in milliseconds between keystrokes.
submit_button (optional): CSS selector for the submit button, which will be clicked after the form is filled.
Example Usage
To use the FillForm class, initialize it with the required input_mapping and an optional submit_button:
This configuration will fill in the username and password fields with the provided values and delays, and click the submit button with the ID #loginButton.