Skip to content

Commit

Permalink
Tests: Enable cypress to run cucumber tests
Browse files Browse the repository at this point in the history
Add libraries needed to run cucumber tests with cypress.

Signed-off-by: Michal Polovka <mpolovka@redhat.com>
  • Loading branch information
miskopo committed Jul 20, 2023
1 parent f0862e6 commit 0b141e5
Show file tree
Hide file tree
Showing 6 changed files with 8,050 additions and 359 deletions.
23 changes: 19 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
import { defineConfig } from "cypress";
import createBundler from "@bahmutov/cypress-esbuild-preprocessor";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import createEsbuildPlugin from "@badeball/cypress-cucumber-preprocessor/esbuild";

export default defineConfig({
e2e: {
baseUrl: "https://server.ipa.demo/ipa/modern_ui/",
},
hosts: {
"server.ipa.demo": "127.0.0.1",
specPattern: "**/*.feature",
baseUrl: "http://localhost:3000/",

async setupNodeEvents(
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> {
await addCucumberPreprocessorPlugin(on, config);
on(
"file:preprocessor",
createBundler({
plugins: [createEsbuildPlugin(config)],
})
);
return config;
},
},
});
5 changes: 5 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const cucumber = require("cypress-cucumber-preprocessor").default;

module.exports = (on, config) => {
on("file:preprocessor", cucumber());
};
Loading

0 comments on commit 0b141e5

Please sign in to comment.