mirror of https://github.com/joomla/joomla-cms.git
Cypress test for featured com_contact. (#40154)
* cypress_test_for_com_contact * update_code_style * updates
This commit is contained in:
parent
cc123278e8
commit
d3ba9d5408
|
@ -0,0 +1,18 @@
|
|||
describe('Test that the front page', () => {
|
||||
it('can display featured contact', () => {
|
||||
cy.db_createContact({ name: 'automated test contact 1' })
|
||||
.then(() => cy.db_createContact({ name: 'automated test contact 2' }))
|
||||
.then(() => cy.db_createContact({ name: 'automated test contact 3' }))
|
||||
.then(() => cy.db_createContact({ name: 'automated test contact 4' }))
|
||||
.then(() => cy.db_createMenuItem({ title: 'automated test Contact', link: 'index.php?option=com_contact&view=featured', path: '?option=com_contact&view=featured' }))
|
||||
.then(() => {
|
||||
cy.visit('/');
|
||||
cy.get('a:contains(automated test Contact)').click();
|
||||
|
||||
cy.contains('automated test contact 1');
|
||||
cy.contains('automated test contact 2');
|
||||
cy.contains('automated test contact 3');
|
||||
cy.contains('automated test contact 4');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -80,6 +80,28 @@ Cypress.Commands.add('db_createUser', (user) => {
|
|||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add('db_createContact',(contact)=>{
|
||||
const defaultContactOptions = {
|
||||
name: 'test contact',
|
||||
alias: 'test-contact',
|
||||
catid:2,
|
||||
address: '',
|
||||
country: '',
|
||||
access: 1,
|
||||
language: '*',
|
||||
created: '2023-01-01 20:00:00',
|
||||
modified: '2023-01-01 20:00:00',
|
||||
metadesc: '',
|
||||
metadata: '',
|
||||
featured: 1,
|
||||
published: 1,
|
||||
params: ''
|
||||
};
|
||||
|
||||
return cy.task('queryDB', createInsertQuery('contact_details', { ...defaultContactOptions, ...contact })).then((info) => info.insertId);
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns an insert query for the given database and fields.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue