Skip to content

Commit

Permalink
contentful YOLO
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Mar 30, 2023
1 parent 6cab274 commit 83c8405
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 66 deletions.
25 changes: 25 additions & 0 deletions e2e-tests/contentful/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineConfig } from "cypress"
import { addMatchImageSnapshotPlugin } from "@simonsmith/cypress-image-snapshot/plugin"

export default defineConfig({
e2e: {
baseUrl: `http://localhost:9000`,
specPattern: `cypress/integration/*.{js,ts}`,
viewportWidth: 1440,
viewportHeight: 900,
retries: {
runMode: 0,
openMode: 0
},
setupNodeEvents(on, config) {
addMatchImageSnapshotPlugin(on, config)
on("before:browser:launch", (browser = {} as Cypress.Browser, launchOptions) => {
if (browser.family === "chromium" || browser.name === "chrome") {
// Make retina screens run at 1x density so they match the versions in CI
launchOptions.args.push("--force-device-scale-factor=1")
}
return launchOptions
})
},
},
})
9 changes: 0 additions & 9 deletions e2e-tests/contentful/cypress.json

This file was deleted.

24 changes: 0 additions & 24 deletions e2e-tests/contentful/cypress/plugins/index.js

This file was deleted.

14 changes: 14 additions & 0 deletions e2e-tests/contentful/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import "gatsby-cypress"
import { addMatchImageSnapshotCommand } from "@simonsmith/cypress-image-snapshot/command"
import { register } from "@cypress/snapshot"

addMatchImageSnapshotCommand({
customDiffDir: `/__diff_output__`,
customDiffConfig: {
threshold: 0.1,
},
failureThreshold: 0.08,
failureThresholdType: `percent`,
})

register()
28 changes: 0 additions & 28 deletions e2e-tests/contentful/cypress/support/index.js

This file was deleted.

8 changes: 8 additions & 0 deletions e2e-tests/contentful/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.ts"]
}
12 changes: 7 additions & 5 deletions e2e-tests/contentful/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
},
"devDependencies": {
"@cypress/snapshot": "^2.1.7",
"@simonsmith/cypress-image-snapshot": "^6.0.1",
"@types/simonsmith__cypress-image-snapshot": "npm:@types/cypress-image-snapshot",
"cross-env": "^7.0.3",
"cypress": "^9.7.0",
"cypress-image-snapshot": "^4.0.1",
"cypress": "^12.9.0",
"gatsby-cypress": "next",
"prettier": "^2.8.3",
"srcset": "^5.0.0",
"start-server-and-test": "^1.15.3"
"start-server-and-test": "^2.0.0",
"typescript": "^5.0.2"
},
"keywords": [
"gatsby"
Expand All @@ -40,8 +42,8 @@
"test": "cross-env CYPRESS_SUPPORT=y npm run build && npm run start-server-and-test",
"start-server-and-test": "start-server-and-test serve http://localhost:9000 cy:run",
"serve": "gatsby serve",
"cy:open": "cypress open",
"cy:run": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome"
"cy:open": "cypress open --browser chrome --e2e",
"cy:run": "node ../../scripts/cypress-run-with-conditional-record-flag.js --browser chrome --e2e"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 83c8405

Please sign in to comment.