Skip to content

[4.4] Cypress test for popular articles in mod_articles_popular#40189

Merged
laoneo merged 1 commit intojoomla:4.4-devfrom
sandewt:patch-8
Mar 25, 2023
Merged

[4.4] Cypress test for popular articles in mod_articles_popular#40189
laoneo merged 1 commit intojoomla:4.4-devfrom
sandewt:patch-8

Conversation

@sandewt
Copy link
Copy Markdown
Contributor

@sandewt sandewt commented Mar 25, 2023

Pull Request for Issue # .

Add mod_articles_popular system test.

@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

Result of the (local) Cypress test in browser

pr_40189

@brianteeman
Copy link
Copy Markdown
Contributor

Surely thats just testing if the module loads something and not that it loads something popular

@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

Surely thats just testing if the module loads something and not that it loads something popular

It would indeed be nicer to load, for example, the last five articles with one of them with the title of the test article.
The question is whether that is possible in a simple way.

I've tried that but haven't gotten it done yet.

@laoneo
Copy link
Copy Markdown
Member

laoneo commented Mar 25, 2023

For now this is ok, we can always add more tests in the future when we get more experience.

@laoneo laoneo merged commit 2adf119 into joomla:4.4-dev Mar 25, 2023
@laoneo laoneo added this to the Joomla! 4.4.0 milestone Mar 25, 2023
@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

This can be achieved very easily, without the automated test article

pr_40189-2

@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

@laoneo very easy to change

.then(() => cy.db_createModule({ module: 'mod_articles_popular', params: JSON.stringify({ catid: 2 }) }))
becomes
.then(() => cy.db_createModule({ module: 'mod_articles_popular }))

[EDIT I can make a new pr]

@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

Note; It would then be nice to use an if statement if there are no articles yet

@laoneo
Copy link
Copy Markdown
Member

laoneo commented Mar 25, 2023

Tests should not have conditions and you have to always assume the database is empty. So you have to setup tthe database in a way you want to test it.

@sandewt
Copy link
Copy Markdown
Contributor Author

sandewt commented Mar 25, 2023

Thanks

@sandewt sandewt deleted the patch-8 branch April 26, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants