Skip to content

Commit

Permalink
chore: add cypress-terminal-report example
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Sep 26, 2024
1 parent bfbe088 commit 0e57465
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 9 deletions.
9 changes: 8 additions & 1 deletion examples/happo/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { defineConfig } from "cypress";
import { cloudPlugin } from "cypress-cloud/plugin";

// @ts-ignore
import patchCypressOn from "cypress-on-fix";
// @ts-ignore
import * as happoTask from "happo-cypress/task";

import installTerminal from "cypress-terminal-report/src/installLogsPrinter";

module.exports = defineConfig({
e2e: {
baseUrl: "https://todomvc.com/examples/backbone/dist",
Expand All @@ -13,9 +16,13 @@ module.exports = defineConfig({
specPattern: "cypress/*/**/*.spec.js",
async setupNodeEvents(cyOn, config) {
const on = patchCypressOn(cyOn);

installTerminal(on, {
printLogsToConsole: "always",
});
happoTask.register(on, config);

return await cloudPlugin(on, config);
},
},

});
5 changes: 5 additions & 0 deletions examples/happo/cypress/e2e/happo.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
describe("Home page", function () {
this.beforeAll(() => {
cy.log("I run once before all tests in the block");
});

it("loads properly", function () {
cy.visit("/");
cy.log("log from cypress");
cy.get(".header").happoScreenshot();
});
});
1 change: 1 addition & 0 deletions examples/happo/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("cypress-terminal-report/src/installLogsCollector")();
require("cypress-cloud/support");
require("./commands");

Expand Down
1 change: 1 addition & 0 deletions examples/happo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"cypress": "12.17.4",
"cypress-cloud": "*",
"cypress-on-fix": "^1.0.2",
"cypress-terminal-report": "^7.0.2",
"happo-cypress": "^4.2.0",
"happo-e2e": "^2.6.1",
"happo.io": "^10.1.2"
Expand Down
208 changes: 200 additions & 8 deletions package-lock.json

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

0 comments on commit 0e57465

Please sign in to comment.