Closed brandon-bethke-timu closed 6 years ago
@brandon-bethke-neudesic thanks for working on Puppeteer Recorder. I went through your PR and I love some of the ideas! However, I cannot merge this PR. There are too many different features, updates etc. going on in one PR. Also, some of the changes are beta or very specific to your use case that are probably better left to individual users to add themselves to the code once generated, i.e. the waitForX selectors with timeouts, the custom elements.
This was not very clear for contributors, my bad, so I just added a CONTRIBUTING.md file to the master branch which lays out some rules regarding contributing PR's.
Having said that, the following features fit with the overall project and should appeal to more users:
visible
boolean to waitForWould love to chat about this and discuss implementation in a related issue.
Hopefully these changes are not considered offensive. The new features should be considered beta and may be modified in the future.
The keycode that emits the
type()
instruction is now configurable on the options page. It defaults to 9 (tab)Pressing
enter
will emit apage.keyboard.press("Enter")
instruction. Maybe this should be configurable.New option to cause waitForSelector to also use {visible: true/false}.
New cookies option. A json value that defines the cookies to add to the page
Added an addition toolbar under the recording toolbar. Needs work.
The new toolbar contains new option 'Wait'. Clicking the 'Wait' button emits a
page.waitFor(timeout)
instruction. The timeout value is configurable in the options and defaults to 2000 (two seconds).The new toolbar contains new option 'Text Click'. This name is bad. Clicking this button and then clicking on an element will emit a
waitForXPath
instruction followed by a click instruction. Additionally it causes the waitForXPath method to force a match based on the normalized innerText of the element. This is useful when the element being clicked on is not always at the same css path.The new toolbar contains new option 'Wait For'. Clicking this button and then clicking on an element will emit a
waitForXPath
instruction. Additionally it causes the waitForXPath method to force a match based on the normalized innerText of the element. This is useful when the element being clicked on is not always at the same css path.Sanitized sample script using new code generation.