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!

Copy of Cypress: a good way to automatically test our apps

By Luciano Graziani

Copy of Cypress: a good way to automatically test our apps

Flowics ๐Ÿ’œ Cypress, and so we want to show you how we use it to validate our changes, document our main user actions and solidify our CI processes.

  • 43