Skip to content

Commit

Permalink
feat: added cypress example (still with error)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelangarano committed Nov 20, 2024
1 parent c147458 commit 46e36b4
Show file tree
Hide file tree
Showing 10 changed files with 1,395 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
*/fullTestSuite.json
upload.marker.json
.currents
.env
.env
cypress/
14 changes: 14 additions & 0 deletions cy-example/combined-results.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testsuites>
<testsuite name="First Test Suite" timestamp="2024-11-20T05:26:28" tests="2" failures="1" time="3.238" file="cy-example/e2e/first.cy.js">
<testcase name="First Test Suite visits google" time="0" classname="visits google" failure="true" error="true" success="false">
<failure message="Timed out retrying after 4000ms: expected 'Google' to include 'Amazon'" type="AssertionError">AssertionError: Timed out retrying after 4000ms: expected 'Google' to include 'Amazon'
at Context.eval (webpack:///./e2e/first.cy.js:4:15)</failure>
</testcase>
<testcase name="First Test Suite can search" time="3.238" classname="can search" failure="false" error="false" success="true"/>
</testsuite>
<testsuite name="Second Test Suite" timestamp="2024-11-20T05:26:40" tests="2" failures="0" time="4.33" file="cy-example/e2e/second.cy.js">
<testcase name="Second Test Suite visits google" time="1.174" classname="visits google" failure="false" error="false" success="true"/>
<testcase name="Second Test Suite can search" time="3.156" classname="can search" failure="false" error="false" success="true"/>
</testsuite>
</testsuites>
12 changes: 12 additions & 0 deletions cy-example/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"framework": "junit",
"frameworkVersion": "13.16.0",
"cliArgs": {
"options": { "jUnitFile": "cy-example/combined-results.xml" },
"args": []
},
"frameworkConfig": {
"originFramework": "cypress",
"originFrameworkVersion": "13.16.0"
}
}
16 changes: 16 additions & 0 deletions cy-example/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
supportFile: false,
specPattern: "cy-example/e2e/*.cy.js",
reporter: "cypress-junit-reporter",
reporterOptions: {
mochaFile: "cy-example/results-[hash].xml",
toConsole: true,
},
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
11 changes: 11 additions & 0 deletions cy-example/e2e/first.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe("First Test Suite", () => {
it("visits google", () => {
cy.visit("https://www.google.com");
cy.title().should("include", "Amazon");
});

it("can search", () => {
cy.visit("https://www.google.com");
cy.get('[name="q"]').type("Cypress testing{enter}");
});
});
11 changes: 11 additions & 0 deletions cy-example/e2e/second.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe("Second Test Suite", () => {
it("visits google", () => {
cy.visit("https://www.google.com");
cy.title().should("include", "Google");
});

it("can search", () => {
cy.visit("https://www.google.com");
cy.get('[name="q"]').type("Cypress testing{enter}");
});
});
Loading

0 comments on commit 46e36b4

Please sign in to comment.