html-reporter
Advanced tools
Comparing version 2.12.0 to 2.12.1
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="2.12.1"></a> | ||
## [2.12.1](https://github.com/gemini-testing/html-reporter/compare/v2.12.0...v2.12.1) (2018-04-06) | ||
### Bug Fixes | ||
* **gui:** accept all should not save errored tests ([811ec68](https://github.com/gemini-testing/html-reporter/commit/811ec68)) | ||
* **gui:** do not run all tests on restart successful suite ([1470355](https://github.com/gemini-testing/html-reporter/commit/1470355)) | ||
<a name="2.12.0"></a> | ||
@@ -7,0 +18,0 @@ # [2.12.0](https://github.com/gemini-testing/html-reporter/compare/v2.11.0...v2.12.0) (2018-04-06) |
@@ -13,6 +13,4 @@ 'use strict'; | ||
import {isSuccessStatus, isFailStatus, isErroredStatus} from '../../../common-utils'; | ||
import {getCommonErrors} from '../../../constants/errors'; | ||
import {isAcceptable} from '../../modules/utils'; | ||
const {NO_REF_IMAGE_ERROR} = getCommonErrors(); | ||
class SectionBrowserBody extends Component { | ||
@@ -45,12 +43,12 @@ static propTypes = { | ||
onSuiteAccept = () => { | ||
onTestAccept = () => { | ||
const {result, suite} = this.props; | ||
this.props.actions.acceptSuite(suite, result.name, this.state.retry); | ||
this.props.actions.acceptTest(suite, result.name, this.state.retry); | ||
} | ||
onSuiteRetry = () => { | ||
onTestRetry = () => { | ||
const {result, suite} = this.props; | ||
this.props.actions.retrySuite(suite, result.name); | ||
this.props.actions.retryTest(suite, result.name); | ||
} | ||
@@ -60,5 +58,4 @@ | ||
const {gui, running} = this.props; | ||
const {status, reason} = activeResult; | ||
const stack = reason && reason.stack; | ||
const acceptDisabled = !(isErroredStatus(status) && stack.startsWith(NO_REF_IMAGE_ERROR) || isFailStatus(status)); | ||
const {status} = activeResult; | ||
const acceptDisabled = !isAcceptable(activeResult); | ||
const retryDisabled = running || isSuccessStatus(status) || (!isFailStatus(status) && !isErroredStatus(status)); | ||
@@ -73,3 +70,3 @@ | ||
isDisabled={acceptDisabled} | ||
handler={this.onSuiteAccept} | ||
handler={this.onTestAccept} | ||
/> | ||
@@ -80,3 +77,3 @@ <ControlButton | ||
isDisabled={retryDisabled} | ||
handler={this.onSuiteRetry} | ||
handler={this.onTestRetry} | ||
/> | ||
@@ -83,0 +80,0 @@ </div> |
@@ -6,2 +6,4 @@ 'use strict'; | ||
RUN_FAILED_TESTS: 'RUN_FAILED_TESTS', | ||
RETRY_SUITE: 'RETRY_SUITE', | ||
RETRY_TEST: 'RETRY_TEST', | ||
SUITE_BEGIN: 'SUITE_BEGIN', | ||
@@ -13,4 +15,3 @@ TEST_BEGIN: 'TEST_BEGIN', | ||
ACCEPT_ALL: 'ACCEPT_ALL', | ||
ACCEPT_SUITE: 'ACCEPT_SUITE', | ||
RETRY_SUITE: 'RETRY_SUITE', | ||
ACCEPT_TEST: 'ACCEPT_TEST', | ||
VIEW_INITIAL: 'VIEW_INITIAL', | ||
@@ -17,0 +18,0 @@ VIEW_EXPAND_ALL: 'VIEW_EXPAND_ALL', |
@@ -7,3 +7,3 @@ 'use strict'; | ||
import {QUEUED} from '../../constants/test-statuses'; | ||
import {isSuiteFailed} from './utils'; | ||
import {isSuiteFailed, isAcceptable} from './utils'; | ||
@@ -26,12 +26,9 @@ const localStorage = window.localStorage; | ||
export const runAllTests = () => { | ||
const runTests = ({tests = [], action = {}} = {}) => { | ||
return async (dispatch) => { | ||
try { | ||
await axios.post('/run'); | ||
dispatch({ | ||
type: actionNames.RUN_ALL_TESTS, | ||
payload: {status: QUEUED} | ||
}); | ||
await axios.post('/run', tests); | ||
dispatch(action); | ||
} catch (e) { | ||
console.error('Failed to run all tests:', e); | ||
console.error('Error while running tests:', e); | ||
} | ||
@@ -41,20 +38,28 @@ }; | ||
export const runFailedTests = (fails) => { | ||
export const runAllTests = () => { | ||
return runTests({action: { | ||
type: actionNames.RUN_ALL_TESTS, | ||
payload: {status: QUEUED} | ||
}}); | ||
}; | ||
export const runFailedTests = (fails, actionName = actionNames.RUN_FAILED_TESTS) => { | ||
fails = filterFailedBrowsers([].concat(fails)); | ||
return async (dispatch) => { | ||
try { | ||
await axios.post('/run', fails); | ||
dispatch({type: actionNames.RUN_FAILED_TESTS}); | ||
} catch (e) { | ||
console.error('Error while running failed tests:', e); | ||
} | ||
}; | ||
return runTests({tests: fails, action: {type: actionName}}); | ||
}; | ||
export const retrySuite = (suite, browserId = null) => { | ||
return runFailedTests(assign({browserId}, suite)); | ||
export const retrySuite = (suite) => { | ||
return runTests({tests: [suite], action: {type: actionNames.RETRY_SUITE}}); | ||
}; | ||
export const retryTest = (suite, browserId = null) => { | ||
return runFailedTests(assign({browserId}, suite), actionNames.RETRY_TEST); | ||
}; | ||
export const acceptAll = (fails, actionName = actionNames.ACCEPT_ALL) => { | ||
if (actionName === actionNames.ACCEPT_ALL) { | ||
fails = filterAcceptableBrowsers([].concat(fails)); | ||
} | ||
const formattedFails = flatMap([].concat(fails), formatTests); | ||
@@ -72,4 +77,4 @@ | ||
export const acceptSuite = (suite, browserId, attempt) => { | ||
return acceptAll(assign({browserId}, suite, {acceptSuiteAttempt: attempt}), actionNames.ACCEPT_SUITE); | ||
export const acceptTest = (suite, browserId, attempt) => { | ||
return acceptAll(assign({browserId}, suite, {acceptTestAttempt: attempt}), actionNames.ACCEPT_TEST); | ||
}; | ||
@@ -113,3 +118,3 @@ | ||
const {suitePath, name, acceptSuiteAttempt} = test; | ||
const {suitePath, name, acceptTestAttempt} = test; | ||
@@ -125,3 +130,3 @@ return flatMap(test.browsers, (browser) => { | ||
assertViewState, | ||
attempt: acceptSuiteAttempt >= 0 ? acceptSuiteAttempt : attempt | ||
attempt: acceptTestAttempt >= 0 ? acceptTestAttempt : attempt | ||
}; | ||
@@ -131,7 +136,7 @@ }); | ||
function filterFailedBrowsers(suites = []) { | ||
function filterBrowsers(suites = [], filterFn) { | ||
const modifySuite = (suite) => { | ||
return suite.children | ||
? flatMap(suite.children, modifySuite) | ||
: set(suite, 'browsers', filter(suite.browsers, ({result}) => isSuiteFailed(result))); | ||
: set(suite, 'browsers', filter(suite.browsers, ({result}) => filterFn(result))); | ||
}; | ||
@@ -141,1 +146,9 @@ | ||
} | ||
function filterFailedBrowsers(suites = []) { | ||
return filterBrowsers(suites, isSuiteFailed); | ||
} | ||
function filterAcceptableBrowsers(suites = []) { | ||
return filterBrowsers(suites, isAcceptable); | ||
} |
@@ -5,3 +5,6 @@ 'use strict'; | ||
const {isSuccessStatus, isFailStatus, isErroredStatus, isSkippedStatus, isUpdatedStatus} = require('../../common-utils'); | ||
const {getCommonErrors} = require('../../constants/errors'); | ||
const {NO_REF_IMAGE_ERROR} = getCommonErrors(); | ||
function hasFails(node) { | ||
@@ -18,2 +21,8 @@ const {result} = node; | ||
function isAcceptable({status, reason = ''}) { | ||
const stack = reason && reason.stack; | ||
return isErroredStatus(status) && stack.startsWith(NO_REF_IMAGE_ERROR) || isFailStatus(status); | ||
} | ||
function hasRetries(node) { | ||
@@ -94,2 +103,3 @@ const isRetried = node.retries && node.retries.length; | ||
isSuiteFailed, | ||
isAcceptable, | ||
hasRetries, | ||
@@ -96,0 +106,0 @@ allSkipped, |
{ | ||
"name": "html-reporter", | ||
"version": "2.12.0", | ||
"version": "2.12.1", | ||
"description": "Plugin for gemini and hermione which is intended to aggregate the results of tests running into html report", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6379238
7414
0