-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
12 changed files
with
1,500 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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,3 @@ | ||
screenshots | ||
snapshots | ||
videos |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,38 @@ | ||
import { forAllImagesInElement } from '../../src/functions/forAllImagesInElement'; | ||
|
||
context('waitasecond samples', () => { | ||
/* | ||
beforeEach(() => { | ||
// TODO: Run server (there is problem with running the express/http here) | ||
}); | ||
*/ | ||
|
||
const SCREENSHOT_CONFIG: [string, object] = [ | ||
'forAllImagesInElement', | ||
{ | ||
capture: 'viewport', | ||
}, | ||
]; | ||
|
||
describe('cleanup of elements', () => { | ||
it('wait untill all images are load', async () => { | ||
cy.visit(`http://localhost:8070/samples/forAllImagesInElement.html`) | ||
// Test NOT matchImageSnapshot | ||
//.screenshot(...SCREENSHOT_CONFIG) | ||
.window() | ||
.then(async (window) => { | ||
await forAllImagesInElement(window.document.body); | ||
}) | ||
.wait(1000); | ||
|
||
cy.matchImageSnapshot(...SCREENSHOT_CONFIG); | ||
cy.matchImageSnapshot(...SCREENSHOT_CONFIG); | ||
/* | ||
for (let i = 0; i < 5; i++) { | ||
cy.log(`Visit ${i}`); | ||
cy.matchImageSnapshot(...SCREENSHOT_CONFIG); | ||
} | ||
*/ | ||
}); | ||
}); | ||
}); |
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,25 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
import { addMatchImageSnapshotPlugin } from 'cypress-image-snapshot/plugin'; | ||
|
||
/** | ||
* @type {Cypress.PluginConfig} | ||
*/ | ||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
|
||
addMatchImageSnapshotPlugin(on, config); | ||
}; |
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,8 @@ | ||
import { addMatchImageSnapshotCommand } from 'cypress-image-snapshot/command'; | ||
|
||
addMatchImageSnapshotCommand({ | ||
failureThreshold: 0.00005, // 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 | ||
}); |
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 @@ | ||
// *********************************************************** | ||
// This example support/index.js 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'; |
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,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"declaration": true, | ||
"alwaysStrict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": ["dom", "es2017"], | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true | ||
} | ||
} |
Oops, something went wrong.