Skip to content

Conversation

@rajputanuj31
Copy link
Contributor

add a test for Categories wise view of contacts in com_contact.

@laoneo
Copy link
Member

laoneo commented Mar 23, 2023

Did you forget to commit the come in the db.js file? Also rename the function to db_createCategory as it creates only one category.

@rajputanuj31
Copy link
Contributor Author

Did you forget to commit the come in the db.js file? Also rename the function to db_createCategory as it creates only one category.

Sorry My bad.

@laoneo
Copy link
Member

laoneo commented Mar 23, 2023

There are also some code style issues.

@laoneo
Copy link
Member

laoneo commented Mar 23, 2023

The code to open the page must also be in a then statement, otherwise you can run into async issues, so something liek this should work (didn't test it actually and there are cs issues):

describe('Test that the Catagories of com_contact ', () => {
  it('can display a list of categories of contacts in menu item', () => {
    cy.db_createCategory({ title: 'automated test category 1', extension: 'com_contact' })
      .then((id) => cy.db_createContact({ name: 'automated test contact 1', catid: id }))
      .then() => cy.db_createCategory({ title: 'automated test category 2', extension: 'com_contact' })
      .then((id) => {
      cy.db_createContact({ name: 'automated test contact 2', catid: id });
      cy.db_createContact({ name: 'automated test contact 3', catid: id });
    }). then(() => {
    cy.visit('index.php?option=com_contact&view=categories&id=0');
    cy.contains('automated test category 1');
    cy.contains('automated test category 2');
    cy.get(':nth-child(2) > .page-header > .badge').contains('Contact Count: 1');
    cy.get(':nth-child(3) > .page-header > .badge').contains('Contact Count: 2');
});
  });
});

@laoneo laoneo enabled auto-merge (squash) March 23, 2023 16:47
@laoneo laoneo disabled auto-merge March 23, 2023 16:48
@laoneo
Copy link
Member

laoneo commented Mar 23, 2023

The test fails because you need to add some more default values to the db_createCategory function

@rajputanuj31
Copy link
Contributor Author

The test fails because you need to add some more default values to the db_createCategory function

Added more default values but don't know why still checks are failing?

@laoneo
Copy link
Member

laoneo commented Mar 23, 2023

Restartet drone, probably a server issue

@laoneo laoneo enabled auto-merge (squash) March 23, 2023 18:26
auto-merge was automatically disabled March 23, 2023 18:48

Head branch was pushed to by a user without write access

@laoneo laoneo enabled auto-merge (squash) March 23, 2023 19:10
@laoneo laoneo added this to the Joomla! 4.4.0 milestone Mar 23, 2023
@laoneo laoneo disabled auto-merge March 24, 2023 07:10
@laoneo laoneo self-assigned this Mar 28, 2023
@laoneo laoneo merged commit 7e84e7c into joomla:4.4-dev Mar 28, 2023
@laoneo
Copy link
Member

laoneo commented Mar 28, 2023

Thanks!

@rajputanuj31
Copy link
Contributor Author

Thanks a lot for merging it.

@rajputanuj31 rajputanuj31 deleted the Cypress-5 branch April 4, 2023 06:13
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