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
{ | |
"reporter": "nyan" | |
} |
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
{ | |
"reporter": "mochawesome", | |
"reporterOptions": { | |
"reportDir": "cypress/report/mochawesome-report", | |
"overwrite": false, | |
"html": false, | |
"json": true, | |
"timestamp": "mmddyyyy_HHMMss" | |
} | |
} |
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
{ | |
"reportDir": "cypress/report/mochawesome-report", | |
"overwrite": true, | |
"html": true, | |
"json": 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
const cypress = require('cypress') | |
const yargs = require('yargs') | |
const { merge } = require('mochawesome-merge') | |
const marge = require('mochawesome-report-generator') | |
const rm = require('rimraf') | |
const cypressConfig = require('./cypress') | |
const ls = require('ls') | |
const argv = yargs.options({ | |
'browser': { | |
alias: 'b', |
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
const addContext = require('mochawesome/addContext') | |
Cypress.on('test:after:run', (test, runnable) => { | |
if (test.state === 'failed') { | |
const screenshotFileName = `${runnable.parent.title} -- ${test.title} (failed).png` | |
addContext({ test }, `assets/${Cypress.spec.name}/${screenshotFileName}`) | |
} | |
}) |
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
{ | |
"reporter": "mochawesome", | |
"reporterOptions": { | |
"reportDir": "cypress/report/mochawesome-report", | |
"overwrite": false, | |
"html": false, | |
"json": true, | |
"timestamp": "mmddyyyy_HHMMss" | |
}, | |
"screenshotsFolder": "cypress/report/mochawesome-report/assets" |
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
function clickme() { | |
window.location.href = "tel://0234567890"; | |
} |
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
function setLocationHref(url) { | |
window.location.href = url | |
} | |
// visible for testing | |
window.setLocationHref = setLocationHref | |
function clickme() { | |
setLocationHref("tel://0234567890") | |
} |
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
describe('URL Scheme Test', () => { | |
beforeEach(() => { | |
cy.visit(`./url_scheme.html`) | |
}) | |
it('should click to navigate', () => { | |
const winSetLocationHrefStub = (url) => { | |
expect(url).to.eq('tel://0234567890') | |
} | |
cy.window().then(window => { | |
cy.stub(window, 'setLocationHref', winSetLocationHrefStub) |
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
function clickme() { | |
var name = window.prompt("Please enter your name.") | |
if (name) { | |
document.getElementById("result").innerHTML = "Hello " + name + " !" | |
} else { | |
document.getElementById("result").innerHTML = "You did not input anything" | |
} | |
} |