Автоматизиране на Браузъра с Electron

End-to-end testing

  • iframe
  • jQuery $('selector')
  • document.querySelector('selector')
  • document.querySelectorAll('selector')
  • `debugger` for breakpoints
  • standard dev tools:
    debugging, breakpoints, inspecting
  • Travis CI support

End-to-end testing
Examples

  • grant-oauth - dev tools reporter
  • express-admin - nwjs
  • electron-socket - stdout reporter

Third-party Web Site Automation

  • iframe or webview
  • webview.executeJavaScript
  • drawback: web framework's internal state
    update is not always easy/possible

Third-party Web Site Automation
Examples

  • manual browser-server-electron flow
    using electron-socket
  • manual browser-electron flow
    using electron-socket
  • fb-events shortcomings

Scripted Automation

  • useful for scraping and all kinds of
    automated bots
  • execude asynchronous code in series
  • two-way message passing
    using electron-socket
  • deploy on Linux server that
    doesn't have graphic libraries installed

Scripted Automation
Examples

  • fully automated posting to G+
    from a dedicated Debian Linux server
Made with Slides.com