Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First delivery #3

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open

First delivery #3

wants to merge 81 commits into from

Conversation

Cicero-Henrique
Copy link

  • In this delivery, I made just the basic tests;
  • The tests are in a directory named tests;

Copy link
Owner

@wlsf82 wlsf82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Cicero-Henrique, parabéns pela primeira implementação. 👏🏻

Deixei comentários ao longo do seu código, os quais creio que lhe ajudarão a melhorar o design do mesmo.

Aguarde até o próximo encontro antes de implementar as mudanças.

.gitignore Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
backend/package-lock.json Outdated Show resolved Hide resolved
tests/cypress/support/commandsGui.js Outdated Show resolved Hide resolved
tests/cypress/support/e2e.js Outdated Show resolved Hide resolved
tests/cypress/support/e2e.js Outdated Show resolved Hide resolved
tests/package-lock.json Outdated Show resolved Hide resolved
tests/package.json Outdated Show resolved Hide resolved
@Cicero-Henrique
Copy link
Author

In this delivery:

  • Fixed the previous tests;
  • Add the advanced tests;
  • Add the ESLint to the project;

Copy link
Owner

@wlsf82 wlsf82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ótimo trabalho @Cicero-Henrique! 👏🏻

Deixei alguns comentários finais, os quais creio que lhe ajudarão a melhorar ainda mais o design dos seus testes.

Espero que tenha gostado na Test Design Masterclass.

env:
CI: true

- name: Install and run tests
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal criar uma estratégia para execução de diferentes testes em paralelo uns aos outros.

Exemplo, enquanto roda os testes de API em uma máquina, os teste de GUI poderiam estar rodando em outro, fornecendo feedback mais rápido.

npm test
continue-on-error: true # Action should continue in failure situations

- name: Upload Cypress screenshots
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -0,0 +1,135 @@
describe('Validate the API requests', () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal uma descrição melhor para a suíte de testes?

Algo como EngageShere - GET customers endpoint.

A propósito, recomendo pensar num melhor nome para o arquivo também.

Eu nomeria simplemente EngageSphere.cy.js, e visto que ele já está na pasta cypress/e2e/api/, é óbvio que são testes de API, e portanto, isso pode ser omitido do nome do arquivo.

method: 'GET',
url: CUSTOMERS_API_URL,
}).then(({ status }) => {
expect(status).to.equal(200);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal verificar também o que é retornado no body da resposta?

method: 'GET',
url: `${CUSTOMERS_API_URL}?page=2`,
}).then(({ status }) => {
expect(status).to.equal(200);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essa verificação só garante o sucesso da requisição, no entanto, não garante que os customers da página 2 foram retornados.

cy.get('[data-testid="size-filter"]').select('Medium');
cy.get('[data-testid="industry-filter"]').select('Retail');
cy.wait('@getCustomers');
cy.get('[aria-label="View company: Littel Co"]').click();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal algo mais simples, como o seguinte?

Suggested change
cy.get('[aria-label="View company: Littel Co"]').click();
cy.contains('button', 'View').click();

cy.contains('Hide address').click();
cy.contains('Show address').should('be.visible');
});
it('Apply a filter, go to a customer page, return to the list page, and check if the previous filters are selected', () => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal uma descrição mais curta, como a seguinte?

keeps the filters when coming back from the customer details view

context('Validate the messenger', () => {
it('Open and close the messenger', () => {
cy.get('[aria-label="Open messenger"]').should('be.visible').click();
cy.get('[aria-label="Close messenger"]').should('be.visible').click();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal verificar que o form é exibido antes de fechá-lo?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pois esse teste só verifica o botão, mais nada.

cy.get('[aria-label="Close messenger"]').click();
cy.get('[aria-label="Open messenger"]').should('be.visible').click();

// Check if the form is empty
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Check if the form is empty
// Check if the form fields are empty

Se for usar um comentário, torne-o o mais descritivo possível.

@@ -0,0 +1 @@
import 'cypress-axe';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import 'cypress-axe';
import 'cypress-axe';

Recomenda-se deixar uma linha em branco ao final de cada arquivo para que ferramentas como o GitHub não exibam o ícone de No newline at end of file.

Isso é uma boa prática e convenção a ser seguida.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants