-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f8c492
commit 5e0ef4c
Showing
36 changed files
with
935 additions
and
410 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ lerna-debug.log | |
packages/**/package-lock.json | ||
packages/**/.cache | ||
*.tgz | ||
!/packages/*/cypress/ |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
!cypress | ||
!cypress/* | ||
!.eslintrc | ||
!cypress.config.js | ||
|
||
# Incremental ts info | ||
tsconfig.tsbuildinfo |
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,34 @@ | ||
const { defineConfig } = require('cypress') | ||
const { addMatchImageSnapshotPlugin } = require('@simonsmith/cypress-image-snapshot/plugin'); | ||
|
||
/** @type {import('cypress').defineConfig} */ | ||
module.exports = defineConfig({ | ||
component: { | ||
specPattern: "src/**/*.spec.ct.{js,ts,jsx,tsx}", | ||
viewportHeight: 660, | ||
viewportWidth: 1000, | ||
video: false, | ||
devServer: { | ||
framework: 'react', | ||
bundler: 'webpack', | ||
webpackConfig: require('./cypress/cypress.webpack.config') | ||
}, | ||
setupNodeEvents(on, config) { | ||
addMatchImageSnapshotPlugin(on, config); | ||
on('before:browser:launch', (browser, launchOptions) => { | ||
if (browser.name === 'chrome' && browser.isHeadless) { | ||
launchOptions.args.push('--window-size=1280,720'); | ||
|
||
// force screen to be non-retina | ||
launchOptions.args.push('--force-device-scale-factor=1'); | ||
} | ||
|
||
if (browser.name === 'electron' && browser.isHeadless) { | ||
// fullPage screenshot size is 1280x720 | ||
launchOptions.preferences.width = 1280; | ||
launchOptions.preferences.height = 720; | ||
} | ||
}); | ||
}, | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
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
Binary file added
BIN
+192 KB
.../report details kba loaded -- renders component and matches screenshot.snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
packages/advisor-components/cypress/support/component-index.html
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,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>Components App</title> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
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,46 @@ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
/* eslint-disable prettier/prettier */ | ||
// *********************************************************** | ||
// This example support/component.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
import '@patternfly/patternfly/patternfly.css'; | ||
import '@patternfly/patternfly/patternfly-addons.css'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') | ||
|
||
import { mount } from 'cypress/react' | ||
const { addMatchImageSnapshotCommand, } = require('@simonsmith/cypress-image-snapshot/command'); | ||
|
||
// configure the matcher to be less precise to adjust between the headless and normal browser rendering differences | ||
addMatchImageSnapshotCommand({ | ||
failureThreshold: 0.03, // threshold for entire image | ||
failureThresholdType: 'percent', // percent of image or number of pixels | ||
customDiffConfig: { threshold: 0.1 }, // threshold for each pixel | ||
capture: 'viewport', // capture viewport in screenshot | ||
}); | ||
|
||
// Augment the Cypress namespace to include type definitions for | ||
// your custom command. | ||
// Alternatively, can be defined in cypress/support/component.d.ts | ||
// with a <reference path="./component" /> at the top of your spec. | ||
|
||
Cypress.Commands.add('mount', mount) | ||
|
||
// Example use: | ||
// cy.mount(<MyComponent />) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,3 +8,5 @@ doc/ | |
config/ | ||
tsconfig.json | ||
pre-publish.js | ||
.cypress-cache/ | ||
cypress/ |
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 |
---|---|---|
@@ -1,3 +0,0 @@ | ||
module.exports = { | ||
extends: '../../babel.config.js' | ||
}; | ||
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,16 @@ | ||
const { defineConfig } = require('cypress') | ||
|
||
/** @type {import('cypress').defineConfig} */ | ||
module.exports = defineConfig({ | ||
component: { | ||
specPattern: "src/**/*.spec.ct.{js,ts,jsx,tsx}", | ||
viewportHeight: 660, | ||
viewportWidth: 1000, | ||
video: false, | ||
devServer: { | ||
framework: 'react', | ||
bundler: 'webpack', | ||
webpackConfig: require('./cypress/cypress.webpack.config') | ||
} | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.