Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug #87

Closed
wants to merge 2 commits into from
Closed

Bug #87

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Sample-png-image-200kb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 45 additions & 3 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
module.exports = {
const { defineConfig } = require("cypress");
const webpack = require("@cypress/webpack-preprocessor");
const {
addCucumberPreprocessorPlugin,
} = require("@badeball/cypress-cucumber-preprocessor");


async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);

on(
"file:preprocessor",
webpack({
webpackOptions: {
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: "@badeball/cypress-cucumber-preprocessor/webpack",
options: config,
},
],
},
],
},
},
})
);

// Make sure to return the config object as it might have been modified by the plugin.
return config;
}

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {},
baseUrl: "https://duckduckgo.com",
specPattern: "**/*.feature",
setupNodeEvents,
supportFile: false,
},
}
});
3 changes: 3 additions & 0 deletions cypress/e2e/duckduckgo.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Feature: duckduckgo.com
Scenario: visiting the frontpage
When I visit duckduckgo.com
12 changes: 12 additions & 0 deletions cypress/e2e/duckduckgo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { When } from "@badeball/cypress-cucumber-preprocessor";

When("I visit duckduckgo.com", () => {
throw new Error('intended')
cy.visit("https://example.cypress.io");
});

afterEach(() => {
cy.readFile('Sample-png-image-200kb.png').then(res => {
debugger
})
})
6 changes: 6 additions & 0 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ describe('page', () => {
cy.visit('https://example.cypress.io')
})
})

afterEach(() => {
cy.readFile('temp.png', 'binary').then(res => {
debugger
})
})
5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

25 changes: 0 additions & 25 deletions cypress/support/commands.js

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/support/e2e.js

This file was deleted.

Binary file added google logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading