Skip to content

Commit 1cf6c11

Browse files
author
rocketraccoon
committed
feat(visual-checks-retry): visual checks retry button #1
1 parent 3437d0b commit 1cf6c11

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎lib/static/modules/reducers/tree/index.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ export default ((state, action) => {
327327
switch (action.type) {
328328
case actionNames.TEST_BEGIN: {
329329
[].concat(action.payload).forEach(({result, suites}) => {
330+
addResult(draft.tree, result);
330331
setBrowsersLastRetry(draft.tree, result.parentId);
331332
updateSuitesStatus(draft.tree, suites);
332333
});

‎lib/static/new-ui/features/suites/components/TestInfo/index.tsx‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,28 @@ export function TestInfo(): ReactNode {
2323

2424
const shouldShowPlayer = isPlayerAvailable && isPlayerVisible;
2525

26-
if (isRunning) {
27-
return <RunTestLoading />;
28-
}
29-
3026
return <>
3127
<CollapsibleSection id={'actions'} title={'Actions'}>
3228
<div className={styles.stepsContainer}>
33-
{steps.length > 0 ?
29+
{steps.length > 0 ? (
3430
<ErrorHandler.Boundary watchFor={[currentResult]} fallback={<ErrorHandler.FallbackDataCorruption />}>
3531
<TestSteps className={styles.stepsListContainer}/>
36-
</ErrorHandler.Boundary> :
37-
<div className={styles.emptyStepsContainer}>No steps to show</div>
32+
</ErrorHandler.Boundary>
33+
) : (
34+
isRunning ? (
35+
<RunTestLoading />
36+
) : (
37+
<div className={styles.emptyStepsContainer}>No steps to show</div>
38+
)
39+
)
3840
}
3941
{isPlayerAvailable && <div className={classNames(styles.sticky, !shouldShowPlayer && styles.hidden)}>
4042
<SnapshotsPlayer/>
4143
</div>}
4244
</div>
4345
</CollapsibleSection>
4446
<CollapsibleSection id={'metadata'} title={'Metadata'}>
45-
{currentResult && !isRunning && <div className={styles['collapsible-section__body']}>
47+
{currentResult && <div className={styles['collapsible-section__body']}>
4648
<MetaInfo resultId={currentResult.id}/>
4749
</div>}
4850
</CollapsibleSection>

‎lib/static/new-ui/features/visual-checks/selectors.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export const getNamedImages = createSelector(
5959
const browser = browsers[group.browserId];
6060
const lastResultId = browser.resultIds[browser.resultIds.length - 1];
6161
const lastResult = results[lastResultId];
62-
if (!lastResult.imageIds.find(imageId => images[imageId].stateName === group.stateName)) {
62+
63+
if (lastResult.status !== TestStatus.RUNNING && !lastResult.imageIds.find(imageId => images[imageId].stateName === group.stateName)) {
6364
continue;
6465
}
6566

‎test/unit/lib/static/modules/reducers/tree/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ describe('lib/static/modules/reducers/tree', () => {
794794
});
795795
});
796796

797-
[actionNames.TEST_RESULT, actionNames.COMMIT_ACCEPTED_IMAGES_TO_TREE].forEach((actionName) => {
797+
[actionNames.TEST_BEGIN, actionNames.TEST_RESULT, actionNames.COMMIT_ACCEPTED_IMAGES_TO_TREE].forEach((actionName) => {
798798
describe(`${actionName} action`, () => {
799799
it('should change "retryIndex" in browser state', () => {
800800
const suitesById = {...mkSuite({id: 's1', browserIds: ['b1']})};

0 commit comments

Comments
 (0)