-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/ShellyDCMS/cypress-test-utils
- Loading branch information
Showing
11 changed files
with
335 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
retries: { | ||
// Configure retry attempts for `cypress run` | ||
// Default is 0 | ||
runMode: 2, | ||
// Configure retry attempts for `cypress open` | ||
// Default is 0 | ||
openMode: 0 | ||
}, | ||
reporter: "mochawesome", | ||
reporterOptions: | ||
{ | ||
"reportDir": "cypress/results/json", | ||
"overwrite": false, | ||
"html": false, | ||
"json": true, | ||
suiteTitleSeparatedBy: " > ", | ||
testCaseSwitchClassnameAndName: false, | ||
rootSuiteTitle: "Angular Tests", | ||
toConsole: true, | ||
}, | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
return config; | ||
}, | ||
supportFile:false, | ||
baseUrl: "https://shellydcms.github.io/cypress-test-utils/modules.html", | ||
viewportHeight: 1000, | ||
viewportWidth: 1600, | ||
specPattern: "src/**/*.cy.{js,jsx,ts,tsx}", | ||
excludeSpecPattern: "cypress/**/*.driver.{js,jsx,ts,tsx}", | ||
defaultCommandTimeout: 50000, | ||
experimentalStudio: true | ||
}, | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
|
||
<h1>My First Heading</h1> | ||
<p>My first paragraph.</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CypressHelper } from "./cypress-helper"; | ||
|
||
describe("cypress helper tests", () => { | ||
const { beforeAndAfter, given, when, get } = new CypressHelper(); | ||
beforeAndAfter(); | ||
|
||
it("should intercept request and mock response", async () => { | ||
given.interceptAndMockResponse({url: "**/shellygo/whatever", response: {shelly: "go"}}) | ||
expect(await(await fetch("https:/shellygo/whatever")).json()).to.include({shelly: "go"}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.