Skip to content

Commit

Permalink
refactor: create dev-cypress package
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaelahidev committed May 8, 2024
1 parent 8c705a9 commit 3937061
Show file tree
Hide file tree
Showing 32 changed files with 67 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# lint top level dot files
!.*
/node_modules/*
/cypress/*
/packages/dev-cypress/*
/.storybook/*
build/*
dist/*
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PROJECT_ROOT>/node_modules/eslint-plugin-react/.*
<PROJECT_ROOT>/node_modules/module-deps/.*
<PROJECT_ROOT>/node_modules/resolve/.*
<PROJECT_ROOT>/cypress/.*
<PROJECT_ROOT>/packages/dev-cypress/js/.*
<PROJECT_ROOT>/.storybook/.*
[include]

Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dist
# php code sniffer report
.cache/phpcs-report.xml

# any cache files
.cache/**

# Storybook Build directory
Expand All @@ -65,7 +66,10 @@ storybook-static
.nyc_output

# Cypress screenshots
cypress/screenshots
packages/dev-cypress/js/screenshots

# Cypress downloads
cypress/downloads
packages/dev-cypress/js/downloads

# Cypress videos
packages/dev-cypress/js/videos
2 changes: 2 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
},
"ignoreFiles": [
"coverage/**/*.css",
"packages/dev-cypress/**/*.css",
"packages/dev-cypress/**/*.scss",
"packages/dev-storybook/**/*.css",
"packages/dev-storybook/**/*.scss"
]
Expand Down
12 changes: 6 additions & 6 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ module.exports = defineConfig({
'packages/**/*.cypress.js',
'packages/**/*.cy.compatibility.js',
],
supportFile: 'cypress/support/e2e.js',
supportFile: 'packages/dev-cypress/js/support/e2e.js',
},
env: {
wpUsername: 'admin',
wpPassword: 'password',
testURL: 'http://localhost:8888',
},
fixturesFolder: 'cypress/fixtures',
fixturesFolder: 'packages/dev-cypress/js/fixtures',
pageLoadTimeout: 120000,
projectId: 'blockera',
retries: {
openMode: 0,
runMode: 0,
},
coverage: true,
screenshotsFolder: 'cypress/screenshots',
videosFolder: 'cypress/videos',
screenshotsFolder: 'packages/dev-cypress/js/screenshots',
videosFolder: 'packages/dev-cypress/js/videos',
viewportHeight: 1440,
viewportWidth: 2560,
component: {
setupNodeEvents(on, config) {
require('./cypress/plugins/index.js')(on, config);
require('./packages/dev-cypress/js/plugins/index.js')(on, config);
require('@cypress/code-coverage/task')(on, config);

return config;
Expand All @@ -45,6 +45,6 @@ module.exports = defineConfig({
bundler: 'webpack',
},
specPattern: 'packages/**/*.cy.js',
supportFile: 'cypress/support/component.js',
supportFile: 'packages/dev-cypress/js/support/component.js',
},
});
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@babel/plugin-proposal-export-default-from": "^7.18.10",
"@babel/preset-flow": "^7.21.4",
"@babel/preset-react": "^7.22.5",
"@blockera/dev-cypress": "file:packages/dev-cypress",
"@blockera/dev-storybook": "file:packages/dev-storybook",
"@cypress/browserify-preprocessor": "^3.0.2",
"@cypress/code-coverage": "^3.12.1",
Expand Down
1 change: 1 addition & 0 deletions packages/dev-cypress/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 3 additions & 0 deletions packages/dev-cypress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# storybook

Add custom configuration and custom decorators for storybook in any all storybook project.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import './commands';
/**
* Style dependencies
*/
import '../../packages/controls/src/style.scss';
import '../../.storybook/styles/style.lazy.scss';
import '../../packages/components/src/style.scss';
import '../../../controls/js/style.scss';
import '../../../../.storybook/styles/style.lazy.scss';
import '../../../components/js/style.scss';
import { WithControlDataProvider } from './components/providers/control-provider/with-control-data-provider';
import { controlReducer } from '@blockera/controls/src/store/reducers/control-reducer';
import { modifyControlValue } from '@blockera/controls/src/store/actions';
import { controlReducer } from '@blockera/controls/js/store/reducers/control-reducer';
import { modifyControlValue } from '@blockera/controls/js/store/actions';

Cypress.Commands.add('mount', mount);

Expand Down Expand Up @@ -94,4 +94,3 @@ Cypress.Commands.add(
);
}
);

Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,3 @@ export const WithControlDataProvider = ({ children, contextValue }) => {
</ControlDataContext.Provider>
);
};

File renamed without changes.
25 changes: 25 additions & 0 deletions packages/dev-cypress/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@blockera/dev-cypress",
"version": "1.0.0",
"description": "Blockera Cypress config and helpers",
"main": "js/index.js",
"keywords": [
"Blockera",
"Storybook"
],
"author": "The Blockera Contributers",
"license": "ISC",
"homepage": "https://github.com/blockeraai/blockera/blob/master/packages/dev-cypress/README.md",
"repository": {
"type": "git",
"url": "https://github.com/blockeraai/blockera",
"directory": "packages/dev-cypress"
},
"sideEffects": false,
"bugs": {
"url": "https://github.com/blockeraai/blockera/issues"
},
"engines": {
"node": ">=12"
}
}
File renamed without changes.

0 comments on commit 3937061

Please sign in to comment.