File tree Expand file tree Collapse file tree 12 files changed +925
-31
lines changed Expand file tree Collapse file tree 12 files changed +925
-31
lines changed Original file line number Diff line number Diff line change 1010 steps :
1111 - uses : actions/checkout@v2
1212 - uses : actions/setup-node@v1
13+ with :
14+ node-version : ' 14.17.4'
1315 - run : npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
1416 npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
1517 - run : yarn
Original file line number Diff line number Diff line change 1414 steps :
1515 - uses : actions/checkout@v2
1616 - uses : actions/setup-node@v1
17+ with :
18+ node-version : ' 14.17.4'
1719 - uses : fregante/setup-git-user@v1
1820 - run : npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
1921 npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
Original file line number Diff line number Diff line change 1010 steps :
1111 - uses : actions/checkout@v2
1212 - uses : actions/setup-node@v1
13+ with :
14+ node-version : ' 14.17.4'
1315 - run : npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
1416 npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
1517 - run : yarn
Original file line number Diff line number Diff line change 2828npm-debug.log *
2929yarn-debug.log *
3030yarn-error.log *
31+ * .mp4
Original file line number Diff line number Diff line change @@ -93,6 +93,15 @@ Runs the jest test suite
9393### ` yarn lint `
9494
9595Runs ESLint to report on any style violations
96+ ### Visual testing
97+
98+ 1 . Join BrowserStack (ask Brian for link)
99+ 1 . Navigate to this project in percy [ here] ( https://percy.io/f38ae9b9/ui-design-system )
100+ 1 . Define ` PERCY_TOKEN ` in shell (the one from ui-design-system project)
101+ 1 . ` npx percy exec -- cypress run `
102+ 1 . View results in percy.io / console
103+
104+ > Note- we are on the free plan (5k images/month) so be mindful of the limit
96105
97106## Pull requests
98107
Original file line number Diff line number Diff line change 1+ {
2+ "baseUrl" : " http://localhost:9009/" ,
3+ "experimentalStudio" : true
4+ }
Original file line number Diff line number Diff line change 1+ /* eslint-disable arrow-body-style */
2+ /* eslint-disable prefer-arrow-callback */
3+
4+ describe ( 'Integration test with visual testing' , function ( ) {
5+ it ( 'Loads non button version' , function ( ) {
6+ cy . visit ( 'http://localhost:9009/?path=/story/design-system-form-elements-form-group--with-trailing-icon' ) ;
7+
8+ cy . get ( '#storybook-preview-iframe' ) . iframe ( ) . find ( '.InputLabel' ) . should ( 'contain' , 'Form Group with input trailing icon' ) ;
9+
10+ cy . percySnapshot ( 'Non-button' ) ;
11+ } ) ;
12+
13+ // TODO: Wait on new props to be merged into develop
14+ // https://github.com/user-interviews/ui-design-system/pull/431
15+ // it('Loads button version', function () {
16+ // cy.visit('http://localhost:9009/?path=/story/design-system-form-elements-form-group--with-trailing-icon-and-button');
17+
18+ // cy.get('#storybook-preview-iframe').iframe().find('.InputLabel')
19+ // .should('contain', 'Form Group with input trailing icon and button');
20+
21+ // cy.percySnapshot('Button');
22+ // });
23+ } ) ;
Original file line number Diff line number Diff line change 1+ /// <reference types="cypress" />
2+ // ***********************************************************
3+ // This example plugins/index.js can be used to load plugins
4+ //
5+ // You can change the location of this file or turn off loading
6+ // the plugins file with the 'pluginsFile' configuration option.
7+ //
8+ // You can read more here:
9+ // https://on.cypress.io/plugins-guide
10+ // ***********************************************************
11+
12+ // This function is called when a project is opened or re-opened (e.g. due to
13+ // the project's config changing)
14+
15+ /**
16+ * @type {Cypress.PluginConfig }
17+ */
18+ // eslint-disable-next-line no-unused-vars
19+ module . exports = ( on , config ) => {
20+ // `on` is used to hook into various events Cypress emits
21+ // `config` is the resolved Cypress config
22+ } ;
Original file line number Diff line number Diff line change 1+ /* eslint-disable arrow-body-style */
2+ // ***********************************************
3+ // This example commands.js shows you how to
4+ // create various custom commands and overwrite
5+ // existing commands.
6+ //
7+ // For more comprehensive examples of custom
8+ // commands please read more here:
9+ // https://on.cypress.io/custom-commands
10+ // ***********************************************
11+ //
12+ // https://github.com/cypress-io/cypress/issues/136#issuecomment-342391119
13+ Cypress . Commands . add ( 'iframe' , { prevSubject : 'element' } , ( $iframe ) => {
14+ return new Cypress . Promise ( ( resolve ) => {
15+ $iframe . on ( 'load' , ( ) => {
16+ resolve ( $iframe . contents ( ) . find ( 'body' ) ) ;
17+ } ) ;
18+ } ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 1+ // ***********************************************************
2+ // This example support/index.js is processed and
3+ // loaded automatically before your test files.
4+ //
5+ // This is a great place to put global configuration and
6+ // behavior that modifies Cypress.
7+ //
8+ // You can change the location of this file or turn off
9+ // automatically serving support files with the
10+ // 'supportFile' configuration option.
11+ //
12+ // You can read more here:
13+ // https://on.cypress.io/configuration
14+ // ***********************************************************
15+
16+ // Import commands.js using ES2015 syntax:
17+ import './commands' ;
18+ // eslint-disable-next-line import/no-extraneous-dependencies
19+ import '@percy/cypress' ;
20+ // Alternatively you can use CommonJS syntax:
21+ // require('./commands')
You can’t perform that action at this time.
0 commit comments