forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add visual regression tests (mui#1121)
* Add visual regression tests * Make docs run in backgorund on ci for tests * Fix percy command not found error * Add cypress verify on install * Restory cypress binary cache before running * Add additional yarn install * Change order of builds * Fix tsconfig.json error * Add more visual regression scenarios * Update config.yml * Disable random icons in percy * Make year to be 2019 in tests * Add more scenarios * Completely hide Ads in percy
- Loading branch information
1 parent
705cd17
commit b797147
Showing
19 changed files
with
1,304 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import PropTypesDoc from '../../prop-types.json'; | ||
|
||
export const navItems = [ | ||
{ | ||
title: 'Getting Started', | ||
children: [ | ||
{ title: 'Installation', href: '/getting-started/installation' }, | ||
{ title: 'Usage', href: '/getting-started/usage' }, | ||
{ title: 'Parsing dates', href: '/getting-started/parsing' }, | ||
], | ||
}, | ||
{ | ||
title: 'Localization', | ||
children: [ | ||
{ title: 'Using date-fns', href: '/localization/date-fns' }, | ||
{ title: 'Using moment', href: '/localization/moment' }, | ||
{ title: 'Persian Calendar System', href: '/localization/persian' }, | ||
], | ||
}, | ||
{ | ||
title: 'Components Demo', | ||
children: [ | ||
{ title: 'Date Picker', href: '/demo/datepicker' }, | ||
{ title: 'Time Picker', href: '/demo/timepicker' }, | ||
{ title: 'Date & Time Picker', href: '/demo/datetime-picker' }, | ||
], | ||
}, | ||
{ | ||
title: 'Components API', | ||
children: Object.keys(PropTypesDoc) | ||
.filter(component => !['ModalWrapper'].includes(component)) | ||
.map(component => ({ | ||
title: component, | ||
as: `/api/${component}`, | ||
href: `/api/props?component=${component}`, | ||
})), | ||
}, | ||
{ | ||
title: 'Guides', | ||
children: [ | ||
{ title: 'Form integration', href: '/guides/form-integration' }, | ||
{ title: 'CSS overrides', href: '/guides/css-overrides' }, | ||
{ title: 'Global format customization', href: '/guides/formats' }, | ||
{ | ||
title: 'Open pickers programmatically', | ||
href: '/guides/controlling-programmatically', | ||
}, | ||
{ title: 'Static inner components', href: '/guides/static-components' }, | ||
{ title: 'Updating to v3', href: '/guides/upgrading-to-v3' }, | ||
], | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { stringToTestId } from '../../docs/utils/helpers'; | ||
import { navItems } from '../../docs/layout/components/navigationMap'; | ||
|
||
describe('App navigation', () => { | ||
before(() => { | ||
cy.visit('/getting-started/installation'); | ||
}); | ||
|
||
navItems.forEach(navItem => { | ||
context(navItem.title, () => { | ||
beforeEach(() => { | ||
cy.get(`[data-nav=${stringToTestId(navItem.title)}]`).as('nav-group'); | ||
cy.get('@nav-group').click(); | ||
}); | ||
|
||
navItem.children && | ||
navItem.children.forEach((leafItem: any) => { | ||
it(`Opens ${leafItem.title} page`, () => { | ||
cy.get('@nav-group') | ||
.find(`[data-nav=${stringToTestId(leafItem.title)}]`) | ||
.click(); | ||
|
||
cy.url().should('contain', leafItem.as || leafItem.href); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.