Skip to content

Commit

Permalink
Add Percy Page Screenshots (#3338)
Browse files Browse the repository at this point in the history
* Add Percy Page Screenshots

* Add missing space
  • Loading branch information
gabrieldutra authored and arikfr committed Jan 28, 2019
1 parent c31cb01 commit 37821ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 0 additions & 3 deletions cypress/integration/data-source/create_data_source_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ describe('Create Data Source', () => {
cy.getByTestId('Database Name').type('postgres{enter}');

cy.contains('Saved.');

cy.wait(1000);
cy.percySnapshot('Create Data Source page');
});
});
21 changes: 21 additions & 0 deletions cypress/integration/percy/page_screenshots.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const pages = [
{ name: 'Create Data Source - Types', url: '/data_sources/new' },
{ name: 'Edit Data Source - PostgreSQL', url: '/data_sources/1' },
{ name: 'Users', url: '/users' },
{ name: 'Groups', url: '/groups' },
{ name: 'Group', url: '/groups/1' },
{ name: 'Create Destination - Types', url: '/destinations/new' },
{ name: 'Organization Settings', url: '/settings/organization' },
{ name: 'User Profile', url: '/users/me' },
];

describe('Percy Page Screenshots', () => {
pages.forEach((page) => {
it(`takes a screenshot of ${page.name}`, () => {
cy.login();
cy.visit(page.url);
cy.wait(1000);
cy.percySnapshot(page.name);
});
});
});
2 changes: 1 addition & 1 deletion cypress/integration/query/create_query_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ describe('Create Query', () => {
cy.getByTestId('ExecuteButton').click();

cy.getByTestId('DynamicTable').should('exist');
cy.percySnapshot('Edit Query page');
cy.percySnapshot('Edit Query');
});
});
2 changes: 1 addition & 1 deletion cypress/integration/user/login_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('Login', () => {
cy.contains('h3', 'Login to Redash');

cy.wait(1000);
cy.percySnapshot('Login page');
cy.percySnapshot('Login');
});

it('shows message on failed login', () => {
Expand Down

0 comments on commit 37821ee

Please sign in to comment.