{
  "stats": {
    "suites": 1,
    "tests": 5,
    "passes": 1,
    "pending": 0,
    "failures": 4,
    "start": "2025-11-08T20:14:48.702Z",
    "end": "2025-11-08T20:15:06.405Z",
    "duration": 17703,
    "testsRegistered": 5,
    "passPercent": 20,
    "pendingPercent": 0,
    "other": 0,
    "hasOther": false,
    "skipped": 0,
    "hasSkipped": false
  },
  "results": [
    {
      "uuid": "a717b3a8-408d-4c4c-a391-e9347e44cad2",
      "title": "",
      "fullFile": "cypress\\e2e\\bancos_asaas.cy.js",
      "file": "cypress\\e2e\\bancos_asaas.cy.js",
      "beforeHooks": [],
      "afterHooks": [],
      "tests": [],
      "suites": [
        {
          "uuid": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
          "title": "Financeiro → Bancos: Aba Asaas e dropdowns",
          "fullFile": "",
          "file": "",
          "beforeHooks": [],
          "afterHooks": [],
          "tests": [
            {
              "title": "Remove campo redundante e salva config Asaas",
              "fullTitle": "Financeiro → Bancos: Aba Asaas e dropdowns Remove campo redundante e salva config Asaas",
              "timedOut": null,
              "duration": 5798,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/financeiro/bancos/contas*', {\n  statusCode: 200,\n  body: {\n    data: [{\n      id: 1,\n      banco: 'Itaú',\n      agencia: '0001',\n      conta: '12345-6',\n      status: 'ativa'\n    }, {\n      id: 2,\n      banco: 'Caixa',\n      agencia: '0002',\n      conta: '65432-1',\n      status: 'inativa'\n    }]\n  }\n}).as('getContas');\ncy.intercept('GET', '/api/addons/asaas/config', {\n  statusCode: 200,\n  body: {\n    ok: true,\n    config: {\n      environment: 'production',\n      has_api_key: false\n    }\n  }\n}).as('getAsaasCfg');\ncy.visit('/financeiro/bancos?tab=asaas');\ncy.wait('@getContas');\ncy.wait('@getAsaasCfg');\ncy.contains('h2', 'Asaas — Credenciais').should('be.visible');\ncy.contains('label', 'Webhook Secret (opcional)').should('not.exist');\ncy.get('#asaasEnv').select('sandbox');\ncy.get('#asaasBaseUrl').clear().type('https://sandbox.asaas.com/api/v3');\ncy.get('#asaasApiKey').type('sk_test_asaas');\ncy.intercept('POST', '/api/addons/asaas/config', {\n  statusCode: 200,\n  body: {\n    ok: true\n  }\n}).as('postAsaasCfg');\ncy.get('#btnSaveAsaasCfg').click();\ncy.wait('@postAsaasCfg');\ncy.get('#asaasSaveMsg').should('contain.text', 'Configuração salva');",
              "err": {
                "message": "CypressError: Timed out retrying after 5000ms: `cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `getContas`. No request ever occurred.\n\nhttps://on.cypress.io/wait",
                "estack": "CypressError: Timed out retrying after 5000ms: `cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `getContas`. No request ever occurred.\n\nhttps://on.cypress.io/wait\n    at cypressErr (http://localhost:8002/__cypress/runner/cypress_runner.js:76065:18)\n    at Object.errByPath (http://localhost:8002/__cypress/runner/cypress_runner.js:76119:10)\n    at checkForXhr (http://localhost:8002/__cypress/runner/cypress_runner.js:135342:84)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:135368:28)\n    at tryCatcher (http://localhost:8002/__cypress/runner/cypress_runner.js:1830:23)\n    at Promise.attempt.Promise.try (http://localhost:8002/__cypress/runner/cypress_runner.js:4338:29)\n    at whenStable (http://localhost:8002/__cypress/runner/cypress_runner.js:143744:68)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:143685:14)\n    at tryCatcher (http://localhost:8002/__cypress/runner/cypress_runner.js:1830:23)\n    at Promise._settlePromiseFromHandler (http://localhost:8002/__cypress/runner/cypress_runner.js:1542:31)\n    at Promise._settlePromise (http://localhost:8002/__cypress/runner/cypress_runner.js:1599:18)\n    at Promise._settlePromise0 (http://localhost:8002/__cypress/runner/cypress_runner.js:1644:10)\n    at Promise._settlePromises (http://localhost:8002/__cypress/runner/cypress_runner.js:1724:18)\n    at Promise._fulfill (http://localhost:8002/__cypress/runner/cypress_runner.js:1668:18)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:5473:46)\nFrom Your Spec Code:\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/bancos_asaas.cy.js:12:7)",
                "diff": null
              },
              "uuid": "d35f20b6-ae46-43d2-ae5c-e507a3c52db4",
              "parentUUID": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Lista clientes e gera link de pagamento Asaas",
              "fullTitle": "Financeiro → Bancos: Aba Asaas e dropdowns Lista clientes e gera link de pagamento Asaas",
              "timedOut": null,
              "duration": 4555,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/addons/asaas/customers*', {\n  statusCode: 200,\n  body: {\n    data: [{\n      id: 'cus_1',\n      name: 'Cliente Teste'\n    }]\n  }\n}).as('getCustomers');\ncy.intercept('GET', '/api/addons/asaas/payments', {\n  statusCode: 200,\n  body: {\n    data: [{\n      id: 'pay_1',\n      status: 'CONFIRMED'\n    }]\n  }\n}).as('getPayments');\ncy.intercept('POST', '/api/addons/asaas/payment-links', {\n  statusCode: 200,\n  body: {\n    data: {\n      link_url: 'https://pay.asaas.com/link/abc',\n      status: 'ACTIVE',\n      asaas_payment_id: 'pl_123'\n    }\n  }\n}).as('postLink');\ncy.visit('/financeiro/bancos?tab=asaas');\ncy.get('#asaasSearchCustomer').type('Teste');\ncy.get('#asaasBtnListCustomers').click();\ncy.wait('@getCustomers');\ncy.get('#asaasResults').should('contain.text', 'Cliente Teste');\ncy.get('#asaasBtnListPayments').click();\ncy.wait('@getPayments');\ncy.get('#asaasResults').should('contain.text', 'CONFIRMED');\ncy.get('#asaasSaleId').type('SO-2025-0001');\ncy.get('#asaasClientId').type('10');\ncy.get('#asaasAmountCents').type('9900');\ncy.get('#asaasDueDate').type('2025-12-31');\ncy.get('#asaasBillingType').select('PIX');\ncy.get('#asaasBtnGenLink').click();\ncy.wait('@postLink');\ncy.get('#asaasGenMsg').should('contain.text', 'Link criado');\ncy.get('#asaasGenResult').should('contain.text', 'https://pay.asaas.com/link/abc');\ncy.get('#asaasStatsLinks').should('contain.text', '1');",
              "err": {
                "message": "AssertionError: Timed out retrying after 4000ms: Expected to find element: `#asaasSearchCustomer`, but never found it.",
                "estack": "AssertionError: Timed out retrying after 4000ms: Expected to find element: `#asaasSearchCustomer`, but never found it.\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/bancos_asaas.cy.js:30:7)",
                "diff": null
              },
              "uuid": "2c3a17c1-a2d3-4a8e-908b-a1aa39296f82",
              "parentUUID": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Dropdown de Conta destino em Pagar.me e Itaú é populado",
              "fullTitle": "Financeiro → Bancos: Aba Asaas e dropdowns Dropdown de Conta destino em Pagar.me e Itaú é populado",
              "timedOut": null,
              "duration": 5544,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/financeiro/bancos/contas*', {\n  statusCode: 200,\n  body: {\n    data: [{\n      id: 10,\n      banco: 'Itaú',\n      agencia: '1234',\n      conta: '000111-2',\n      status: 'ativa'\n    }, {\n      id: 11,\n      banco: 'Santander',\n      agencia: '4321',\n      conta: '999888-7',\n      status: 'ativa'\n    }]\n  }\n}).as('getContas2');\ncy.intercept('GET', '/api/payments/settings/pagarme', {\n  statusCode: 200,\n  body: {\n    has_webhook_secret: false\n  }\n}).as('getPg');\ncy.intercept('GET', '/api/payments/settings/itau', {\n  statusCode: 200,\n  body: {\n    has_webhook_secret: false\n  }\n}).as('getItau');\ncy.visit('/financeiro/bancos?tab=pagarme');\ncy.wait('@getContas2');\ncy.wait('@getPg');\ncy.get('#pgTargetAccountId').should('exist');\ncy.get('#pgTargetAccountId').find('option').should('have.length.at.least', 2);\ncy.visit('/financeiro/bancos?tab=itau');\ncy.wait('@getItau');\ncy.get('#itauTargetAccountId').should('exist');\ncy.get('#itauTargetAccountId').find('option').should('have.length.at.least', 2);",
              "err": {
                "message": "CypressError: Timed out retrying after 5000ms: `cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `getContas2`. No request ever occurred.\n\nhttps://on.cypress.io/wait",
                "estack": "CypressError: Timed out retrying after 5000ms: `cy.wait()` timed out waiting `5000ms` for the 1st request to the route: `getContas2`. No request ever occurred.\n\nhttps://on.cypress.io/wait\n    at cypressErr (http://localhost:8002/__cypress/runner/cypress_runner.js:76065:18)\n    at Object.errByPath (http://localhost:8002/__cypress/runner/cypress_runner.js:76119:10)\n    at checkForXhr (http://localhost:8002/__cypress/runner/cypress_runner.js:135342:84)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:135368:28)\n    at tryCatcher (http://localhost:8002/__cypress/runner/cypress_runner.js:1830:23)\n    at Promise.attempt.Promise.try (http://localhost:8002/__cypress/runner/cypress_runner.js:4338:29)\n    at whenStable (http://localhost:8002/__cypress/runner/cypress_runner.js:143744:68)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:143685:14)\n    at tryCatcher (http://localhost:8002/__cypress/runner/cypress_runner.js:1830:23)\n    at Promise._settlePromiseFromHandler (http://localhost:8002/__cypress/runner/cypress_runner.js:1542:31)\n    at Promise._settlePromise (http://localhost:8002/__cypress/runner/cypress_runner.js:1599:18)\n    at Promise._settlePromise0 (http://localhost:8002/__cypress/runner/cypress_runner.js:1644:10)\n    at Promise._settlePromises (http://localhost:8002/__cypress/runner/cypress_runner.js:1724:18)\n    at Promise._fulfill (http://localhost:8002/__cypress/runner/cypress_runner.js:1668:18)\n    at <unknown> (http://localhost:8002/__cypress/runner/cypress_runner.js:5473:46)\nFrom Your Spec Code:\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/bancos_asaas.cy.js:60:7)",
                "diff": null
              },
              "uuid": "a6ff5f39-f5f4-40bf-8f20-a7b1303bd633",
              "parentUUID": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Copia endpoints de Pagar.me e Itaú",
              "fullTitle": "Financeiro → Bancos: Aba Asaas e dropdowns Copia endpoints de Pagar.me e Itaú",
              "timedOut": null,
              "duration": 646,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.visit('/financeiro/bancos?tab=pagarme');\ncy.window().then(win => {\n  win.navigator.clipboard = {\n    writeText: () => Promise.resolve()\n  };\n  cy.stub(win, 'alert').as('alert');\n});\ncy.get('#pgEndpoint').invoke('text').then(txt => {\n  expect(txt).to.include('/api/payments/webhooks/pagarme');\n});\ncy.get('#btnCopyPg').click();\ncy.get('@alert').should('have.been.calledWith', 'Endpoint copiado');\ncy.visit('/financeiro/bancos?tab=itau');\ncy.window().then(win => {\n  win.navigator.clipboard = {\n    writeText: () => Promise.resolve()\n  };\n  cy.stub(win, 'alert').as('alert2');\n});\ncy.get('#itauEndpoint').invoke('text').then(txt => {\n  expect(txt).to.include('/api/payments/webhooks/itau');\n});\ncy.get('#btnCopyItau').click();\ncy.get('@alert2').should('have.been.calledWith', 'Endpoint copiado');",
              "err": {
                "message": "TypeError: Cannot set property clipboard of [object Navigator] which has only a getter",
                "estack": "TypeError: Cannot set property clipboard of [object Navigator] which has only a getter\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/bancos_asaas.cy.js:73:29)",
                "diff": null
              },
              "uuid": "cd46bd32-fb04-4a78-9535-895f9b330775",
              "parentUUID": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Simula webhooks Pagar.me e Itaú",
              "fullTitle": "Financeiro → Bancos: Aba Asaas e dropdowns Simula webhooks Pagar.me e Itaú",
              "timedOut": null,
              "duration": 898,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "// Pagar.me\ncy.visit('/financeiro/bancos?tab=pagarme');\nconst pgPayload = {\n  id: 'ev_test_pg',\n  type: 'transaction.paid',\n  data: {\n    object: {\n      amount: 1000,\n      status: 'paid'\n    }\n  }\n};\ncy.intercept('POST', '/api/payments/webhooks/pagarme', req => {\n  expect(req.headers['content-type']).to.include('application/json');\n  expect(req.body).to.have.property('type');\n  req.reply({\n    statusCode: 200,\n    body: {\n      ok: true\n    }\n  });\n}).as('pgWebhook');\ncy.window().then(win => win.fetch('/api/payments/webhooks/pagarme', {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify(pgPayload)\n}));\ncy.wait('@pgWebhook');\n// Itaú\ncy.visit('/financeiro/bancos?tab=itau');\nconst itauPayload = {\n  event: 'pix.received',\n  value: '10.00',\n  e2eId: 'ABC123'\n};\ncy.intercept('POST', '/api/payments/webhooks/itau', req => {\n  expect(req.headers['content-type']).to.include('application/json');\n  expect(req.body).to.have.property('event');\n  req.reply({\n    statusCode: 200,\n    body: {\n      ok: true\n    }\n  });\n}).as('itauWebhook');\ncy.window().then(win => win.fetch('/api/payments/webhooks/itau', {\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json'\n  },\n  body: JSON.stringify(itauPayload)\n}));\ncy.wait('@itauWebhook');",
              "err": {},
              "uuid": "34a3fa6e-1adf-4a1a-8889-17427fb6b3f5",
              "parentUUID": "c089b5e2-ce2b-4df9-a542-00dd55a83255",
              "isHook": false,
              "skipped": false
            }
          ],
          "suites": [],
          "passes": [
            "34a3fa6e-1adf-4a1a-8889-17427fb6b3f5"
          ],
          "failures": [
            "d35f20b6-ae46-43d2-ae5c-e507a3c52db4",
            "2c3a17c1-a2d3-4a8e-908b-a1aa39296f82",
            "a6ff5f39-f5f4-40bf-8f20-a7b1303bd633",
            "cd46bd32-fb04-4a78-9535-895f9b330775"
          ],
          "pending": [],
          "skipped": [],
          "duration": 17441,
          "root": false,
          "rootEmpty": false,
          "_timeout": 2000
        }
      ],
      "passes": [],
      "failures": [],
      "pending": [],
      "skipped": [],
      "duration": 0,
      "root": true,
      "rootEmpty": true,
      "_timeout": 2000
    }
  ],
  "meta": {
    "mocha": {
      "version": "7.0.1"
    },
    "mochawesome": {
      "options": {
        "quiet": true,
        "reportFilename": "mochawesome",
        "saveHtml": true,
        "saveJson": true,
        "consoleReporter": "spec",
        "useInlineDiffs": false,
        "code": true
      },
      "version": "7.1.4"
    },
    "marge": {
      "options": {
        "id": "default",
        "reportDir": "cypress/reports/mochawesome",
        "overwrite": false,
        "html": true,
        "json": true,
        "quiet": true
      },
      "version": "6.3.2"
    }
  }
}