Mejora de rendimiento

A Good Way To Automatically Test Our Apps

By Luciano Graziani, SSR Developer at Flowics

💜

What am I going to speak about today?

  • What is Cypress?
  • In which state is Flowics without Cypress?
  • What can we do right now with Cypress?
  • What are the immediate benefits?

💜

What is Cypress?

  • Is an end-to-end testing framework focused on having a solid collection of tests.
     
  • Easy & simple to use API (Abstract Public Interface) to dictate each action the automation bot needs to do.
     
  • Easy & simple to use API to validate each action and its result.

💜

What is Cypress?

💜

What is Cypress?

describe('graphics spec', () => {
  it('graphics can do initial publish', () => {
    const vizId = '5f9ad217583c1fb5ab0eb00f';

    cy.visit(`/visualizations/${expId}/${vizId}/edit`);

    cy.get('[data-cy=publishBtn]').click();
    cy.get('[data-cy=firstChangesToPublishModal]').should('exist');
    cy.get('[data-cy=confirmPublishBtn]').click();
    cy.get('[data-cy=noChangesModal]').should('exist');
  });
  it('graphics can re-publish', () => {
    const vizId = '5f9ad16a427139c9235104c0';

    cy.visit(`/visualizations/${expId}/${vizId}/edit`);

    cy.get('[data-cy=publishBtn]').click();
    cy.get('[data-cy=newChangesToPublishModal]').should('exist');
    cy.get('[data-cy=confirmRePublishBtn]').click();
    cy.get('[data-cy=noChangesModal]').should('exist');
  });
});

💜

In which state is Flowics without Cypress?

  • We are pushing code into production without any throughout validation.
     
  • For the complex solutions, we do manual testing and also we tend to ask for help for that.
     
  • In the last two months, we had like 4 ~6 bad situations that could have been prevented if we used an automation tool like Cypress.
     
  • Refactoring is hard because we don't know if the new code works or not.

💜

What can we do right now with Cypress?

  • We can use it locally (dev's computer) to make sure that our changes doesn't break the happy paths.

  • We can add more tests around those happy paths, to make our changes are more stable.

  • And for every new thing we add, we can write a test for it, so it's already test-oriented.

💜

What are the immediate benefits?

  • The most important benefit of all is that we can be sure that if those tests passes, we know that at least the user's happy path is safe.
     
  • We can avoid a lot of manual and repetitive testing hence reducing the time spent on ensuring that our changes are safe.
     
  • We can introduce teammates to new parts of ours services without a lot of friction, knowing they have a safe net.

💜

Thank you for listening!

Made with Slides.com