joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.78k stars 3.65k forks source link

[5.1] Newsfeed error #42514

Open brianteeman opened 11 months ago

brianteeman commented 11 months ago

Steps to reproduce the issue

Run the e2e cypress test for com_newsfeed in the frontend

Expected result

Tests pass without error

Actual result

Tests pass with error Obviously that shouldnt happen.

Warning: Attempt to read property "id" on null in C:\laragon\www\j5\components\com_newsfeeds\src\View\Newsfeed\HtmlView.php on line 264

System information (as much as possible)

php 8.1.3 joomla 5.1 branch

Additional comments

image

Hackwar commented 2 days ago

Is this still happening?

brianteeman commented 2 days ago

its been a year and no one was interested.

brianteeman commented 2 days ago

The problem still exists - the problem is with the test data https://github.com/joomla/joomla-cms/blob/5.2-dev/tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js#L4

brianteeman commented 2 days ago

The stack trace is different now

Image

Hackwar commented 2 days ago

Can you post the URL that is throwing that error? When replicating the steps of the test code by hand, I can't replicate this...

brianteeman commented 2 days ago

PS D:\repos\j51> npx cypress run --spec .\tests\System\integration\site\components\com_newsfeed\NewsFeed.cy.js

DevTools listening on ws://127.0.0.1:64567/devtools/browser/7f0618aa-5ec3-484c-ae9a-ca7fe1c8a381

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        13.16.0                                                                        │
  │ Browser:        Electron 118 (headless)                                                        │
  │ Node Version:   v21.6.1 (C:\Program Files\nodejs\node.exe)                                     │
  │ Specs:          1 found (NewsFeed.cy.js)                                                       │
  │ Searched:       D:\repos\j51\tests\System\integration\site\components\com_newsfeed\NewsFeed.cy │
  │                 .js                                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  NewsFeed.cy.js                                                                  (1 of 1)

  Test in frontend that the newsfeeds details view
    √ can display a feed in a menu item from joomla.org (712ms)
    1) can display a feed without a menu item from joomla.org

  1 passing (1s)
  1 failing

  1) Test in frontend that the newsfeeds details view
       can display a feed without a menu item from joomla.org:
     CypressError: `cy.visit()` failed trying to load:

https://j51.test/index.php?option=com_newsfeeds&view=newsfeed&id=51

The response we received from your web server was:

  > 500: Internal Server Error

This was considered a failure because the status code was not `2xx`.

This http request was redirected '1' time to:

  - 301: https://j51.test/index.php/component/newsfeeds/newsfeed/test-feed

If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
      at <unknown> (https://j51.test/__cypress/runner/cypress_runner.js:131461:76)
      at visitFailedByErr (https://j51.test/__cypress/runner/cypress_runner.js:130876:12)
      at <unknown> (https://j51.test/__cypress/runner/cypress_runner.js:131444:13)
      at tryCatcher (https://j51.test/__cypress/runner/cypress_runner.js:1830:23)
      at Promise._settlePromiseFromHandler (https://j51.test/__cypress/runner/cypress_runner.js:1542:31)
      at Promise._settlePromise (https://j51.test/__cypress/runner/cypress_runner.js:1599:18)
      at Promise._settlePromise0 (https://j51.test/__cypress/runner/cypress_runner.js:1644:10)
      at Promise._settlePromises (https://j51.test/__cypress/runner/cypress_runner.js:1720:18)
      at _drainQueueStep (https://j51.test/__cypress/runner/cypress_runner.js:2430:12)
      at _drainQueue (https://j51.test/__cypress/runner/cypress_runner.js:2423:9)
      at Async._drainQueues (https://j51.test/__cypress/runner/cypress_runner.js:2439:5)
      at Async.drainQueues (https://j51.test/__cypress/runner/cypress_runner.js:2309:14)
  From Your Spec Code:
      at Context.eval (webpack://joomla/./tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js:19:13)

  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      1                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  1                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     1 second                                                                         │
  │ Spec Ran:     NewsFeed.cy.js                                                                   │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

  (Screenshots)

  -  D:\repos\j51\tests\System\output\screenshots\NewsFeed.cy.js\Test in frontend tha     (1280x720)
     t the newsfeeds details view -- can display a feed without a menu item from joom
     la.org (failed).png

====================================================================================================

  (Run Finished)

       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ×  NewsFeed.cy.js                           00:01        2        1        1        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ×  1 of 1 failed (100%)                     00:01        2        1        1        -        -
alikon commented 2 days ago

unable to replicate Image

brianteeman commented 2 days ago

Maybe its a windows thing?

alikon commented 2 days ago

i'm running on windows+laragon

brianteeman commented 2 days ago

i'm running on windows+laragon

me too