import TestInteractionDTO from './test-interaction-dto.js'
/**
*
*/
class TestResultDTO {
constructor (json) {
/** @private */
this.json = json
}
/**
* @type {string}
*/
get errorMessage () {
return this.json.error?.message
}
/**
* @type {TestInteractionDTO[]}
*/
get interactions () {
return this.json.interactions.map(o => new TestInteractionDTO(o))
}
/**
* @type {string | undefined}
*/
get recordingURL () {
return this.json.recordingURL
}
/**
* @type {string}
*/
get runID () {
return this.json.runID
}
/**
* @type {('ERROR' | 'FAIL' | 'PASS')}
*/
get status () {
return this.json.status
}
/**
* @type {string}
*/
get testName () {
return this.json.testName
}
/**
* @type {Test | undefined}
*/
get test () {
return this.json.test
}
/**
* @returns {any}
*/
toJSON () {
return this.json
}
}
/**
* @typedef Test
* @property {string} name
* @property {TestSuite} testSuite
*
* @typedef TestSuite
* @property {string} name
*/
export default TestResultDTO