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
<!-- | |
These comments are just guidelines | |
not a strict set of rules to follow. | |
--> | |
**Jira**: | |
**Design**: | |
<!-- |
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
import addContext from "mochawesome/addContext"; | |
Cypress.Screenshot.defaults({ | |
// Disable default screenshot on fail because we want to change the filename | |
screenshotOnRunFailure: false, | |
}); | |
function generateScreenshotName(test) { | |
const MAX_SPEC_NAME_LENGTH = 220; | |
return [ |
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
Cypress.on('test:after:run', (test, runnable) => { | |
if (test.state === 'failed') { | |
let item = runnable | |
const nameParts = [runnable.title] | |
// Iterate through all parents and grab the titles | |
while (item.parent) { | |
nameParts.unshift(item.parent.title) | |
item = item.parent | |
} |
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 A(){ | |
if(!this.name) | |
this.name = 'A'; | |
} | |
A.prototype.sayHello = function(){ | |
console.log(this.name + ' says hello'); | |
}; | |
function 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
import React from "react"; | |
const CharacterCard = ({ children }) => ( | |
<div className="id-card-wrapper"> | |
<div className="id-card"> | |
{ children } | |
</div> | |
</div> | |
); |