{
  "stats": {
    "suites": 1,
    "tests": 5,
    "passes": 2,
    "pending": 0,
    "failures": 3,
    "start": "2025-11-10T08:19:03.013Z",
    "end": "2025-11-10T08:20:19.756Z",
    "duration": 76743,
    "testsRegistered": 5,
    "passPercent": 40,
    "pendingPercent": 0,
    "other": 0,
    "hasOther": false,
    "skipped": 0,
    "hasSkipped": false
  },
  "results": [
    {
      "uuid": "0faf92f0-93dd-421d-9b81-ab19c697f026",
      "title": "",
      "fullFile": "cypress\\e2e\\auth\\login.cy.js",
      "file": "cypress\\e2e\\auth\\login.cy.js",
      "beforeHooks": [],
      "afterHooks": [],
      "tests": [],
      "suites": [
        {
          "uuid": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
          "title": "Login — fluxo completo",
          "fullFile": "",
          "file": "",
          "beforeHooks": [],
          "afterHooks": [],
          "tests": [
            {
              "title": "renderiza /login com elementos essenciais",
              "fullTitle": "Login — fluxo completo renderiza /login com elementos essenciais",
              "timedOut": null,
              "duration": 1618,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.contains('Sistema de gestão empresarial').should('be.visible');\ncy.get('#alert').should('not.be.visible');",
              "err": {},
              "uuid": "457ca8e9-8ff8-43e3-bfda-86f76e70371b",
              "parentUUID": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "exibe mensagem de erro quando há falha de rede",
              "fullTitle": "Login — fluxo completo exibe mensagem de erro quando há falha de rede",
              "timedOut": null,
              "duration": 5805,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "// Simular erro de conexão\ncy.intercept('POST', '/api/auth/login', {\n  forceNetworkError: true\n}).as('loginNetErr');\ncy.get('#email').type('user@example.com');\ncy.get('#password').type('senha-errada', {\n  log: false\n});\ncy.get('#loginBtn').click();\ncy.wait('@loginNetErr');\ncy.get('#alert').should('be.visible').and('contain.text', 'Erro de conexão');\n// Botão deve voltar ao estado normal\ncy.get('#loginBtn').should('not.be.disabled').and('contain.text', 'Entrar');",
              "err": {
                "message": "AssertionError: Timed out retrying after 4000ms: expected '<div#alert.alert.alert-error>' to be 'visible'\n\nThis element `<div#alert.alert.alert-error>` is not visible because it has CSS property: `display: none`",
                "estack": "AssertionError: Timed out retrying after 4000ms: expected '<div#alert.alert.alert-error>' to be 'visible'\n\nThis element `<div#alert.alert.alert-error>` is not visible because it has CSS property: `display: none`\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/auth/login.cy.js:32:21)",
                "diff": null
              },
              "uuid": "41c88ac8-8684-4edd-abd4-d49906bc7f1d",
              "parentUUID": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "exibe erro ao fazer login com credenciais inválidas (401)",
              "fullTitle": "Login — fluxo completo exibe erro ao fazer login com credenciais inválidas (401)",
              "timedOut": null,
              "duration": 5896,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "// Mockar resposta 401 do backend\ncy.intercept('POST', '/api/auth/login', {\n  statusCode: 401,\n  headers: {\n    'content-type': 'application/json'\n  },\n  body: {\n    error: 'Credenciais inválidas'\n  }\n}).as('login401');\ncy.get('#email').type('nao@existe.com');\ncy.get('#password').type('xxx', {\n  log: false\n});\ncy.get('#loginBtn').click();\ncy.wait('@login401').its('response.statusCode').should('eq', 401);\ncy.get('#alert').should('be.visible').and('contain.text', 'Credenciais inválidas');\n// Não deve haver token/cookie\ncy.getCookie('auth_token').should('not.exist');\ncy.window().then(win => {\n  expect(win.localStorage.getItem('auth_token')).to.be.null;\n});",
              "err": {
                "message": "AssertionError: Timed out retrying after 4000ms: expected '<div#alert.alert.alert-error>' to be 'visible'\n\nThis element `<div#alert.alert.alert-error>` is not visible because it has CSS property: `display: none`",
                "estack": "AssertionError: Timed out retrying after 4000ms: expected '<div#alert.alert.alert-error>' to be 'visible'\n\nThis element `<div#alert.alert.alert-error>` is not visible because it has CSS property: `display: none`\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/auth/login.cy.js:48:21)",
                "diff": null
              },
              "uuid": "ff7da85f-9aea-4487-8138-bf43e1a8ada6",
              "parentUUID": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "realiza login com sucesso quando backend responde 200 com access_token",
              "fullTitle": "Login — fluxo completo realiza login com sucesso quando backend responde 200 com access_token",
              "timedOut": null,
              "duration": 61416,
              "state": "failed",
              "speed": null,
              "pass": false,
              "fail": true,
              "pending": false,
              "context": null,
              "code": "// Mockar resposta 200 do backend\nconst fakeToken = 'ey.fake.jwt.token';\ncy.intercept('POST', '/api/auth/login', req => {\n  req.reply({\n    statusCode: 200,\n    headers: {\n      'content-type': 'application/json'\n    },\n    body: {\n      access_token: fakeToken,\n      refresh_token: 'refresh.token'\n    }\n  });\n}).as('login200');\ncy.get('#email').type('admin@local');\ncy.get('#password').type('admin123', {\n  log: false\n});\ncy.get('#loginBtn').click();\ncy.wait('@login200').its('response.statusCode').should('eq', 200);\n// Deve setar localStorage e cookie, e redirecionar para /dashboard\ncy.window().then(win => {\n  const lsToken = win.localStorage.getItem('auth_token');\n  expect(lsToken).to.eq(fakeToken);\n});\ncy.getCookie('auth_token').should('exist').then(c => {\n  expect(c.value).to.eq(fakeToken);\n});\n// A página tenta redirecionar. Validar pathname.\ncy.location('pathname', {\n  timeout: 10000\n}).should('eq', '/dashboard');",
              "err": {
                "message": "CypressError: Timed out after waiting `60000ms` for your remote page to load.\n\nYour page did not fire its `load` event within `60000ms`.\n\nYou can try increasing the `pageLoadTimeout` value in `cypress.config.js` to wait longer.\n\nBrowsers will not fire the `load` event until all stylesheets and scripts are done downloading.\n\nWhen this `load` event occurs, Cypress will continue running commands.",
                "estack": "CypressError: Timed out after waiting `60000ms` for your remote page to load.\n\nYour page did not fire its `load` event within `60000ms`.\n\nYou can try increasing the `pageLoadTimeout` value in `cypress.config.js` to wait longer.\n\nBrowsers will not fire the `load` event until all stylesheets and scripts are done downloading.\n\nWhen this `load` event occurs, Cypress will continue running commands.\n    at timedOutWaitingForPageLoad (http://localhost:8001/__cypress/runner/cypress_runner.js:130639:64)\n    at <unknown> (http://localhost:8001/__cypress/runner/cypress_runner.js:130955:16)\n    at tryCatcher (http://localhost:8001/__cypress/runner/cypress_runner.js:1830:23)\n    at <unknown> (http://localhost:8001/__cypress/runner/cypress_runner.js:4209:41)\n    at tryCatcher (http://localhost:8001/__cypress/runner/cypress_runner.js:1830:23)\n    at Promise._settlePromiseFromHandler (http://localhost:8001/__cypress/runner/cypress_runner.js:1542:31)\n    at Promise._settlePromise (http://localhost:8001/__cypress/runner/cypress_runner.js:1599:18)\n    at Promise._settlePromise0 (http://localhost:8001/__cypress/runner/cypress_runner.js:1644:10)\n    at Promise._settlePromises (http://localhost:8001/__cypress/runner/cypress_runner.js:1720:18)\n    at _drainQueueStep (http://localhost:8001/__cypress/runner/cypress_runner.js:2430:12)\n    at _drainQueue (http://localhost:8001/__cypress/runner/cypress_runner.js:2423:9)\n    at Async._drainQueues (http://localhost:8001/__cypress/runner/cypress_runner.js:2439:5)\n    at Async.drainQueues (http://localhost:8001/__cypress/runner/cypress_runner.js:2309:14)\nFrom Your Spec Code:\n    at Context.eval (webpack://gestoreasy-v3/./cypress/e2e/auth/login.cy.js:70:7)",
                "diff": null
              },
              "uuid": "4ab44cb5-846d-45d1-8a02-1af882dd9d58",
              "parentUUID": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
              "isHook": false,
              "skipped": false
            },
            {
              "title": "mantém usabilidade no campo senha (Enter foca o botão)",
              "fullTitle": "Login — fluxo completo mantém usabilidade no campo senha (Enter foca o botão)",
              "timedOut": null,
              "duration": 1283,
              "state": "passed",
              "speed": "fast",
              "pass": true,
              "fail": false,
              "pending": false,
              "context": null,
              "code": "cy.get('#password').type('1234{enter}');\ncy.focused().should('have.id', 'loginBtn');",
              "err": {},
              "uuid": "d28bc823-3db8-4709-9345-e93b158f96c8",
              "parentUUID": "d3bc5222-46db-404a-ae47-19b6d5f1e78b",
              "isHook": false,
              "skipped": false
            }
          ],
          "suites": [],
          "passes": [
            "457ca8e9-8ff8-43e3-bfda-86f76e70371b",
            "d28bc823-3db8-4709-9345-e93b158f96c8"
          ],
          "failures": [
            "41c88ac8-8684-4edd-abd4-d49906bc7f1d",
            "ff7da85f-9aea-4487-8138-bf43e1a8ada6",
            "4ab44cb5-846d-45d1-8a02-1af882dd9d58"
          ],
          "pending": [],
          "skipped": [],
          "duration": 76018,
          "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"
    }
  }
}