{
  "stats": {
    "suites": 1,
    "tests": 3,
    "passes": 2,
    "pending": 0,
    "failures": 1,
    "start": "2025-11-08T09:28:51.508Z",
    "end": "2025-11-08T09:29:00.702Z",
    "duration": 9194,
    "testsRegistered": 3,
    "passPercent": 66.66666666666666,
    "pendingPercent": 0,
    "other": 0,
    "hasOther": false,
    "skipped": 0,
    "hasSkipped": false
  },
  "results": [
    {
      "uuid": "57408ecf-81ad-4ed9-89d5-8eb24415bad7",
      "title": "",
      "fullFile": "cypress\\e2e\\relatorios_compras_abc.cy.js",
      "file": "cypress\\e2e\\relatorios_compras_abc.cy.js",
      "beforeHooks": [],
      "afterHooks": [],
      "tests": [],
      "suites": [
        {
          "uuid": "28164779-2a70-4942-84c4-fac5584685b3",
          "title": "Relatórios de Compras - Curva ABC",
          "fullFile": "",
          "file": "",
          "beforeHooks": [],
          "afterHooks": [],
          "tests": [
            {
              "title": "Carrega a página e exibe controles e tabela ABC",
              "fullTitle": "Relatórios de Compras - Curva ABC Carrega a página e exibe controles e tabela ABC",
              "timedOut": null,
              "duration": 3372,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/compras/relatorios/por-fornecedor*', stubFornecedor).as('forn');\ncy.intercept('GET', '/api/compras/relatorios/ordens-por-status*', stubStatus).as('status');\ncy.intercept('GET', '/api/compras/relatorios/itens-top*', stubItensTop).as('top');\ncy.intercept('GET', '**/api/compras/relatorios/abc*', stubAbcItems).as('abc');\ncy.visit(pageUrl);\ncy.wait('@forn', {\n  timeout: 10000\n});\ncy.wait('@status', {\n  timeout: 10000\n});\ncy.wait('@top', {\n  timeout: 10000\n});\ncy.wait('@abc', {\n  timeout: 10000\n});\ncy.get('#f-start').should('exist');\ncy.get('#f-end').should('exist');\ncy.get('#f-limit').should('exist');\ncy.get('#btn-aplicar').should('exist');\ncy.get('#abc-metric').should('exist');\ncy.get('#abc-a-pct').should('exist').and('have.value', '80');\ncy.get('#abc-b-pct').should('exist').and('have.value', '15');\ncy.get('#abc-c-pct').should('exist').and('have.value', '5');\ncy.get('#abc-threshold-label').should('contain.text', 'A=80%').and('contain.text', 'B=15%').and('contain.text', 'C=5%');\ncy.get('#tbl-abc tbody tr').should('have.length.greaterThan', 0);\ncy.get('#tbl-abc tbody tr').first().contains('Cabo HDMI');",
              "err": {},
              "uuid": "41625a3f-b2c9-4cf5-9a48-14e422e454d5",
              "parentUUID": "28164779-2a70-4942-84c4-fac5584685b3",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Recalcula ABC ao alterar thresholds e envia na API",
              "fullTitle": "Relatórios de Compras - Curva ABC Recalcula ABC ao alterar thresholds e envia na API",
              "timedOut": null,
              "duration": 3109,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/compras/relatorios/por-fornecedor*', stubFornecedor).as('forn');\ncy.intercept('GET', '/api/compras/relatorios/ordens-por-status*', stubStatus).as('status');\ncy.intercept('GET', '/api/compras/relatorios/itens-top*', stubItensTop).as('top');\ncy.intercept('GET', '**/api/compras/relatorios/abc*', stubAbcItems).as('abc');\ncy.visit(pageUrl);\ncy.wait('@forn', {\n  timeout: 10000\n});\ncy.wait('@status', {\n  timeout: 10000\n});\ncy.wait('@top', {\n  timeout: 10000\n});\ncy.wait('@abc');\ncy.get('#abc-a-pct').clear().type('90').blur();\ncy.get('#abc-b-pct').clear().type('5').blur();\ncy.get('#abc-c-pct').clear().type('5').blur();\ncy.get('#btn-aplicar', {\n  timeout: 10000\n}).click();\ncy.wait('@abc', {\n  timeout: 10000\n}).then(interception => {\n  const url = interception.request.url;\n  expect(url).to.include('a_pct=0.9');\n  expect(url).to.include('b_pct=0.05');\n});\ncy.get('#abc-threshold-label').should('contain.text', 'A=90%').and('contain.text', 'B=5%').and('contain.text', 'C=5%');",
              "err": {
                "message": "AssertionError: expected 'http://localhost:8001/api/compras/relatorios/abc?metric=valor&start=09-10-2025&end=07-11-2025&limit=20&a_pct=0.8181818181818181&b_pct=0.13636363636363635' to include 'a_pct=0.9'",
                "estack": "AssertionError: expected 'http://localhost:8001/api/compras/relatorios/abc?metric=valor&start=09-10-2025&end=07-11-2025&limit=20&a_pct=0.8181818181818181&b_pct=0.13636363636363635' to include 'a_pct=0.9'\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/relatorios_compras_abc.cy.js:57:21)",
                "diff": null
              },
              "uuid": "12c68efc-bf94-4def-8c11-ea7917a2c1f6",
              "parentUUID": "28164779-2a70-4942-84c4-fac5584685b3",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "Exporta CSV e PDF da ABC sem alertas",
              "fullTitle": "Relatórios de Compras - Curva ABC Exporta CSV e PDF da ABC sem alertas",
              "timedOut": null,
              "duration": 2424,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.intercept('GET', '/api/compras/relatorios/por-fornecedor*', stubFornecedor).as('forn');\ncy.intercept('GET', '/api/compras/relatorios/ordens-por-status*', stubStatus).as('status');\ncy.intercept('GET', '/api/compras/relatorios/itens-top*', stubItensTop).as('top');\ncy.intercept('GET', '**/api/compras/relatorios/abc*', stubAbcItems).as('abc');\ncy.visit(pageUrl);\ncy.wait('@forn', {\n  timeout: 10000\n});\ncy.wait('@status', {\n  timeout: 10000\n});\ncy.wait('@top', {\n  timeout: 10000\n});\ncy.wait('@abc', {\n  timeout: 10000\n});\ncy.window().then(win => {\n  cy.stub(win.URL, 'createObjectURL').callsFake(() => 'blob:stub');\n  const openStub = cy.stub(win, 'open').callsFake(() => ({\n    document: {\n      write() {},\n      close() {}\n    },\n    focus() {},\n    print() {}\n  }));\n  cy.get('#btn-export-abc-csv').click();\n  cy.wrap(win.URL.createObjectURL).should('have.been.called');\n  cy.get('#btn-export-abc-pdf').click();\n  cy.wrap(openStub).should('have.been.called');\n});",
              "err": {},
              "uuid": "dfbdbc09-741c-4efa-8692-ab6ea1b8c7df",
              "parentUUID": "28164779-2a70-4942-84c4-fac5584685b3",
              "isHook": false,
              "skipped": false
            }
          ],
          "suites": [],
          "passes": [
            "41625a3f-b2c9-4cf5-9a48-14e422e454d5",
            "dfbdbc09-741c-4efa-8692-ab6ea1b8c7df"
          ],
          "failures": [
            "12c68efc-bf94-4def-8c11-ea7917a2c1f6"
          ],
          "pending": [],
          "skipped": [],
          "duration": 8905,
          "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"
    }
  }
}