29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-05-28 16:01:28 +00:00
cms/tests/System/integration/site/components/com_content/Category.cy.js
Allon Moritz 7611824c5c
Move API system tests to cypress (#40135)
* tests

* api

* artiucles crud

* banners

* contact

* media

* media

* Remove codeception

* cs

* more traces of codeception

* readd certs

* dependencies

* more deps

* secret

* cs

* better doc

* write

* config workaround

* cs

* revert

* prepare db for api tests

* variable

* revert pool

* end connections

* no limit

* cs

* prefix

* Update tests/cypress/drone-system-run.sh

* run specific specs in drone

* Update tests/README.md

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update tests/cypress/integration/api/com_media/Files.cy.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* Update tests/cypress/integration/api/com_media/Files.cy.js

Co-authored-by: Brian Teeman <brian@teeman.net>

* postgres

* media on postgres

* sign

* cs

* remove more traces

* basic api tests

* cleanup

* path

* run recursive specs

* chmod images folder

* path to cms

* correct dependencies and better cleanup

* cleaner deps

* Update tests/cypress/drone-system-run.sh

Co-authored-by: Brian Teeman <brian@teeman.net>

* missing fields

* stabilize cleanup

* cs

* secret in install test

* order of tests

* optimize cleanup

* cs

* cache the connection

* revert connection cache

* docs

* Rename cypress to system

* lint

* simplification and docs

* docs

* better cleanup

* move

* merge conflict

* remove redundant connect

---------

Co-authored-by: Brian Teeman <brian@teeman.net>
2023-03-20 09:51:42 +01:00

49 lines
2.0 KiB
JavaScript

describe('Test that the list view ', () => {
['default', 'blog'].forEach((layout) => {
it(`can display a list of articles in the ${layout} layout in a menu item`, () => {
cy.db_createArticle({ title: 'article 1' })
.then(() => cy.db_createArticle({ title: 'article 2' }))
.then(() => cy.db_createArticle({ title: 'article 3' }))
.then(() => cy.db_createArticle({ title: 'article 4' }))
.then(() => cy.db_createMenuItem({ title: 'automated test', link: `index.php?option=com_content&view=category&id=2&layout=${layout}` }))
.then(() => {
cy.visit('/');
cy.get('a:contains(automated test)').click();
cy.contains('article 1');
cy.contains('article 2');
cy.contains('article 3');
cy.contains('article 4');
});
});
it(`can display a list of articles in the ${layout} layout without a menu item`, () => {
cy.db_createArticle({ title: 'article 1' })
.then(() => cy.db_createArticle({ title: 'article 2' }))
.then(() => cy.db_createArticle({ title: 'article 3' }))
.then(() => cy.db_createArticle({ title: 'article 4' }))
.then(() => {
cy.visit(`/index.php?option=com_content&view=category&id=2&layout=${layout}`);
cy.contains('article 1');
cy.contains('article 2');
cy.contains('article 3');
cy.contains('article 4');
});
});
});
it('can open the article form in the default layout', () => {
cy.db_createArticle({ title: 'article 1' })
.then(() => cy.db_createMenuItem({ title: 'automated test', link: 'index.php?option=com_content&view=category&id=2&layout=default' }))
.then(() => {
cy.doFrontendLogin(Cypress.env('username'), Cypress.env('password'));
cy.visit('/');
cy.get('a:contains(automated test)').click();
cy.get('a:contains(New Article)').click();
cy.get('#adminForm').should('exist');
});
});
});