describe('Create Data Source', () => {
  beforeEach(() => {
    cy.login();
    cy.visit('/data_sources/new');
  });

  it('creates a new PostgreSQL data source', () => {
    cy.getByTestId('DatabaseSource').contains('PostgreSQL').click();

    cy.getByTestId('Name').type('Redash');
    cy.getByTestId('Host').type('{selectall}postgres');
    cy.getByTestId('User').type('postgres');
    cy.getByTestId('Password').type('postgres');
    cy.getByTestId('Database Name').type('postgres{enter}');

    cy.contains('Saved.');
    cy.percySnapshot('Create Data Source page');
  });
});

describe('Create Data Source', () => {
  beforeEach(() => {
    cy.login();
    cy.visit('/data_sources/new');
  });

  it('creates a new PostgreSQL data source', () => {
    cy.getByTestId('DatabaseSource').contains('PostgreSQL').click();

    cy.getByTestId('Name').type('Redash');
    cy.getByTestId('Host').type('{selectall}postgres');
    cy.getByTestId('User').type('postgres');
    cy.getByTestId('Password').type('postgres');
    cy.getByTestId('Database Name').type('postgres{enter}');

    cy.contains('Saved.');

    cy.wait(1000);
    cy.percySnapshot('Create Data Source page');
  });
});

add wait time before percy data source page snapshot (#3320)