buchhalter-ai / buchhalter-ai-cli

The buchhalter open-source command line tool to automate invoice downloads from suppliers. Free, customizable, and designed for seamless financial workflow integration.
https://buchhalter.ai
Other
4 stars 1 forks source link

TASK: Implement step.When.Url filter #32

Closed brgmn closed 4 months ago

brgmn commented 5 months ago

And skip second layer click if „value“ in downloadAll step is empty.

Use the following github recipe for testing:

{
  "provider": "github",
  "domains": [
    "github.com"
  ],
  "type": "browser",
  "steps": [
    {
      "action": "open",
      "url": "https://github.com/login",
      "description": "Open the login page."
    },
    {
      "action": "type",
      "selector": "#login_field",
      "value": "{{ username }}",
      "description": "Insert login email."
    },
    {
      "action": "type",
      "selector": "#password",
      "value": "{{ password }}",
      "description": "Insert password."
    },
    {
      "action": "click",
      "selector": "//input[@type='submit']",
      "description": "Click on continue."
    },
    {
      "action": "waitFor",
      "selector": "#app_totp",
      "description": "Wait for the 2FA code input field.",
      "when": {
        "url": "https://github.com/sessions/two-factor/app"
      }
    },
    {
      "action": "type",
      "selector": "#app_totp",
      "value": "{{ totp }}",
      "description": "Insert the 2FA code (if required)",
      "when": {
        "url": "https://github.com/sessions/two-factor/app"
      }
    },
    {
      "action": "waitFor",
      "selector": "//input[@type='submit',contains(., 'me later')]",
      "description": "Wait for security settings screen",
      "when": {
        "url": "https://github.com/sessions/trusted-device"
      }
    },
    {
      "action": "click",
      "selector": "//input[@type='submit',contains(., 'me later')]",
      "description": "Click remind me later or ask me later button",
      "when": {
        "url": "https://github.com/sessions/trusted-device"
      }
    },
    {
      "action": "waitFor",
      "selector": "//a[@href='/logout']",
      "description": "Wait for logout link"
    },
    {
      "action": "open",
      "url": "https://github.com/account/billing/history",
      "description": "Open the billing history page."
    },
    {
      "action": "downloadAll",
      "selector": "//a[contains(@id,'download-receipt')]",
      "description": "Download all invoices."
    }
  ]
}
brgmn commented 5 months ago

I get the error: "ERROR: unhandled node event *dom.EventTopLayerElementsUpdated". Maybe we should suppress this error. Does it have something to do with your raise condition checks? Never had this problem before.

https://github.com/chromedp/chromedp/blob/ebf842c7bc28db77d0bf4d757f5948d769d0866f/target.go#L419