+const TopNavbar = ({ toolbarStyle, children = null }) => (
+
+
@@ -44,4 +38,6 @@ export default connector(({
-));
+);
+
+export default connector(TopNavbar);
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/AutoSelectRedirect.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/AutoSelectRedirect.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/AutoSelectRedirect.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/AutoSelectRedirect.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/BoundStyledListGroupItemLink.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/BoundStyledListGroupItemLink.test.jsx
similarity index 68%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/BoundStyledListGroupItemLink.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/BoundStyledListGroupItemLink.test.jsx
index 68f531d62..861744739 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/BoundStyledListGroupItemLink.test.jsx
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/BoundStyledListGroupItemLink.test.jsx
@@ -1,14 +1,14 @@
///
import React from 'react';
-import { BoundStyledListGroupItemLink } from '../';
+import { NavSidebarEntry } from '../';
import { shallow, mount, render } from 'enzyme';
import { StyleSheetTestUtils } from 'aphrodite';
-describe('BoundStyledListGroupItemLink', () => {
+describe('NavSidebarEntry', () => {
beforeEach(() => StyleSheetTestUtils.suppressStyleInjection());
afterEach(() => StyleSheetTestUtils.clearBufferAndResumeStyleInjection());
it('renders correctly', () => {
- const tree = renderer.create(
).toJSON();
+ const tree = renderer.create(
).toJSON();
expect(tree).toMatchSnapshot();
});
});
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/CenterPane.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/CenterPane.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/CenterPane.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/CenterPane.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/DisplayEmptyCheckBox.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/DisplayEmptyCheckBox.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/DisplayEmptyCheckBox.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/DisplayEmptyCheckBox.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/DocumentationButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/DocumentationButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/DocumentationButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/DocumentationButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/EmptyListGroupItem.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/EmptyListGroupItem.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/EmptyListGroupItem.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/EmptyListGroupItem.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/FilterButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/FilterButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/FilterButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/FilterButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/FilterRadioButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/FilterRadioButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/FilterRadioButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/FilterRadioButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/HelpButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/HelpButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/HelpButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/HelpButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/HelpModal.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/HelpModal.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/HelpModal.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/HelpModal.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoModal.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoModal.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoModal.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoModal.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoTable.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoTable.test.jsx
similarity index 95%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoTable.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoTable.test.jsx
index f95adcfc1..36b8b414b 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/InfoTable.test.jsx
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/InfoTable.test.jsx
@@ -5,7 +5,7 @@ import { render } from '@testing-library/react';
import { StyleSheetTestUtils } from 'aphrodite';
import { InfoTable } from '../';
import useReportState from '../../hooks/useReportState';
-import { filterObjectDeep } from '../../../../__tests__/testUtils';
+import { filterObjectDeep } from '../../../../Common/testUtils';
import { TESTPLAN_REPORT_2 } from '../../../../__tests__/documents';
jest.mock('../../hooks/useReportState');
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumb.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumb.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumb.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumb.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumbContainer.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumbContainer.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumbContainer.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumbContainer.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumbWithNextRoute.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumbWithNextRoute.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavBreadcrumbWithNextRoute.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavBreadcrumbWithNextRoute.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavPanes.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavPanes.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavPanes.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavPanes.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavSidebar.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavSidebar.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavSidebar.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavSidebar.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavSidebarWithNextRoute.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavSidebarWithNextRoute.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/NavSidebarWithNextRoute.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/NavSidebarWithNextRoute.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/PrintButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/PrintButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/PrintButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/PrintButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/StyledListGroupItemLink.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/StyledListGroupItemLink.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/StyledListGroupItemLink.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/StyledListGroupItemLink.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/StyledNavLink.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/StyledNavLink.test.jsx
similarity index 96%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/StyledNavLink.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/StyledNavLink.test.jsx
index 653e959ab..aaabbc777 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/StyledNavLink.test.jsx
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/StyledNavLink.test.jsx
@@ -16,7 +16,7 @@ import {
} from '../../../../__tests__/testUtils';
import { filterObjectDeep } from '../../../../__tests__/testUtils';
import { findAllDeep } from '../../../../__tests__/testUtils';
-import { navUtilsStyles } from '../../style';
+import { navUtilsStyles } from '../../styles';
import { actionTypes } from '../../state';
import { createMemoryHistory, createLocation, createPath } from 'history';
import { TESTPLAN_REPORT_1 } from '../../../../__tests__/documents';
@@ -145,14 +145,14 @@ global.env = {
describe.each(SAMPLE_TESTCASES)(
'
with report %j',
- (selectedTestCase) => {
+ (selectedEntry) => {
const expectedHookArgs = [ APP_BATCHREPORT_SELECTED_TEST_CASE ];
beforeAll(() => {
useReportState
.mockName('useReportState')
- .mockReturnValue([ selectedTestCase ]);
+ .mockReturnValue([ selectedEntry ]);
StyleSheetTestUtils.suppressStyleInjection();
});
@@ -214,6 +214,7 @@ describe.each(SAMPLE_TESTCASES)(
pathname: toPathname,
search: global.env.history.location.search,
});
+ // TODO: remove toHaveAttribute
expect(anchors[0]).toHaveAttribute('href', expectedFullHref);
global.env.linkElem = anchors[0];
});
@@ -224,6 +225,7 @@ describe.each(SAMPLE_TESTCASES)(
expect(useReportState).toHaveBeenCalledTimes(1); // no change
global.env.history.push(currURL);
const { search: expectedNewQueryParams } = createLocation(currURL);
+ // TODO: remove toHaveAttribute
expect(global.env.linkElem).toHaveAttribute(
'href', createPath({
pathname: toPathname,
@@ -234,14 +236,16 @@ describe.each(SAMPLE_TESTCASES)(
});
const isCurrUID =
- selectedTestCase !== null && toUID === selectedTestCase.uid,
+ selectedEntry !== null && toUID === selectedEntry.uid,
repl1 = isCurrUID ? '' : 'in',
repl2 = isCurrUID ? '=' : '!';
it(`has ${repl1}active classes since testcase UID ${repl2}== currUID`,
() => {
if(isCurrUID) {
+ // TODO: remove toHaveClass
expect(global.env.linkElem).toHaveClass(IS_ACTIVE_CLASSES);
} else {
+ // TODO: remove toHaveClass
expect(global.env.linkElem).not.toHaveClass(IS_ACTIVE_CLASSES);
}
},
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/TagsButton.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/TagsButton.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/TagsButton.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/TagsButton.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/Toolbar.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/Toolbar.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/Toolbar.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/Toolbar.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/TopNavbar.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/TopNavbar.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/TopNavbar.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/TopNavbar.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/UIRouter.test.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/UIRouter.test.jsx
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/components/__tests__/UIRouter.test.jsx
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/components/__tests__/UIRouter.test.jsx
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/index.jsx b/testplan/web_ui/testing/src/Report/BatchReportBeta/index.jsx
new file mode 100644
index 000000000..77b6ad1c2
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/index.jsx
@@ -0,0 +1,49 @@
+import React from 'react';
+import connect from 'react-redux/es/connect/connect';
+import { Router } from 'react-router';
+import { mkGetSkipFetch } from '../../state/appSelectors';
+import CenterPane from './components/CenterPane';
+import Toolbar from './components/Toolbar';
+import uiHistory from './state/uiHistory';
+import NavPanes from './components/NavPanes';
+import { BATCH_REPORT_CLASSES } from './styles';
+import { fetchReport } from './state/reportActions';
+
+const connector = connect(
+ () => {
+ const getSkipFetch = mkGetSkipFetch();
+ return state => ({ skipFetch: getSkipFetch(state) });
+ },
+ { boundFetchReport: fetchReport },
+ (stateProps, dispatchProps, ownProps) => {
+ const { skipFetch: isSkipFetch = false } = stateProps;
+ const { boundFetchReport } = dispatchProps;
+ const { browserRenderProps: { match: { params: { uid } } } } = ownProps;
+ return { boundFetchReport, uid, isSkipFetch };
+ }
+);
+
+const BatchReportInner = ({ boundFetchReport, uid, isSkipFetch }) => {
+ React.useEffect(() => {
+ if(!isSkipFetch) {
+ return boundFetchReport(uid).abort;
+ }
+ }, [ uid, isSkipFetch, boundFetchReport ]);
+ return (
+
+
+
+
+
+ );
+};
+
+const ConnectedBatchReportInner = connector(BatchReportInner);
+
+export default function BatchReport(props) {
+ return (
+
+
+
+ );
+}
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/reportSlice.test.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/reportSlice.test.js
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/reportSlice.test.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/reportSlice.test.js
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/uiSlice.test.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/uiSlice.test.js
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/uiSlice.test.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/uiSlice.test.js
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useFetchReport.test.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useFetchReport.test.js
similarity index 100%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useFetchReport.test.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useFetchReport.test.js
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useReportState.test.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useReportState.test.js
similarity index 99%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useReportState.test.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useReportState.test.js
index a40de8be4..b0a4604b8 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useReportState.test.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useReportState.test.js
@@ -11,7 +11,7 @@ import {
} from '../../state';
import {
randomSamples, getPaths,
-} from '../../../../__tests__/testUtils';
+} from '../../../../Common/testUtils';
const HookWrapper = props => (
);
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useTargetEntry.test.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useTargetEntry.test.js
similarity index 99%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useTargetEntry.test.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useTargetEntry.test.js
index fdd10c620..8009b5550 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/__tests__/useTargetEntry.test.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/__tests__/useTargetEntry.test.js
@@ -7,7 +7,7 @@ import { createMemoryHistory } from 'history';
import useTargetEntry from '../useTargetEntry';
import {
deriveURLPathsFromReport,
-} from '../../../../__tests__/testUtils';
+} from '../../../../Common/testUtils';
import { TESTPLAN_REPORT_1 } from '../../../../__tests__/documents';
import { TESTPLAN_REPORT_2 } from '../../../../__tests__/documents';
import { SIMPLE_REPORT } from '../../../../__tests__/documents';
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/fetchReport.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/fetchReport.js
new file mode 100644
index 000000000..7b41450a0
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/fetchReport.js
@@ -0,0 +1,71 @@
+import { createAsyncThunk } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import _isObject from 'lodash/isObject';
+import _isNil from 'lodash/isNil';
+import { getReportUid } from '../reportSelectors';
+import { getReportAxiosPartialConfig } from '../reportSelectors';
+import { getReportIsFetching } from '../reportSelectors';
+import { getReportDocument } from '../reportSelectors';
+import { getReportLastFetchError } from '../reportSelectors';
+import { getReportIsFetchCancelled } from '../reportSelectors';
+import { PropagateIndices } from '../../../reportUtils';
+
+export const REPORT_FETCH_CANCEL = 'REPORT_FETCH_CANCEL';
+
+export default createAsyncThunk(
+ 'report/FETCH_REPORT',
+ async (reportUid, { dispatch, getState, signal, rejectWithValue }) => {
+ const { setReportUID, setLastResponseContentLength } = await import('./');
+ const { default: Axios } = await import('axios');
+ try {
+ // setup fetch
+ dispatch(setReportUID(reportUid));
+ const cancelSource = Axios.CancelToken.source();
+ const axiosInstance = Axios.create({
+ ...getReportAxiosPartialConfig(getState()),
+ cancelToken: cancelSource.token,
+ });
+ signal.addEventListener('abort', () => {
+ cancelSource.cancel('The fetch was cancelled.');
+ });
+ // execute fetch
+ // https://github.com/axios/axios#response-schema
+ const { data, headers } = await axiosInstance.get(`/${reportUid}`);
+ dispatch(setLastResponseContentLength(headers['content-length']));
+ // process response
+ return PropagateIndices(data);
+ } catch(err) {
+ if(Axios.isCancel(err)) {
+ return rejectWithValue(REPORT_FETCH_CANCEL);
+ } else {
+ return rejectWithValue({
+ name: err.name || '',
+ message: err.message || '',
+ stack: err.stack || '',
+ });
+ }
+ }
+ },
+ // @ts-ignore
+ {
+ condition(reportUid, { getState }) {
+ // don't fetch if sought doc is already in memory
+ const currReportUid = getReportUid(getState());
+ const isFetching = getReportIsFetching(getState());
+ // same doc is currently fetching
+ if(reportUid === currReportUid && isFetching) {
+ return false;
+ }
+ const currDoc = getReportDocument(getState());
+ // same doc has been fetched
+ if(_isObject(currDoc)) {
+ const wasCancelled = getReportIsFetchCancelled(getState());
+ const hadError = !_isNil(getReportLastFetchError(getState()));
+ if(!wasCancelled && !hadError) {
+ return false;
+ }
+ }
+ return true;
+ },
+ dispatchConditionRejection: false,
+ }
+);
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/reportActions/index.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/index.js
similarity index 79%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/reportActions/index.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/index.js
index 2ce361c7f..214c95a18 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/reportActions/index.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportActions/index.js
@@ -1,8 +1,7 @@
import reportSlice from '../reportSlice';
export const {
- setMaxContentLength,
- setDownloadProgress,
+ setLastResponseContentLength,
setReportUID,
setFetchTimeout,
} = reportSlice.actions;
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSelectors.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSelectors.js
new file mode 100644
index 000000000..aafdba74d
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSelectors.js
@@ -0,0 +1,64 @@
+import { createSelector } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import { mkGetApiBaseURL } from '../../../state/appSelectors';
+import { getApiHeaders } from '../../../state/appSelectors';
+
+export const mkGetReportState = () => state => state.report;
+
+export const mkGetLastResponseContentLength = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.lastResponseContentLength,
+);
+export const getLastResponseContentLength = mkGetLastResponseContentLength();
+
+export const mkGetReportUid = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.uid,
+);
+export const getReportUid = mkGetReportUid();
+
+export const mkGetReportDocument = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.document,
+);
+export const getReportDocument = mkGetReportDocument();
+
+export const mkGetReportIsFetching = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.isFetching,
+);
+export const getReportIsFetching = mkGetReportIsFetching();
+
+export const mkGetReportIsFetchCancelled = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.isFetchCancelled,
+);
+export const getReportIsFetchCancelled = mkGetReportIsFetchCancelled();
+
+export const mkGetReportLastFetchError = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.fetchError,
+);
+export const getReportLastFetchError = mkGetReportLastFetchError();
+
+export const mkGetReportFetchTimeout = () => createSelector(
+ mkGetReportState(),
+ rptState => rptState.fetchTimeout,
+);
+export const getReportFetchTimeout = mkGetReportFetchTimeout();
+
+export const mkGetReportApiBaseURL = () => createSelector(
+ mkGetApiBaseURL(),
+ baseURL => {
+ const baseURLShaven = (baseURL || '').replace(/\/$/, '');
+ return new URL(`${baseURLShaven}/reports`).href;
+ }
+);
+export const getReportApiBaseURL = mkGetReportApiBaseURL();
+
+export const mkGetReportAxiosPartialConfig = () => createSelector(
+ getReportApiBaseURL,
+ getReportFetchTimeout,
+ getApiHeaders,
+ (baseURL, timeout, headers) => ({ baseURL, timeout, headers })
+);
+export const getReportAxiosPartialConfig = mkGetReportAxiosPartialConfig();
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/reportSlice.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSlice.js
similarity index 73%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/reportSlice.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSlice.js
index 3d0f2ade5..76fffe305 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/reportSlice.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/reportSlice.js
@@ -3,9 +3,7 @@ import _isObject from 'lodash/isObject';
import { createSlice } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
import fetchReport, { REPORT_FETCH_CANCEL } from './reportActions/fetchReport';
-const DEFAULT_TIMEOUT = 3_000;
-const DEFAULT_MAX_CONTENT_LENGTH = Infinity;
-const INIT_PROGRESS = { loaded: 0, total: -1, lengthComputable: false };
+const DEFAULT_TIMEOUT = 60_000;
export default createSlice({
name: 'report',
@@ -15,19 +13,10 @@ export default createSlice({
isFetching: false,
isFetchCancelled: false,
fetchError: null,
- maxContentLength: DEFAULT_MAX_CONTENT_LENGTH,
fetchTimeout: DEFAULT_TIMEOUT,
- downloadProgress: INIT_PROGRESS,
+ lastResponseContentLength: null,
},
reducers: {
- setMaxContentLength: {
- reducer(state, { payload }) { state.maxContentLength = payload; },
- prepare: (length = DEFAULT_MAX_CONTENT_LENGTH) => ({ payload: length }),
- },
- setDownloadProgress: {
- reducer(state, { payload }) { state.downloadProgress = payload; },
- prepare: (progress = INIT_PROGRESS) => ({ payload: progress }),
- },
setReportUID: {
reducer(state, { payload }) { state.uid = payload; },
prepare: (uid = null) => ({ payload: uid }),
@@ -36,11 +25,22 @@ export default createSlice({
reducer(state, { payload }) { state.fetchTimeout = payload; },
prepare: (timeout = DEFAULT_TIMEOUT) => ({ payload: timeout }),
},
+ setLastResponseContentLength: {
+ reducer(state, { payload }) {
+ state.lastResponseContentLength = payload;
+ },
+ prepare: (contentLength = 0) => ({
+ payload: typeof contentLength === 'string'
+ ? parseInt(contentLength)
+ : contentLength,
+ }),
+ },
},
extraReducers: {
[fetchReport.pending.type](state) {
state.isFetching = true;
state.isFetchCancelled = false;
+ state.fetchError = null;
},
[fetchReport.fulfilled.type](state, action) {
state.isFetching = false;
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/uiActions.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/index.js
similarity index 70%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/uiActions.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/index.js
index b9dd44289..455f7f3e7 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/uiActions.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/index.js
@@ -1,5 +1,6 @@
-import uiSlice from './uiSlice';
+import uiSlice from '../uiSlice';
+export { default as setSelectedEntry } from './setSelectedEntry';
export const {
setShowTags,
setShowInfoModal,
@@ -10,5 +11,4 @@ export const {
setHashComponentAlias,
unsetHashComponentAliasByAlias,
unsetHashComponentAliasByComponent,
- setSelectedTestCase,
} = uiSlice.actions;
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/setSelectedEntry.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/setSelectedEntry.js
new file mode 100644
index 000000000..64596929f
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiActions/setSelectedEntry.js
@@ -0,0 +1,52 @@
+// @ts-nocheck
+import { createAsyncThunk } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import { batch } from 'react-redux/es';
+import _isPlainObject from 'lodash/isPlainObject';
+import _isString from 'lodash/isString';
+import { getUIHashAliasToComponent } from '../uiSelectors';
+import { getUISelectedEntry } from '../uiSelectors';
+import { getUIIsSettingSelectedEntry } from '../uiSelectors';
+import uriComponentCodec from '../../../../Common/uriComponentCodec';
+
+const _SET_ENTRY_QUEUE = [];
+
+const setSelectedEntry = createAsyncThunk(
+ 'ui/setSelectedEntry',
+ async (entry, { dispatch, getState, rejectWithValue }) => {
+ try {
+ if(!_isPlainObject(entry)) return;
+ const { setHashComponentAlias } = await import('./');
+ return batch(() => {
+ const aliasToComponent = getUIHashAliasToComponent(getState());
+ const entryName = entry.name;
+ if(_isString(entryName) && !(entryName in aliasToComponent)) {
+ const encodedName = uriComponentCodec.encode(entryName);
+ dispatch(setHashComponentAlias(encodedName, entryName));
+ }
+ if(_SET_ENTRY_QUEUE.length) {
+ queueMicrotask(() => {
+ dispatch(setSelectedEntry(_SET_ENTRY_QUEUE.splice(0, 1)[0]));
+ });
+ }
+ return entry;
+ });
+ } catch(err) {
+ const { name, message, stack } = err;
+ return rejectWithValue({ name, message, stack });
+ }
+ },
+ {
+ condition: (entry, { getState }) => {
+ if(getUISelectedEntry(getState()) === entry) {
+ return false;
+ }
+ if(getUIIsSettingSelectedEntry(getState())) {
+ _SET_ENTRY_QUEUE.push(entry);
+ }
+ return true;
+ },
+ dispatchConditionRejection: false,
+ },
+);
+
+export default setSelectedEntry;
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiHistory.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiHistory.js
new file mode 100644
index 000000000..d012603a7
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiHistory.js
@@ -0,0 +1,3 @@
+import { createHashHistory } from 'history';
+
+export default createHashHistory({ basename: '/' });
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiMiddleware.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiMiddleware.js
new file mode 100644
index 000000000..12d08330e
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiMiddleware.js
@@ -0,0 +1,3 @@
+import uiQueryParamsRegistry from './uiQueryParamsRegistry';
+
+export default uiQueryParamsRegistry.createMiddleware();
diff --git a/testplan/web_ui/testing/src/Report/BatchReport/state/uiMiddleware.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiQueryParamsRegistry.js
similarity index 83%
rename from testplan/web_ui/testing/src/Report/BatchReport/state/uiMiddleware.js
rename to testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiQueryParamsRegistry.js
index 2f034b964..048895d4d 100644
--- a/testplan/web_ui/testing/src/Report/BatchReport/state/uiMiddleware.js
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiQueryParamsRegistry.js
@@ -1,5 +1,5 @@
import URLParamRegistry from '../../../Common/URLParamRegistry';
-import { uiHistory } from './UIRouter';
+import uiHistory from './uiHistory';
import { setShowTags } from './uiActions';
import { setShowInfoModal } from './uiActions';
import { setDoAutoSelect } from './uiActions';
@@ -10,8 +10,7 @@ import { setShowHelpModal } from './uiActions';
export default new URLParamRegistry(uiHistory)
.registerBidirectionalListener('showTags', setShowTags)
.registerBidirectionalListener('showInfoModal', setShowInfoModal)
- .registerBidirectionalListener('doAutoSelect', setDoAutoSelect)
+ .registerQueryParamListener('doAutoSelect', setDoAutoSelect)
.registerBidirectionalListener('filter', setFilter)
.registerBidirectionalListener('displayEmpty', setDisplayEmpty)
- .registerBidirectionalListener('showHelpModal', setShowHelpModal)
- .createMiddleware();
+ .registerBidirectionalListener('showHelpModal', setShowHelpModal);
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSelectors.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSelectors.js
new file mode 100644
index 000000000..c90ddc1c2
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSelectors.js
@@ -0,0 +1,74 @@
+import { createSelector } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import { css } from 'aphrodite/es';
+import { mkGetReportDocument } from './reportSelectors';
+import navStyles from '../../../Toolbar/navStyles';
+import { STATUS_CATEGORY } from '../../../Common/defaults';
+
+export const mkGetUIState = () => state => state.ui;
+
+export const mkGetUIHashAliasToComponent = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.hashAliasToComponent,
+);
+export const getUIHashAliasToComponent = mkGetUIHashAliasToComponent();
+
+export const mkGetUIHashComponentToAlias = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.hashComponentToAlias,
+);
+
+export const mkGetUIIsShowHelpModal = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.isShowHelpModal,
+);
+
+export const mkGetUIIsDisplayEmpty = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.isDisplayEmpty,
+);
+
+export const mkGetUIFilter = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.filter,
+);
+
+export const mkGetUIIsShowTags = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.isShowTags,
+);
+
+export const mkGetUIIsShowInfoModal = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.isShowInfoModal,
+);
+
+export const mkGetUISelectedEntry = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.selectedEntry,
+);
+export const getUISelectedEntry = mkGetUISelectedEntry();
+
+export const mkGetUIDoAutoSelect = () => createSelector(
+ mkGetUIState(),
+ uiState => uiState.doAutoSelect,
+);
+
+export const mkGetUIToolbarStyle = () => createSelector(
+ mkGetReportDocument(),
+ document => css(
+ navStyles.toolbar,
+ {
+ passed: navStyles.toolbarPassed,
+ failed: navStyles.toolbarFailed,
+ error: navStyles.toolbarFailed,
+ unstable: navStyles.toolbarUnstable,
+ }[STATUS_CATEGORY[(document || {}).status]] || navStyles.toolbarUnknown
+ )
+);
+export const getUIToolbarStyle = mkGetUIToolbarStyle();
+
+export const mkGetUIIsSettingSelectedEntry = () => createSelector(
+ mkGetUIState(),
+ uiState => !!uiState.isSettingSelectedEntry,
+);
+export const getUIIsSettingSelectedEntry = mkGetUIIsSettingSelectedEntry();
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSlice.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSlice.js
new file mode 100644
index 000000000..a390a36e8
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/state/uiSlice.js
@@ -0,0 +1,108 @@
+// @ts-nocheck
+import _isObject from 'lodash/isObject';
+import { createSlice } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import * as filterStates from '../../../Common/filterStates';
+import { fetchReport } from './reportActions';
+import setSelectedEntry from './uiActions/setSelectedEntry';
+
+const __DEV__ = process.env.NODE_ENV !== 'production';
+
+/** This state slice contains information specific to how the UI should look */
+export default createSlice({
+ name: 'ui',
+ initialState: {
+ hashAliasToComponent: {},
+ hashComponentToAlias: {},
+ isShowHelpModal: false,
+ isDisplayEmpty: true,
+ filter: filterStates.ALL,
+ isShowTags: false,
+ isShowInfoModal: false,
+ selectedEntry: null,
+ isSettingSelectedEntry: false,
+ doAutoSelect: true,
+ },
+ reducers: {
+ setHashComponentAlias: {
+ reducer(state, { payload: { component, alias } }) {
+ state.hashAliasToComponent[alias] = component;
+ state.hashComponentToAlias[component] = alias;
+ },
+ prepare: (component, alias) => ({ payload: { component, alias } }),
+ },
+ unsetHashComponentAliasByAlias: {
+ reducer(state, { payload }) {
+ const aliasesArray = Array.isArray(payload) ? payload : [ payload ];
+ for(const alias of aliasesArray) {
+ const component = state.hashAliasToComponent[alias];
+ delete state.hashComponentToAlias[component];
+ delete state.hashAliasToComponent[alias];
+ }
+ },
+ prepare: (aliases = []) => ({ payload: aliases }),
+ },
+ unsetHashComponentAliasByComponent: {
+ reducer(state, { payload }) {
+ const componentsArray = Array.isArray(payload) ? payload : [ payload ];
+ for(const component of componentsArray) {
+ const alias = state.hashComponentToAlias[component];
+ delete state.hashAliasToComponent[alias];
+ delete state.hashComponentToAlias[component];
+ }
+ },
+ prepare: (components = []) => ({ payload: components }),
+ },
+ setShowTags: {
+ reducer(state, { payload }) { state.isShowTags = payload; },
+ prepare: (showTags = false) => ({ payload: !!showTags }),
+ },
+ setShowInfoModal: {
+ reducer(state, { payload }) { state.isShowInfoModal = payload; },
+ prepare: (showInfoModal = false) => ({ payload: !!showInfoModal }),
+ },
+ setDoAutoSelect: {
+ reducer(state, { payload }) { state.doAutoSelect = payload; },
+ prepare: (doAutoSelect = true) => ({ payload: !!doAutoSelect }),
+ },
+ setFilter: {
+ reducer(state, { payload }) { state.filter = payload; },
+ prepare: (filter = filterStates.ALL) => ({
+ payload: Object.values(filterStates).includes(filter)
+ ? filter
+ : filterStates.ALL
+ }),
+ },
+ setDisplayEmpty: {
+ reducer(state, { payload }) { state.isDisplayEmpty = payload; },
+ prepare: (displayEmpty = true) => ({ payload: !!displayEmpty }),
+ },
+ setShowHelpModal: {
+ reducer(state, { payload }) { state.isShowHelpModal = payload; },
+ prepare: (showHelpModal = false) => ({ payload: !!showHelpModal }),
+ },
+ },
+ extraReducers: {
+ [fetchReport.fulfilled.type](state, action) {
+ state.selectedEntry = action.payload;
+ },
+ [setSelectedEntry.pending.type](state) {
+ state.isSettingSelectedEntry = true;
+ },
+ [setSelectedEntry.fulfilled.type](state, action) {
+ state.isSettingSelectedEntry = false;
+ state.selectedEntry = action.payload;
+ },
+ [setSelectedEntry.rejected.type](state, action) {
+ state.isSettingSelectedEntry = false;
+ if(__DEV__) {
+ if(_isObject(action.error) && action.error.message === 'Rejected') {
+ // handled with rejectWithValue
+ console.warn(action.payload);
+ } else {
+ // unhandled
+ console.error(action.error);
+ }
+ }
+ }
+ },
+});
diff --git a/testplan/web_ui/testing/src/Report/BatchReportBeta/styles.js b/testplan/web_ui/testing/src/Report/BatchReportBeta/styles.js
new file mode 100644
index 000000000..a7e9c5f6a
--- /dev/null
+++ b/testplan/web_ui/testing/src/Report/BatchReportBeta/styles.js
@@ -0,0 +1,36 @@
+import { StyleSheet, css } from 'aphrodite/es';
+import navStyles from '../../Toolbar/navStyles';
+import { styles as navUtilsStyles } from '../../Nav/navUtils';
+
+export { default as CommonStyles } from '../../Common/Styles';
+export { styles as navBreadcrumbStyles } from '../../Nav/NavBreadcrumbs';
+export { navUtilsStyles };
+export { COLUMN_WIDTH } from '../../Common/defaults';
+
+export const navListStyles = StyleSheet.create({
+ buttonList: {
+ 'overflow-y': 'auto',
+ 'height': '100%',
+ }
+});
+
+export const batchReportStyles = StyleSheet.create({
+ batchReport: {
+ /** overflow will hide dropdown div */
+ // overflow: 'hidden'
+ }
+});
+
+export const BATCH_REPORT_CLASSES = css(batchReportStyles.batchReport);
+export const TOOLBAR_CLASSES = css(navStyles.toolbar);
+export const TOOLBAR_BUTTON_CLASSES = css(navStyles.toolbarButton);
+export const BUTTONS_BAR_CLASSES = css(navStyles.buttonsBar);
+export const FILTER_BOX_CLASSES = css(navStyles.filterBox);
+export const FILTER_DROPDOWN_CLASSES = css(navStyles.filterDropdown);
+export const FILTER_LABEL_CLASSES = css(navStyles.filterLabel);
+export const DROPDOWN_ITEM_CLASSES = css(navStyles.dropdownItem);
+export const ACTIVE_LINK_CLASSES = css(navUtilsStyles.navButtonInteract);
+export const UNDECORATED_LINK_STYLE = {
+ textDecoration: 'none',
+ color: 'currentColor',
+};
diff --git a/testplan/web_ui/testing/src/Report/InteractiveReport.js b/testplan/web_ui/testing/src/Report/InteractiveReport.js
index 2ececfc9a..a91c808a6 100644
--- a/testplan/web_ui/testing/src/Report/InteractiveReport.js
+++ b/testplan/web_ui/testing/src/Report/InteractiveReport.js
@@ -1,5 +1,3 @@
-// @ts-nocheck
-/* eslint-disable @typescript-eslint/unbound-method */
/**
* InteractiveReport: Renders an Interactive report, which is used to control
* test environments and run tests interactively. Requires the Testplan
@@ -9,18 +7,18 @@ import React from 'react';
import { StyleSheet, css } from 'aphrodite';
import axios from 'axios';
-import Toolbar from '../Toolbar/Toolbar';
+import Toolbar from '../Toolbar/Toolbar.js';
import { ResetButton } from '../Toolbar/InteractiveButtons';
-import InteractiveNav from '../Nav/InteractiveNav';
+import InteractiveNav from '../Nav/InteractiveNav.js';
import { INTERACTIVE_COL_WIDTH } from "../Common/defaults";
-import { FakeInteractiveReport } from '../__tests__/documents';
+import { FakeInteractiveReport } from '../Common/sampleReports.js';
import {
PropagateIndices,
UpdateSelectedState,
GetReportState,
GetCenterPane,
GetSelectedEntries,
-} from './reportUtils';
+} from './reportUtils.js';
/**
* Interactive report viewer. As opposed to a batch report, an interactive
@@ -62,7 +60,7 @@ class InteractiveReport extends React.Component {
* If running in dev mode we just display a fake report.
*/
getReport() {
- if(this.props.dev) {
+ if (this.props.dev) {
setTimeout(
() => this.setState({
report: FakeInteractiveReport,
@@ -74,8 +72,8 @@ class InteractiveReport extends React.Component {
} else {
axios.get('/api/v1/interactive/report')
.then(response => {
- if(!this.state.report ||
- this.state.report.hash !== response.data.hash) {
+ if (!this.state.report ||
+ this.state.report.hash !== response.data.hash) {
this.getTests().then(tests => {
const rawReport = { ...response.data, entries: tests };
const processedReport = PropagateIndices(rawReport);
@@ -96,7 +94,7 @@ class InteractiveReport extends React.Component {
});
// We poll for updates to the report every second.
- if(this.props.poll_ms) {
+ if (this.props.poll_ms) {
setTimeout(this.getReport, this.props.poll_ms);
}
}
@@ -373,8 +371,8 @@ class InteractiveReport extends React.Component {
* Handle an environment toggle button being clicked on a Nav entry.
*
* @param {object} e - Click event
- * @param {object} reportEntry - entry in the report whose environment
- * has been toggled.
+ * @param {ReportNode} reportEntry - entry in the report whose environment
+ * has been toggled.
* @param {string} action - What action to take on the environment, expected
* to be one of "start" or "stop".
*/
diff --git a/testplan/web_ui/testing/src/Report/__tests__/BatchReport.test.js b/testplan/web_ui/testing/src/Report/__tests__/BatchReport.test.js
index e0f3e57c5..2dd6fda21 100644
--- a/testplan/web_ui/testing/src/Report/__tests__/BatchReport.test.js
+++ b/testplan/web_ui/testing/src/Report/__tests__/BatchReport.test.js
@@ -2,10 +2,10 @@ import React from 'react';
import { shallow } from 'enzyme';
import { StyleSheetTestUtils } from "aphrodite";
import moxios from 'moxios';
+
import BatchReport from '../BatchReport';
import Message from '../../Common/Message';
-import { TESTPLAN_REPORT_1 } from '../../__tests__/documents';
-import { SIMPLE_REPORT } from '../../__tests__/documents';
+import { TESTPLAN_REPORT, SIMPLE_REPORT } from "../../Common/sampleReports";
describe('BatchReport', () => {
const renderBatchReport = (uid = "123") => {
@@ -35,7 +35,7 @@ describe('BatchReport', () => {
it('shallow renders the correct HTML structure when report loaded', () => {
const batchReport = renderBatchReport();
- batchReport.setState({ report: TESTPLAN_REPORT_1 });
+ batchReport.setState({ report: TESTPLAN_REPORT });
batchReport.update();
expect(batchReport).toMatchSnapshot();
});
@@ -88,7 +88,7 @@ describe('BatchReport', () => {
expect(request.url).toBe("/api/v1/reports/123");
request.respondWith({
status: 200,
- response: TESTPLAN_REPORT_1,
+ response: TESTPLAN_REPORT,
}).then(() => {
batchReport.update();
const selection = batchReport.state("selectedUIDs");
@@ -112,8 +112,8 @@ describe('BatchReport', () => {
const expectedMessage = 'Error: Request failed with status code 404';
expect(message.props().message).toEqual(expectedMessage);
done();
- });
- });
+ })
+ })
});
});
diff --git a/testplan/web_ui/testing/src/Report/__tests__/InteractiveReport.test.js b/testplan/web_ui/testing/src/Report/__tests__/InteractiveReport.test.js
index c277828ac..d5a35b521 100644
--- a/testplan/web_ui/testing/src/Report/__tests__/InteractiveReport.test.js
+++ b/testplan/web_ui/testing/src/Report/__tests__/InteractiveReport.test.js
@@ -4,7 +4,8 @@ import { shallow } from 'enzyme';
import { StyleSheetTestUtils } from "aphrodite";
import moxios from 'moxios';
-import InteractiveReport from '../InteractiveReport';
+import InteractiveReport from '../InteractiveReport.js';
+import { FakeInteractiveReport } from '../../Common/sampleReports.js';
const initialReport = () => ({
"category": "testplan",
diff --git a/testplan/web_ui/testing/src/Report/__tests__/reportUtils.test.js b/testplan/web_ui/testing/src/Report/__tests__/reportUtils.test.js
index 14627a493..ced909733 100644
--- a/testplan/web_ui/testing/src/Report/__tests__/reportUtils.test.js
+++ b/testplan/web_ui/testing/src/Report/__tests__/reportUtils.test.js
@@ -1,5 +1,7 @@
-import { PropagateIndices } from "../reportUtils";
-import { TESTPLAN_REPORT_1 } from '../../__tests__/documents';
+import React from 'react';
+
+import {TESTPLAN_REPORT} from "../../Common/sampleReports";
+import {PropagateIndices} from "../reportUtils";
describe('Report/reportUtils', () => {
@@ -13,7 +15,7 @@ describe('Report/reportUtils', () => {
let testplanEntries = {};
beforeEach(() => {
- report = PropagateIndices(TESTPLAN_REPORT_1);
+ report = PropagateIndices(TESTPLAN_REPORT);
multitest = report.entries[0];
suiteA = multitest.entries[0];
suiteB = multitest.entries[1];
@@ -68,7 +70,7 @@ describe('Report/reportUtils', () => {
[
[
'testplan',
- new Set([
+ [
'Sample Testplan|testplan',
'Primary|multitest',
'AlphaSuite|testsuite',
@@ -77,37 +79,37 @@ describe('Report/reportUtils', () => {
'BetaSuite|testsuite',
'Secondary|multitest',
'GammaSuite|testsuite',
- ]),
+ ],
],
[
'multitest',
- new Set([
+ [
'Primary|multitest',
'Sample Testplan|testplan',
'AlphaSuite|testsuite',
'test_equality_passing|testcase',
'test_equality_passing2|testcase',
'BetaSuite|testsuite',
- ]),
+ ],
],
[
'testsuite',
- new Set([
+ [
'AlphaSuite|testsuite',
'Primary|multitest',
'Sample Testplan|testplan',
'test_equality_passing|testcase',
'test_equality_passing2|testcase',
- ]),
+ ],
],
[
'testcase',
- new Set([
+ [
'test_equality_passing|testcase',
'AlphaSuite|testsuite',
'Primary|multitest',
'Sample Testplan|testplan',
- ]),
+ ],
],
].forEach(([entryType, nameTypeIndex]) => {
it(`${entryType} name_type_index - stores ancestors & ` +
diff --git a/testplan/web_ui/testing/src/Report/reportUtils.js b/testplan/web_ui/testing/src/Report/reportUtils.js
index d8179c168..e55b24cfc 100644
--- a/testplan/web_ui/testing/src/Report/reportUtils.js
+++ b/testplan/web_ui/testing/src/Report/reportUtils.js
@@ -1,7 +1,8 @@
/**
* Report utility functions.
*/
-import React from 'react';
+import React from "react";
+import _uniq from 'lodash/uniq';
import AssertionPane from '../AssertionPane/AssertionPane';
import Message from '../Common/Message';
@@ -15,7 +16,7 @@ import Message from '../Common/Message';
*/
function _mergeTags(tagsA, tagsB) {
// Don't edit one of the objects in place, copy to new object.
- const mergedTags = {};
+ let mergedTags = {};
for (const tagName in tagsA) {
if (tagsA.hasOwnProperty(tagName)) {
mergedTags[tagName] = tagsA[tagName];
@@ -27,8 +28,8 @@ function _mergeTags(tagsA, tagsB) {
if (tagsB.hasOwnProperty(tagName)) {
const tags = tagsB[tagName];
if (tagsA.hasOwnProperty(tagName)) {
- const tagsArray = tags.concat(tagsA[tagName]);
- const tagsSet = new Set(tagsArray);
+ let tagsArray = tags.concat(tagsA[tagName]);
+ let tagsSet = _uniq(tagsArray);
mergedTags[tagName] = [...tagsSet];
} else {
mergedTags[tagName] = tags;
@@ -57,24 +58,24 @@ const propagateIndicesRecur = (entries, parentIndices) => {
if (parentIndices === undefined) {
parentIndices = {
tags_index: {},
- name_type_index: new Set(),
+ name_type_index: [],
};
}
- const indices = {
+ let indices = {
tags_index: {},
- name_type_index: new Set(),
+ name_type_index: [],
counter: {
passed: 0,
failed: 0,
},
};
- for (const entry of entries) {
- const entryType = entry.category;
+ for (let entry of entries) {
+ let entryType = entry.category;
// Initialize indices.
let tagsIndex = {};
const entryNameType = entry.name + '|' + entryType;
- let nameTypeIndex = new Set([
+ let nameTypeIndex = _uniq([
entryNameType,
...parentIndices.name_type_index
]);
@@ -87,12 +88,12 @@ const propagateIndicesRecur = (entries, parentIndices) => {
if (entryType !== 'testcase') {
// Propagate indices to children.
- const descendantsIndices = propagateIndicesRecur(
+ let descendantsIndices = propagateIndicesRecur(
entry.entries,
{ tags_index: tags, name_type_index: nameTypeIndex }
);
tagsIndex = _mergeTags(tagsIndex, descendantsIndices.tags_index);
- nameTypeIndex = new Set([
+ nameTypeIndex = _uniq([
...nameTypeIndex,
...descendantsIndices.name_type_index
]);
@@ -105,7 +106,7 @@ const propagateIndicesRecur = (entries, parentIndices) => {
// Update Array of entries indices.
indices.tags_index = _mergeTags(indices.tags_index, tagsIndex);
- indices.name_type_index = new Set([
+ indices.name_type_index = _uniq([
...indices.name_type_index,
...nameTypeIndex
]);
@@ -121,8 +122,8 @@ const propagateIndicesRecur = (entries, parentIndices) => {
* * name_type_index - its, its ancestors & its descendents names & types.
* * counter - number of passing & failing descendent testcases.
*
- * @param {object} report - A single Testplan report.
- * @returns {object[]} - The Testplan report with indices, in an Array.
+ * @param {Array} entries - A single Testplan report in an Array.
+ * @returns {Array} - The Testplan report with indices, in an Array.
*/
const PropagateIndices = (report) => {
propagateIndicesRecur([report], undefined);
@@ -133,8 +134,7 @@ const PropagateIndices = (report) => {
* Return the updated state after a new entry is selected from the Nav
* component.
*
- * @param {object} state
- * @param {object} entry - Nav entry metadata.
+ * @param {Object} entry - Nav entry metadata.
* @param {number} depth - depth of Nav entry in Testplan report.
* @public
*/
@@ -231,7 +231,7 @@ const GetCenterPane = (
// eslint-disable -next-line
const formatDate = (date, fmt) => {
- const o = {
+ var o = {
"M+" : date.getUTCMonth() + 1,
"d+" : date.getUTCDate(),
"h+" : date.getUTCHours(),
@@ -247,7 +247,7 @@ const formatDate = (date, fmt) => {
);
}
- for (const k in o) {
+ for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(
RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (
@@ -276,7 +276,7 @@ const getAssertions = (selectedEntries, displayTime) => {
const selectedEntry = selectedEntries[selectedEntries.length - 1];
if (selectedEntry && selectedEntry.category === 'testcase') {
- const links = [];
+ let links = [];
getAssertionsRecursively(links, selectedEntry.entries);
// get time information of each assertion if needed
diff --git a/testplan/web_ui/testing/src/Toolbar/Buttons.js b/testplan/web_ui/testing/src/Toolbar/Buttons.js
index df104c2b0..912ced750 100644
--- a/testplan/web_ui/testing/src/Toolbar/Buttons.js
+++ b/testplan/web_ui/testing/src/Toolbar/Buttons.js
@@ -7,7 +7,7 @@ import {css} from 'aphrodite';
import {NavItem} from 'reactstrap';
import {library} from '@fortawesome/fontawesome-svg-core';
-import {FontAwesomeIcon} from '@fortawesome/react-fontawesome/index.es';
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faClock} from '@fortawesome/free-solid-svg-icons';
import styles from './navStyles';
diff --git a/testplan/web_ui/testing/src/Toolbar/InteractiveButtons.js b/testplan/web_ui/testing/src/Toolbar/InteractiveButtons.js
index 3df5d43d4..8b3718013 100644
--- a/testplan/web_ui/testing/src/Toolbar/InteractiveButtons.js
+++ b/testplan/web_ui/testing/src/Toolbar/InteractiveButtons.js
@@ -3,7 +3,7 @@
*/
import React from 'react';
import {NavItem} from 'reactstrap';
-import {FontAwesomeIcon} from '@fortawesome/react-fontawesome/index.es';
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faBackspace} from '@fortawesome/free-solid-svg-icons';
import {css} from 'aphrodite';
diff --git a/testplan/web_ui/testing/src/Toolbar/Toolbar.js b/testplan/web_ui/testing/src/Toolbar/Toolbar.js
index cc3fe28fa..0b96eb71e 100644
--- a/testplan/web_ui/testing/src/Toolbar/Toolbar.js
+++ b/testplan/web_ui/testing/src/Toolbar/Toolbar.js
@@ -24,7 +24,7 @@ import FilterBox from "../Toolbar/FilterBox";
import {STATUS, STATUS_CATEGORY} from "../Common/defaults";
import {library} from '@fortawesome/fontawesome-svg-core';
-import {FontAwesomeIcon} from '@fortawesome/react-fontawesome/index.es';
+import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {
faInfo,
diff --git a/testplan/web_ui/testing/src/Toolbar/navStyles.js b/testplan/web_ui/testing/src/Toolbar/navStyles.js
index d839e659c..ce0bc64b9 100644
--- a/testplan/web_ui/testing/src/Toolbar/navStyles.js
+++ b/testplan/web_ui/testing/src/Toolbar/navStyles.js
@@ -24,7 +24,7 @@ const styles = StyleSheet.create({
},
filterLabel: {
width: '100%',
- display: 'inline-block',
+ display: 'inlinde-block',
cursor: 'pointer',
padding: '0.2em',
'margin-left': '2em',
diff --git a/testplan/web_ui/testing/src/__tests__/documents/.gitignore b/testplan/web_ui/testing/src/__tests__/documents/.gitignore
deleted file mode 100644
index f9be8dfe0..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-!*
diff --git a/testplan/web_ui/testing/src/__tests__/documents/FakeInteractiveReport.js b/testplan/web_ui/testing/src/__tests__/documents/FakeInteractiveReport.js
deleted file mode 100644
index 0386556cb..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/FakeInteractiveReport.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Fake interactive report. All entries start with a status of "ready".
- */
-module.exports = {
- counter: { passed: 0, failed: 0 },
- entries: [
- {
- counter: { passed: 0, failed: 0 },
- category: "multitest",
- description: null,
- entries: [
- {
- counter: { passed: 0, failed: 0 },
- category: "testsuite",
- description: null,
- entries: [
- {
- counter: { passed: 0, failed: 0 },
- description: null,
- entries: [],
- logs: [],
- name: "test_interactive",
- name_type_index: new Set(),
- status: 'unknown',
- runtime_status: 'ready',
- status_override: null,
- suite_related: false,
- tags: {},
- tags_index: {},
- timer: {},
- type: "TestCaseReport",
- uid: "ddd",
- },
- ],
- logs: [],
- name: "Interactive Suite",
- name_type_index: new Set(),
- part: null,
- status: 'unknown',
- runtime_status: 'ready',
- status_override: null,
- tags: {},
- tags_index: {},
- timer: {},
- type: "TestGroupReport",
- uid: "ccc",
- },
- ],
- logs: [],
- name: "Interactive MTest",
- name_type_index: new Set(),
- part: null,
- status: 'unknown',
- runtime_status: 'ready',
- status_override: null,
- tags: {},
- tags_index: {},
- timer: {},
- type: "TestGroupReport",
- uid: "bbb",
- },
- ],
- meta: {},
- name: "Fake Interactive Report",
- name_type_index: new Set(),
- status: 'unknown',
- runtime_status: 'ready',
- status_override: null,
- tags_index: {},
- timer: null,
- uid: "aaa",
-};
diff --git a/testplan/web_ui/testing/src/__tests__/documents/README.md b/testplan/web_ui/testing/src/__tests__/documents/README.md
deleted file mode 100644
index a29a807c0..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Documents
-
-[SIMPLE_REPORT.json](SIMPLE_REPORT.json) - Simple report that only contains one MultiTest and one suite
-[FakeInteractiveReport.json](FakeInteractiveReport.json) - Fake interactive report. All entries start with a status of "ready".
diff --git a/testplan/web_ui/testing/src/__tests__/documents/SIMPLE_REPORT.json b/testplan/web_ui/testing/src/__tests__/documents/SIMPLE_REPORT.json
deleted file mode 100644
index 374ef5737..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/SIMPLE_REPORT.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "category": "testplan",
- "name": "Sample Testplan",
- "status": "failed",
- "uid": "520a92e4-325e-4077-93e6-55d7091a3f83",
- "tags_index": {},
- "status_override": null,
- "meta": {},
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:10.998071+00:00",
- "end": "2018-10-15T14:30:11.296158+00:00"
- }
- },
- "entries": [
- {
- "name": "Primary",
- "status": "failed",
- "category": "multitest",
- "description": null,
- "status_override": null,
- "uid": "21739167-b30f-4c13-a315-ef6ae52fd1f7",
- "type": "TestGroupReport",
- "logs": [],
- "tags": {
- "simple": [
- "server"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.009705+00:00",
- "end": "2018-10-15T14:30:11.159661+00:00"
- }
- },
- "entries": [
- {
- "status": "failed",
- "category": "testsuite",
- "name": "AlphaSuite",
- "status_override": null,
- "description": null,
- "uid": "cb144b10-bdb0-44d3-9170-d8016dd19ee7",
- "type": "TestGroupReport",
- "logs": [],
- "tags": {
- "simple": [
- "server"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.009872+00:00",
- "end": "2018-10-15T14:30:11.158224+00:00"
- }
- },
- "entries": [
- {
- "category": "testcase",
- "name": "test_equality_passing",
- "status": "passed",
- "status_override": null,
- "description": null,
- "uid": "736706ef-ba65-475d-96c5-f2855f431028",
- "type": "TestCaseReport",
- "logs": [],
- "tags": {
- "colour": [
- "white"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.010072+00:00",
- "end": "2018-10-15T14:30:11.132214+00:00"
- }
- },
- "entries": [
- {
- "category": "DEFAULT",
- "machine_time": "2018-10-15T15:30:11.010098+00:00",
- "description": "passing equality",
- "line_no": 24,
- "label": "==",
- "second": 1,
- "meta_type": "assertion",
- "passed": true,
- "type": "Equal",
- "utc_time": "2018-10-15T14:30:11.010094+00:00",
- "first": 1
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/testplan/web_ui/testing/src/__tests__/documents/TESTPLAN_REPORT_2.json b/testplan/web_ui/testing/src/__tests__/documents/TESTPLAN_REPORT_2.json
deleted file mode 100644
index c83d99feb..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/TESTPLAN_REPORT_2.json
+++ /dev/null
@@ -1,265 +0,0 @@
-{
- "name": "Sample Testplan",
- "status": "failed",
- "uid": "520a92e4-325e-4077-93e6-55d7091a3f83",
- "tags_index": {},
- "information": [
- [
- "user",
- "unknown"
- ],
- [
- "command_line_string",
- "/home/unknown/path_to_testplan_script/testplan.py"
- ]
- ],
- "status_override": null,
- "meta": {},
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:10.998071+00:00",
- "end": "2018-10-15T14:30:11.296158+00:00"
- }
- },
- "entries": [
- {
- "name": "Primary",
- "status": "failed",
- "category": "multitest",
- "description": null,
- "status_override": null,
- "uid": "21739167-b30f-4c13-a315-ef6ae52fd1f7",
- "type": "TestGroupReport",
- "logs": [],
- "tags": {
- "simple": [
- "server"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.009705+00:00",
- "end": "2018-10-15T14:30:11.159661+00:00"
- }
- },
- "entries": [
- {
- "status": "failed",
- "category": "testsuite",
- "name": "AlphaSuite",
- "status_override": null,
- "description": "This is a failed testsuite",
- "uid": "cb144b10-bdb0-44d3-9170-d8016dd19ee7",
- "type": "TestGroupReport",
- "logs": [],
- "tags": {
- "simple": [
- "server"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.009872+00:00",
- "end": "2018-10-15T14:30:11.158224+00:00"
- }
- },
- "entries": [
- {
- "name": "test_equality_passing",
- "category": "testcase",
- "status": "passed",
- "status_override": null,
- "description": "A testcase example",
- "uid": "736706ef-ba65-475d-96c5-f2855f431028",
- "type": "TestCaseReport",
- "logs": [],
- "tags": {
- "colour": [
- "white"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.010072+00:00",
- "end": "2018-10-15T14:30:11.132214+00:00"
- }
- },
- "entries": [
- {
- "category": "DEFAULT",
- "machine_time": "2018-10-15T15:30:11.010098+00:00",
- "description": "passing equality",
- "line_no": 24,
- "label": "==",
- "second": 1,
- "meta_type": "assertion",
- "passed": true,
- "type": "Equal",
- "utc_time": "2018-10-15T14:30:11.010094+00:00",
- "first": 1
- }
- ]
- },
- {
- "name": "test_equality_passing2",
- "category": "testcase",
- "status": "failed",
- "tags": {},
- "status_override": null,
- "description": null,
- "uid": "78686a4d-7b94-4ae6-ab50-d9960a7fb714",
- "type": "TestCaseReport",
- "logs": [],
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.510072+00:00",
- "end": "2018-10-15T14:30:11.632214+00:00"
- }
- },
- "entries": [
- {
- "category": "DEFAULT",
- "machine_time": "2018-10-15T15:30:11.510098+00:00",
- "description": "passing equality",
- "line_no": 24,
- "label": "==",
- "second": 1,
- "meta_type": "assertion",
- "passed": true,
- "type": "Equal",
- "utc_time": "2018-10-15T14:30:11.510094+00:00",
- "first": 1
- }
- ]
- }
- ]
- },
- {
- "status": "passed",
- "category": "testsuite",
- "name": "BetaSuite",
- "status_override": null,
- "description": null,
- "uid": "6fc5c008-4d1a-454e-80b6-74bdc9bca49e",
- "type": "TestGroupReport",
- "logs": [],
- "tags": {
- "simple": [
- "client"
- ]
- },
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.009872+00:00",
- "end": "2018-10-15T14:30:11.158224+00:00"
- }
- },
- "entries": [
- {
- "name": "test_equality_passing",
- "category": "testcase",
- "status": "passed",
- "tags": {},
- "status_override": null,
- "description": null,
- "uid": "8865a23d-1823-4c8d-ab37-58d24fc8ac05",
- "type": "TestCaseReport",
- "logs": [],
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:11.010072+00:00",
- "end": "2018-10-15T14:30:11.132214+00:00"
- }
- },
- "entries": [
- {
- "category": "DEFAULT",
- "machine_time": "2018-10-15T15:30:11.010098+00:00",
- "description": "passing equality",
- "line_no": 24,
- "label": "==",
- "second": 1,
- "meta_type": "assertion",
- "passed": true,
- "type": "Equal",
- "utc_time": "2018-10-15T14:30:11.010094+00:00",
- "first": 1
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "name": "Secondary",
- "status": "passed",
- "category": "multitest",
- "tags": {},
- "description": null,
- "status_override": null,
- "uid": "8c3c7e6b-48e8-40cd-86db-8c8aed2592c8",
- "type": "TestGroupReport",
- "logs": [],
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:12.009705+00:00",
- "end": "2018-10-15T14:30:12.159661+00:00"
- }
- },
- "entries": [
- {
- "status": "passed",
- "category": "testsuite",
- "name": "GammaSuite",
- "tags": {},
- "status_override": null,
- "description": null,
- "uid": "08d4c671-d55d-49d4-96ba-dc654d12be26",
- "type": "TestGroupReport",
- "logs": [],
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:12.009872+00:00",
- "end": "2018-10-15T14:30:12.158224+00:00"
- }
- },
- "entries": [
- {
- "name": "test_equality_passing",
- "category": "testcase",
- "status": "passed",
- "tags": {},
- "status_override": null,
- "description": null,
- "uid": "f73bd6ea-d378-437b-a5db-00d9e427f36a",
- "type": "TestCaseReport",
- "logs": [],
- "timer": {
- "run": {
- "start": "2018-10-15T14:30:12.010072+00:00",
- "end": "2018-10-15T14:30:12.132214+00:00"
- }
- },
- "entries": [
- {
- "category": "DEFAULT",
- "machine_time": "2018-10-15T15:30:12.010098+00:00",
- "description": "passing equality",
- "line_no": 24,
- "label": "==",
- "second": 1,
- "meta_type": "assertion",
- "passed": true,
- "type": "Equal",
- "utc_time": "2018-10-15T14:30:12.010094+00:00",
- "first": 1
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/testplan/web_ui/testing/src/__tests__/documents/fakeReportAssertions.json b/testplan/web_ui/testing/src/__tests__/documents/fakeReportAssertions.json
deleted file mode 100644
index f2d9957fb..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/fakeReportAssertions.json
+++ /dev/null
@@ -1,3671 +0,0 @@
-{
- "category": "testplan",
- "tags_index": {},
- "meta": {},
- "information": [
- [
- "user",
- "yifan"
- ],
- [
- "command_line_string",
- "oss/examples/Assertions/Basic/test_plan.py --json example.json"
- ],
- [
- "python_version",
- "3.7.1"
- ]
- ],
- "counter": {
- "passed": 2,
- "failed": 6,
- "total": 8
- },
- "uid": "c648a283-22f3-4503-ae6d-c982b4c7cca0",
- "attachments": {},
- "status": "failed",
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.348924+00:00",
- "start": "2020-01-10T03:06:58.537339+00:00"
- }
- },
- "runtime_status": "finished",
- "name": "Assertions Example",
- "status_override": null,
- "entries": [
- {
- "description": null,
- "counter": {
- "passed": 2,
- "failed": 6,
- "total": 8
- },
- "name": "Assertions Test",
- "tags": {},
- "env_status": "STOPPED",
- "type": "TestGroupReport",
- "status_reason": null,
- "runtime_status": "finished",
- "fix_spec_path": null,
- "part": null,
- "uid": "99aef9f5-6957-4842-a6fa-e0cd9e358473",
- "status": "failed",
- "parent_uids": [
- "Assertions Example"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.141338+00:00",
- "start": "2020-01-10T03:06:58.629871+00:00"
- }
- },
- "hash": 3697482064019099674,
- "status_override": null,
- "logs": [],
- "category": "multitest",
- "entries": [
- {
- "description": null,
- "counter": {
- "passed": 2,
- "failed": 6,
- "total": 8
- },
- "name": "SampleSuite",
- "tags": {},
- "env_status": null,
- "type": "TestGroupReport",
- "status_reason": null,
- "runtime_status": "finished",
- "fix_spec_path": null,
- "part": null,
- "uid": "9f98c732-d040-4a13-84e1-563adcd9dd32",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.135813+00:00",
- "start": "2020-01-10T03:06:58.629972+00:00"
- }
- },
- "hash": -4958192469702756289,
- "status_override": null,
- "logs": [],
- "category": "testsuite",
- "entries": [
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "25d0115f-91c4-481b-ad0f-37382d95fabd",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:58.939142+00:00",
- "start": "2020-01-10T03:06:58.630091+00:00"
- }
- },
- "hash": 4069384282795794238,
- "runtime_status": "finished",
- "name": "test_basic_assertions",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "==",
- "type": "Equal",
- "utc_time": "2020-01-10T03:06:58.630121+00:00",
- "second": "foo",
- "passed": true,
- "first": "foo",
- "machine_time": "2020-01-10T11:06:58.630129+00:00",
- "line_no": 25
- },
- {
- "category": "DEFAULT",
- "description": "Description for failing equality",
- "meta_type": "assertion",
- "label": "==",
- "type": "Equal",
- "utc_time": "2020-01-10T03:06:58.893461+00:00",
- "second": 2,
- "passed": false,
- "first": 1,
- "machine_time": "2020-01-10T11:06:58.893477+00:00",
- "line_no": 28
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "!=",
- "type": "NotEqual",
- "utc_time": "2020-01-10T03:06:58.895795+00:00",
- "second": "bar",
- "passed": true,
- "first": "foo",
- "machine_time": "2020-01-10T11:06:58.895806+00:00",
- "line_no": 30
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">",
- "type": "Greater",
- "utc_time": "2020-01-10T03:06:58.898075+00:00",
- "second": 2,
- "passed": true,
- "first": 5,
- "machine_time": "2020-01-10T11:06:58.898084+00:00",
- "line_no": 31
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">=",
- "type": "GreaterEqual",
- "utc_time": "2020-01-10T03:06:58.899619+00:00",
- "second": 2,
- "passed": true,
- "first": 2,
- "machine_time": "2020-01-10T11:06:58.899627+00:00",
- "line_no": 32
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">=",
- "type": "GreaterEqual",
- "utc_time": "2020-01-10T03:06:58.901156+00:00",
- "second": 1,
- "passed": true,
- "first": 2,
- "machine_time": "2020-01-10T11:06:58.901163+00:00",
- "line_no": 33
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "<",
- "type": "Less",
- "utc_time": "2020-01-10T03:06:58.902604+00:00",
- "second": 20,
- "passed": true,
- "first": 10,
- "machine_time": "2020-01-10T11:06:58.902613+00:00",
- "line_no": 34
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "<=",
- "type": "LessEqual",
- "utc_time": "2020-01-10T03:06:58.904109+00:00",
- "second": 10,
- "passed": true,
- "first": 10,
- "machine_time": "2020-01-10T11:06:58.904117+00:00",
- "line_no": 35
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "<=",
- "type": "LessEqual",
- "utc_time": "2020-01-10T03:06:58.905543+00:00",
- "second": 30,
- "passed": true,
- "first": 10,
- "machine_time": "2020-01-10T11:06:58.905550+00:00",
- "line_no": 36
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "==",
- "type": "Equal",
- "utc_time": "2020-01-10T03:06:58.906994+00:00",
- "second": 15,
- "passed": true,
- "first": 15,
- "machine_time": "2020-01-10T11:06:58.907002+00:00",
- "line_no": 41
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "!=",
- "type": "NotEqual",
- "utc_time": "2020-01-10T03:06:58.908433+00:00",
- "second": 20,
- "passed": true,
- "first": 10,
- "machine_time": "2020-01-10T11:06:58.908440+00:00",
- "line_no": 42
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "<",
- "type": "Less",
- "utc_time": "2020-01-10T03:06:58.909946+00:00",
- "second": 3,
- "passed": true,
- "first": 2,
- "machine_time": "2020-01-10T11:06:58.909954+00:00",
- "line_no": 43
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">",
- "type": "Greater",
- "utc_time": "2020-01-10T03:06:58.911441+00:00",
- "second": 2,
- "passed": true,
- "first": 3,
- "machine_time": "2020-01-10T11:06:58.911449+00:00",
- "line_no": 44
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": "<=",
- "type": "LessEqual",
- "utc_time": "2020-01-10T03:06:58.912920+00:00",
- "second": 15,
- "passed": true,
- "first": 10,
- "machine_time": "2020-01-10T11:06:58.912928+00:00",
- "line_no": 45
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">=",
- "type": "GreaterEqual",
- "utc_time": "2020-01-10T03:06:58.914465+00:00",
- "second": 10,
- "passed": true,
- "first": 15,
- "machine_time": "2020-01-10T11:06:58.914473+00:00",
- "line_no": 46
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "rel_tol": 0.1,
- "label": "~=",
- "type": "IsClose",
- "utc_time": "2020-01-10T03:06:58.915976+00:00",
- "second": 95,
- "abs_tol": 0.0,
- "passed": true,
- "first": 100,
- "machine_time": "2020-01-10T11:06:58.915984+00:00",
- "line_no": 50
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "rel_tol": 0.01,
- "label": "~=",
- "type": "IsClose",
- "utc_time": "2020-01-10T03:06:58.917481+00:00",
- "second": 95,
- "abs_tol": 0.0,
- "passed": false,
- "first": 100,
- "machine_time": "2020-01-10T11:06:58.917489+00:00",
- "line_no": 51
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "entry",
- "type": "Log",
- "utc_time": "2020-01-10T03:06:58.919181+00:00",
- "machine_time": "2020-01-10T11:06:58.919189+00:00",
- "line_no": 56,
- "message": "This is a log message, it will be displayed along with other assertion details."
- },
- {
- "category": "DEFAULT",
- "description": "Boolean Truthiness check",
- "meta_type": "assertion",
- "type": "IsTrue",
- "utc_time": "2020-01-10T03:06:58.921013+00:00",
- "expr": true,
- "passed": true,
- "machine_time": "2020-01-10T11:06:58.921021+00:00",
- "line_no": 61
- },
- {
- "category": "DEFAULT",
- "description": "Boolean Falseness check",
- "meta_type": "assertion",
- "type": "IsFalse",
- "utc_time": "2020-01-10T03:06:58.923056+00:00",
- "expr": false,
- "passed": true,
- "machine_time": "2020-01-10T11:06:58.923064+00:00",
- "line_no": 62
- },
- {
- "category": "DEFAULT",
- "description": "This is an explicit failure.",
- "meta_type": "assertion",
- "type": "Fail",
- "utc_time": "2020-01-10T03:06:58.924595+00:00",
- "passed": false,
- "machine_time": "2020-01-10T11:06:58.924621+00:00",
- "line_no": 64
- },
- {
- "category": "DEFAULT",
- "description": "Passing membership",
- "meta_type": "assertion",
- "type": "Contain",
- "utc_time": "2020-01-10T03:06:58.926405+00:00",
- "container": "foobar",
- "passed": true,
- "machine_time": "2020-01-10T11:06:58.926413+00:00",
- "line_no": 67,
- "member": "foo"
- },
- {
- "category": "DEFAULT",
- "description": "Failing membership",
- "meta_type": "assertion",
- "type": "NotContain",
- "utc_time": "2020-01-10T03:06:58.928507+00:00",
- "container": "{'a': 1, 'b': 2}",
- "passed": true,
- "machine_time": "2020-01-10T11:06:58.928515+00:00",
- "line_no": 71,
- "member": 10
- },
- {
- "category": "DEFAULT",
- "description": "Comparison of slices",
- "meta_type": "assertion",
- "type": "EqualSlices",
- "utc_time": "2020-01-10T03:06:58.930479+00:00",
- "data": [
- [
- "slice(2, 4, None)",
- [
- 2,
- 3
- ],
- [],
- [
- 3,
- 4
- ],
- [
- 3,
- 4
- ]
- ],
- [
- "slice(6, 8, None)",
- [
- 6,
- 7
- ],
- [],
- [
- 7,
- 8
- ],
- [
- 7,
- 8
- ]
- ]
- ],
- "passed": true,
- "included_indices": [],
- "machine_time": "2020-01-10T11:06:58.930488+00:00",
- "expected": [
- "a",
- "b",
- 3,
- 4,
- "c",
- "d",
- 7,
- 8
- ],
- "line_no": 79,
- "actual": [
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Comparison of slices (exclusion)",
- "meta_type": "assertion",
- "type": "EqualExcludeSlices",
- "utc_time": "2020-01-10T03:06:58.932694+00:00",
- "data": [
- [
- "slice(0, 2, None)",
- [
- 2,
- 3,
- 4,
- 5,
- 6,
- 7
- ],
- [
- 4,
- 5,
- 6,
- 7
- ],
- [
- 3,
- 4,
- 5,
- 6,
- 7,
- 8
- ],
- [
- 3,
- 4,
- "c",
- "d",
- "e",
- "f"
- ]
- ],
- [
- "slice(4, 8, None)",
- [
- 0,
- 1,
- 2,
- 3
- ],
- [
- 0,
- 1
- ],
- [
- 1,
- 2,
- 3,
- 4
- ],
- [
- "a",
- "b",
- 3,
- 4
- ]
- ]
- ],
- "passed": true,
- "included_indices": [
- 2,
- 3
- ],
- "machine_time": "2020-01-10T11:06:58.932703+00:00",
- "expected": [
- "a",
- "b",
- 3,
- 4,
- "c",
- "d",
- "e",
- "f"
- ],
- "line_no": 91,
- "actual": [
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8
- ]
- },
- {
- "unified": false,
- "category": "DEFAULT",
- "ignore_blank_lines": true,
- "description": null,
- "meta_type": "assertion",
- "type": "LineDiff",
- "utc_time": "2020-01-10T03:06:58.934779+00:00",
- "delta": [],
- "second": [
- "abc\n",
- "xyz\n",
- "\n"
- ],
- "context": false,
- "passed": true,
- "first": [
- "abc\n",
- "xyz\n"
- ],
- "machine_time": "2020-01-10T11:06:58.934786+00:00",
- "ignore_space_change": false,
- "line_no": 98,
- "ignore_whitespaces": false
- },
- {
- "unified": 3,
- "category": "DEFAULT",
- "ignore_blank_lines": false,
- "description": null,
- "meta_type": "assertion",
- "type": "LineDiff",
- "utc_time": "2020-01-10T03:06:58.936975+00:00",
- "delta": [],
- "second": [
- "1\n",
- "1\n",
- "1\n",
- "abc \n",
- "xy\t\tz\n",
- "2\n",
- "2\n",
- "2\n"
- ],
- "context": false,
- "passed": true,
- "first": [
- "1\r\n",
- "1\r\n",
- "1\r\n",
- "abc\r\n",
- "xy z\r\n",
- "2\r\n",
- "2\r\n",
- "2\r\n"
- ],
- "machine_time": "2020-01-10T11:06:58.936983+00:00",
- "ignore_space_change": true,
- "line_no": 102,
- "ignore_whitespaces": false
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 1,
- "failed": 0,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "cd31b565-3702-4540-a140-ff9fd480e8ce",
- "status": "passed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:58.963478+00:00",
- "start": "2020-01-10T03:06:58.954190+00:00"
- }
- },
- "hash": -6066149844839810607,
- "runtime_status": "finished",
- "name": "test_raised_exceptions",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": null,
- "type": "ExceptionRaised",
- "utc_time": "2020-01-10T03:06:58.954270+00:00",
- "func_match": true,
- "raised_exception": [
- "
",
- "'bar'"
- ],
- "exception_match": true,
- "expected_exceptions": [
- "KeyError"
- ],
- "passed": true,
- "pattern_match": true,
- "machine_time": "2020-01-10T11:06:58.954275+00:00",
- "func": null,
- "line_no": 112
- },
- {
- "category": "DEFAULT",
- "description": "Exception raised with custom pattern.",
- "meta_type": "assertion",
- "pattern": "foobar",
- "type": "ExceptionRaised",
- "utc_time": "2020-01-10T03:06:58.955863+00:00",
- "func_match": true,
- "raised_exception": [
- "",
- "abc foobar xyz"
- ],
- "exception_match": true,
- "expected_exceptions": [
- "ValueError"
- ],
- "passed": true,
- "pattern_match": true,
- "machine_time": "2020-01-10T11:06:58.955871+00:00",
- "func": null,
- "line_no": 121
- },
- {
- "category": "DEFAULT",
- "description": "Exception raised with custom func.",
- "meta_type": "assertion",
- "pattern": null,
- "type": "ExceptionRaised",
- "utc_time": "2020-01-10T03:06:58.957489+00:00",
- "func_match": true,
- "raised_exception": [
- ".MyException'>",
- "4"
- ],
- "exception_match": true,
- "expected_exceptions": [
- "MyException"
- ],
- "passed": true,
- "pattern_match": true,
- "machine_time": "2020-01-10T11:06:58.957497+00:00",
- "func": ".custom_func at 0x7f9cfc64fea0>",
- "line_no": 139
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": null,
- "type": "ExceptionNotRaised",
- "utc_time": "2020-01-10T03:06:58.958956+00:00",
- "func_match": true,
- "raised_exception": [
- "",
- "'bar'"
- ],
- "exception_match": false,
- "expected_exceptions": [
- "TypeError"
- ],
- "passed": true,
- "pattern_match": true,
- "machine_time": "2020-01-10T11:06:58.958964+00:00",
- "func": null,
- "line_no": 146
- },
- {
- "category": "DEFAULT",
- "description": "Exception not raised with custom pattern.",
- "meta_type": "assertion",
- "pattern": "foobar",
- "type": "ExceptionNotRaised",
- "utc_time": "2020-01-10T03:06:58.960503+00:00",
- "func_match": true,
- "raised_exception": [
- "",
- "abc"
- ],
- "exception_match": true,
- "expected_exceptions": [
- "ValueError"
- ],
- "passed": true,
- "pattern_match": null,
- "machine_time": "2020-01-10T11:06:58.960510+00:00",
- "func": null,
- "line_no": 157
- },
- {
- "category": "DEFAULT",
- "description": "Exception not raised with custom func.",
- "meta_type": "assertion",
- "pattern": null,
- "type": "ExceptionNotRaised",
- "utc_time": "2020-01-10T03:06:58.962023+00:00",
- "func_match": false,
- "raised_exception": [
- ".MyException'>",
- "5"
- ],
- "exception_match": true,
- "expected_exceptions": [
- "MyException"
- ],
- "passed": true,
- "pattern_match": true,
- "machine_time": "2020-01-10T11:06:58.962031+00:00",
- "func": ".custom_func at 0x7f9cfc64fea0>",
- "line_no": 165
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "fca0596d-c220-4267-9a38-57968aca92d5",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:58.979777+00:00",
- "start": "2020-01-10T03:06:58.971424+00:00"
- }
- },
- "hash": -2707574492059523373,
- "runtime_status": "finished",
- "name": "test_assertion_group",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Equality assertion outside the group",
- "meta_type": "assertion",
- "label": "==",
- "type": "Equal",
- "utc_time": "2020-01-10T03:06:58.971447+00:00",
- "second": 1,
- "passed": true,
- "first": 1,
- "machine_time": "2020-01-10T11:06:58.971451+00:00",
- "line_no": 173
- },
- {
- "description": "Custom group description",
- "meta_type": "assertion",
- "type": "Group",
- "passed": false,
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Assertion within a group",
- "meta_type": "assertion",
- "label": "!=",
- "type": "NotEqual",
- "utc_time": "2020-01-10T03:06:58.973038+00:00",
- "second": 3,
- "passed": true,
- "first": 2,
- "machine_time": "2020-01-10T11:06:58.973047+00:00",
- "line_no": 176
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "label": ">",
- "type": "Greater",
- "utc_time": "2020-01-10T03:06:58.974577+00:00",
- "second": 3,
- "passed": true,
- "first": 5,
- "machine_time": "2020-01-10T11:06:58.974586+00:00",
- "line_no": 177
- },
- {
- "description": "This is a sub group",
- "meta_type": "assertion",
- "type": "Group",
- "passed": false,
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Assertion within sub group",
- "meta_type": "assertion",
- "label": "<",
- "type": "Less",
- "utc_time": "2020-01-10T03:06:58.976376+00:00",
- "second": 3,
- "passed": false,
- "first": 6,
- "machine_time": "2020-01-10T11:06:58.976384+00:00",
- "line_no": 181
- }
- ]
- }
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Final assertion outside all groups",
- "meta_type": "assertion",
- "label": "==",
- "type": "Equal",
- "utc_time": "2020-01-10T03:06:58.978219+00:00",
- "second": "foo",
- "passed": true,
- "first": "foo",
- "machine_time": "2020-01-10T11:06:58.978227+00:00",
- "line_no": 184
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "a3fd1023-b150-487a-bc7d-c0f64e326e63",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.006101+00:00",
- "start": "2020-01-10T03:06:58.987035+00:00"
- }
- },
- "hash": -8719069130512673532,
- "runtime_status": "finished",
- "name": "test_regex_namespace",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": "string pattern match",
- "meta_type": "assertion",
- "pattern": "foo",
- "type": "RegexMatch",
- "utc_time": "2020-01-10T03:06:58.987140+00:00",
- "match_indexes": [
- [
- 0,
- 3
- ]
- ],
- "passed": true,
- "string": "foobar",
- "machine_time": "2020-01-10T11:06:58.987146+00:00",
- "line_no": 196
- },
- {
- "category": "DEFAULT",
- "description": "SRE match",
- "meta_type": "assertion",
- "pattern": "foo",
- "type": "RegexMatch",
- "utc_time": "2020-01-10T03:06:58.988905+00:00",
- "match_indexes": [
- [
- 0,
- 3
- ]
- ],
- "passed": true,
- "string": "foobar",
- "machine_time": "2020-01-10T11:06:58.988913+00:00",
- "line_no": 201
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "first line.*second",
- "type": "RegexMatch",
- "utc_time": "2020-01-10T03:06:58.991277+00:00",
- "match_indexes": [
- [
- 0,
- 17
- ]
- ],
- "passed": true,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:58.991285+00:00",
- "line_no": 212
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "baz",
- "type": "RegexMatchNotExists",
- "utc_time": "2020-01-10T03:06:58.992937+00:00",
- "match_indexes": [],
- "passed": true,
- "string": "foobar",
- "machine_time": "2020-01-10T11:06:58.992945+00:00",
- "line_no": 217
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "foobar",
- "type": "RegexMatchNotExists",
- "utc_time": "2020-01-10T03:06:58.994520+00:00",
- "match_indexes": [],
- "passed": true,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:58.994527+00:00",
- "line_no": 222
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "second",
- "type": "RegexSearch",
- "utc_time": "2020-01-10T03:06:58.996148+00:00",
- "match_indexes": [
- [
- 11,
- 17
- ]
- ],
- "passed": true,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:58.996156+00:00",
- "line_no": 225
- },
- {
- "category": "DEFAULT",
- "description": "Passing search empty",
- "meta_type": "assertion",
- "pattern": "foobar",
- "type": "RegexSearchNotExists",
- "utc_time": "2020-01-10T03:06:58.997760+00:00",
- "match_indexes": [],
- "passed": true,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:58.997768+00:00",
- "line_no": 230
- },
- {
- "category": "DEFAULT",
- "description": "Failing search_empty",
- "meta_type": "assertion",
- "pattern": "second",
- "type": "RegexSearchNotExists",
- "utc_time": "2020-01-10T03:06:58.999296+00:00",
- "match_indexes": [
- [
- 11,
- 17
- ]
- ],
- "passed": false,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:58.999303+00:00",
- "line_no": 233
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "foo",
- "type": "RegexFindIter",
- "utc_time": "2020-01-10T03:06:59.000852+00:00",
- "match_indexes": [
- [
- 0,
- 3
- ],
- [
- 4,
- 7
- ],
- [
- 8,
- 11
- ],
- [
- 20,
- 23
- ]
- ],
- "condition": "",
- "passed": true,
- "string": "foo foo foo bar bar foo bar",
- "machine_time": "2020-01-10T11:06:59.000860+00:00",
- "condition_match": true,
- "line_no": 243
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "foo",
- "type": "RegexFindIter",
- "utc_time": "2020-01-10T03:06:59.002669+00:00",
- "match_indexes": [
- [
- 0,
- 3
- ],
- [
- 4,
- 7
- ],
- [
- 8,
- 11
- ],
- [
- 20,
- 23
- ]
- ],
- "condition": "(VAL > 2 and VAL < 5)",
- "passed": true,
- "string": "foo foo foo bar bar foo bar",
- "machine_time": "2020-01-10T11:06:59.002676+00:00",
- "condition_match": true,
- "line_no": 250
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "pattern": "\\w+ line$",
- "type": "RegexMatchLine",
- "utc_time": "2020-01-10T03:06:59.004622+00:00",
- "match_indexes": [
- [
- 0,
- 0,
- 10
- ],
- [
- 1,
- 0,
- 11
- ],
- [
- 2,
- 0,
- 10
- ]
- ],
- "passed": true,
- "string": "first line\nsecond line\nthird line",
- "machine_time": "2020-01-10T11:06:59.004630+00:00",
- "line_no": 257
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "e8fb2848-cc83-4df3-83e0-82fe839d6526",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.072704+00:00",
- "start": "2020-01-10T03:06:59.016322+00:00"
- }
- },
- "hash": -8829886055223884393,
- "runtime_status": "finished",
- "name": "test_table_namespace",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Table Match: list of list vs list of list",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.016418+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 0,
- [
- "Bob",
- 32
- ],
- {},
- {},
- {}
- ],
- [
- 1,
- [
- "Susan",
- 24
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- "Rick",
- 67
- ],
- {},
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.016424+00:00",
- "line_no": 284,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: list of dict vs list of dict",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.018525+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 0,
- [
- "Bob",
- 32
- ],
- {},
- {},
- {}
- ],
- [
- 1,
- [
- "Susan",
- 24
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- "Rick",
- 67
- ],
- {},
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.018533+00:00",
- "line_no": 289,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: list of dict vs list of list",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.020629+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 0,
- [
- "Bob",
- 32
- ],
- {},
- {},
- {}
- ],
- [
- 1,
- [
- "Susan",
- 24
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- "Rick",
- 67
- ],
- {},
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.020640+00:00",
- "line_no": 294,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: list of list vs list of list",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.023695+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [],
- "report_fails_only": true,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.023703+00:00",
- "line_no": 299,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: list of dict vs list of dict",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.026093+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [],
- "report_fails_only": true,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.026102+00:00",
- "line_no": 304,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: list of dict vs list of list",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.027835+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [],
- "report_fails_only": true,
- "passed": true,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.027843+00:00",
- "line_no": 309,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: simple comparators",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.029541+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 0,
- [
- "Bob",
- 32
- ],
- {},
- {},
- {
- "name": "REGEX(\\w{3})",
- "age": ""
- }
- ],
- [
- 1,
- [
- "Susan",
- 24
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- "Rick",
- 67
- ],
- {
- "name": ""
- },
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.029549+00:00",
- "line_no": 338,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: simple comparators",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.031666+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 2,
- [
- "Rick",
- 67
- ],
- {
- "name": ""
- },
- {},
- {}
- ]
- ],
- "report_fails_only": true,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.031674+00:00",
- "line_no": 343,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: readable comparators",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.034598+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 0,
- [
- "Bob",
- 32
- ],
- {},
- {},
- {
- "name": "REGEX(\\w{3})",
- "age": "(VAL > 30 and VAL < 40)"
- }
- ],
- [
- 1,
- [
- "Susan",
- 24
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- "Rick",
- 67
- ],
- {
- "name": "VAL in ['David', 'Helen', 'Pablo']"
- },
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.034625+00:00",
- "line_no": 361,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: readable comparators",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.037495+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "name",
- "age"
- ],
- "data": [
- [
- 2,
- [
- "Rick",
- 67
- ],
- {
- "name": "VAL in ['David', 'Helen', 'Pablo']"
- },
- {},
- {}
- ]
- ],
- "report_fails_only": true,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.037502+00:00",
- "line_no": 366,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: Trimmed columns",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.040045+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "column_1",
- "column_2"
- ],
- "data": [
- [
- 0,
- [
- 0,
- 0
- ],
- {},
- {},
- {}
- ],
- [
- 1,
- [
- 1,
- 2
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- 2,
- 4
- ],
- {},
- {},
- {}
- ],
- [
- 3,
- [
- 3,
- 6
- ],
- {},
- {},
- {}
- ],
- [
- 4,
- [
- 4,
- 8
- ],
- {},
- {},
- {}
- ],
- [
- 5,
- [
- 5,
- 10
- ],
- {},
- {},
- {}
- ],
- [
- 6,
- [
- 6,
- 12
- ],
- {},
- {},
- {}
- ],
- [
- 7,
- [
- 7,
- 14
- ],
- {},
- {},
- {}
- ],
- [
- 8,
- [
- 8,
- 16
- ],
- {},
- {},
- {}
- ],
- [
- 9,
- [
- 9,
- 18
- ],
- {},
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": true,
- "include_columns": [
- "column_1",
- "column_2"
- ],
- "machine_time": "2020-01-10T11:06:59.040052+00:00",
- "line_no": 383,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: Trimmed columns",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.042860+00:00",
- "exclude_columns": null,
- "fail_limit": 0,
- "columns": [
- "column_1",
- "column_2"
- ],
- "data": [],
- "report_fails_only": true,
- "passed": true,
- "include_columns": [
- "column_1",
- "column_2"
- ],
- "machine_time": "2020-01-10T11:06:59.042869+00:00",
- "line_no": 391,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Match: Trimmed rows",
- "meta_type": "assertion",
- "type": "TableMatch",
- "utc_time": "2020-01-10T03:06:59.046590+00:00",
- "exclude_columns": null,
- "fail_limit": 2,
- "columns": [
- "amount",
- "product_id"
- ],
- "data": [
- [
- 0,
- [
- 0,
- 4240
- ],
- {},
- {},
- {}
- ],
- [
- 1,
- [
- 10,
- 3961
- ],
- {},
- {},
- {}
- ],
- [
- 2,
- [
- 20,
- 1627
- ],
- {},
- {},
- {}
- ],
- [
- 3,
- [
- 30,
- 1351
- ],
- {},
- {},
- {}
- ],
- [
- 4,
- [
- 40,
- 2123
- ],
- {},
- {},
- {}
- ],
- [
- 5,
- [
- 25,
- 1111
- ],
- {
- "amount": 35
- },
- {},
- {}
- ],
- [
- 6,
- [
- 20,
- 2222
- ],
- {
- "product_id": 1234
- },
- {},
- {}
- ]
- ],
- "report_fails_only": false,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.046598+00:00",
- "line_no": 428,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": "Table Diff: Trimmed rows",
- "meta_type": "assertion",
- "type": "TableDiff",
- "utc_time": "2020-01-10T03:06:59.049590+00:00",
- "exclude_columns": null,
- "fail_limit": 2,
- "columns": [
- "amount",
- "product_id"
- ],
- "data": [
- [
- 5,
- [
- 25,
- 1111
- ],
- {
- "amount": 35
- },
- {},
- {}
- ],
- [
- 6,
- [
- 20,
- 2222
- ],
- {
- "product_id": 1234
- },
- {},
- {}
- ]
- ],
- "report_fails_only": true,
- "passed": false,
- "include_columns": null,
- "machine_time": "2020-01-10T11:06:59.049598+00:00",
- "line_no": 437,
- "message": null,
- "strict": false
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "column": "symbol",
- "limit": null,
- "type": "ColumnContain",
- "utc_time": "2020-01-10T03:06:59.051390+00:00",
- "data": [
- [
- 0,
- "AAPL",
- true
- ],
- [
- 1,
- "GOOG",
- false
- ],
- [
- 2,
- "FB",
- false
- ],
- [
- 3,
- "AMZN",
- true
- ],
- [
- 4,
- "MSFT",
- false
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.051397+00:00",
- "values": [
- "AAPL",
- "AMZN"
- ],
- "line_no": 454,
- "report_fails_only": false
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "column": "symbol",
- "limit": 20,
- "type": "ColumnContain",
- "utc_time": "2020-01-10T03:06:59.057037+00:00",
- "data": [
- [
- 1,
- "GOOG",
- false
- ],
- [
- 2,
- "FB",
- false
- ],
- [
- 4,
- "MSFT",
- false
- ],
- [
- 6,
- "GOOG",
- false
- ],
- [
- 7,
- "FB",
- false
- ],
- [
- 9,
- "MSFT",
- false
- ],
- [
- 11,
- "GOOG",
- false
- ],
- [
- 12,
- "FB",
- false
- ],
- [
- 14,
- "MSFT",
- false
- ],
- [
- 16,
- "GOOG",
- false
- ],
- [
- 17,
- "FB",
- false
- ],
- [
- 19,
- "MSFT",
- false
- ],
- [
- 21,
- "GOOG",
- false
- ],
- [
- 22,
- "FB",
- false
- ],
- [
- 24,
- "MSFT",
- false
- ],
- [
- 26,
- "GOOG",
- false
- ],
- [
- 27,
- "FB",
- false
- ],
- [
- 29,
- "MSFT",
- false
- ],
- [
- 31,
- "GOOG",
- false
- ],
- [
- 32,
- "FB",
- false
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.057048+00:00",
- "values": [
- "AAPL",
- "AMZN"
- ],
- "line_no": 467,
- "report_fails_only": true
- },
- {
- "category": "DEFAULT",
- "description": "Table Log: list of dicts",
- "meta_type": "entry",
- "type": "TableLog",
- "utc_time": "2020-01-10T03:06:59.060012+00:00",
- "table": [
- {
- "name": "Bob",
- "age": 32
- },
- {
- "name": "Susan",
- "age": 24
- },
- {
- "name": "Rick",
- "age": 67
- }
- ],
- "display_index": false,
- "columns": [
- "name",
- "age"
- ],
- "machine_time": "2020-01-10T11:06:59.060020+00:00",
- "line_no": 472,
- "indices": [
- 0,
- 1,
- 2
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Table Log: list of lists",
- "meta_type": "entry",
- "type": "TableLog",
- "utc_time": "2020-01-10T03:06:59.061711+00:00",
- "table": [
- {
- "name": "Bob",
- "age": 32
- },
- {
- "name": "Susan",
- "age": 24
- },
- {
- "name": "Rick",
- "age": 67
- }
- ],
- "display_index": false,
- "columns": [
- "name",
- "age"
- ],
- "machine_time": "2020-01-10T11:06:59.061718+00:00",
- "line_no": 473,
- "indices": [
- 0,
- 1,
- 2
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Table Log: many rows",
- "meta_type": "entry",
- "type": "TableLog",
- "utc_time": "2020-01-10T03:06:59.063421+00:00",
- "table": [
- {
- "symbol": "AAPL",
- "amount": 12
- },
- {
- "symbol": "GOOG",
- "amount": 21
- },
- {
- "symbol": "FB",
- "amount": 32
- },
- {
- "symbol": "AMZN",
- "amount": 5
- },
- {
- "symbol": "MSFT",
- "amount": 42
- },
- {
- "symbol": "AAPL",
- "amount": 12
- },
- {
- "symbol": "GOOG",
- "amount": 21
- },
- {
- "symbol": "FB",
- "amount": 32
- },
- {
- "symbol": "AMZN",
- "amount": 5
- },
- {
- "symbol": "MSFT",
- "amount": 42
- },
- {
- "symbol": "AAPL",
- "amount": 12
- },
- {
- "symbol": "GOOG",
- "amount": 21
- },
- {
- "symbol": "FB",
- "amount": 32
- },
- {
- "symbol": "AMZN",
- "amount": 5
- },
- {
- "symbol": "MSFT",
- "amount": 42
- },
- {
- "symbol": "AAPL",
- "amount": 12
- },
- {
- "symbol": "GOOG",
- "amount": 21
- },
- {
- "symbol": "FB",
- "amount": 32
- },
- {
- "symbol": "AMZN",
- "amount": 5
- },
- {
- "symbol": "MSFT",
- "amount": 42
- }
- ],
- "display_index": false,
- "columns": [
- "symbol",
- "amount"
- ],
- "machine_time": "2020-01-10T11:06:59.063429+00:00",
- "line_no": 479,
- "indices": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11,
- 12,
- 13,
- 14,
- 15,
- 16,
- 17,
- 18,
- 19
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Table Log: many columns",
- "meta_type": "entry",
- "type": "TableLog",
- "utc_time": "2020-01-10T03:06:59.065884+00:00",
- "table": [
- {
- "col_0": "row 0 col 0",
- "col_1": "row 0 col 1",
- "col_2": "row 0 col 2",
- "col_3": "row 0 col 3",
- "col_4": "row 0 col 4",
- "col_5": "row 0 col 5",
- "col_6": "row 0 col 6",
- "col_7": "row 0 col 7",
- "col_8": "row 0 col 8",
- "col_9": "row 0 col 9",
- "col_10": "row 0 col 10",
- "col_11": "row 0 col 11",
- "col_12": "row 0 col 12",
- "col_13": "row 0 col 13",
- "col_14": "row 0 col 14",
- "col_15": "row 0 col 15",
- "col_16": "row 0 col 16",
- "col_17": "row 0 col 17",
- "col_18": "row 0 col 18",
- "col_19": "row 0 col 19"
- },
- {
- "col_0": "row 1 col 0",
- "col_1": "row 1 col 1",
- "col_2": "row 1 col 2",
- "col_3": "row 1 col 3",
- "col_4": "row 1 col 4",
- "col_5": "row 1 col 5",
- "col_6": "row 1 col 6",
- "col_7": "row 1 col 7",
- "col_8": "row 1 col 8",
- "col_9": "row 1 col 9",
- "col_10": "row 1 col 10",
- "col_11": "row 1 col 11",
- "col_12": "row 1 col 12",
- "col_13": "row 1 col 13",
- "col_14": "row 1 col 14",
- "col_15": "row 1 col 15",
- "col_16": "row 1 col 16",
- "col_17": "row 1 col 17",
- "col_18": "row 1 col 18",
- "col_19": "row 1 col 19"
- },
- {
- "col_0": "row 2 col 0",
- "col_1": "row 2 col 1",
- "col_2": "row 2 col 2",
- "col_3": "row 2 col 3",
- "col_4": "row 2 col 4",
- "col_5": "row 2 col 5",
- "col_6": "row 2 col 6",
- "col_7": "row 2 col 7",
- "col_8": "row 2 col 8",
- "col_9": "row 2 col 9",
- "col_10": "row 2 col 10",
- "col_11": "row 2 col 11",
- "col_12": "row 2 col 12",
- "col_13": "row 2 col 13",
- "col_14": "row 2 col 14",
- "col_15": "row 2 col 15",
- "col_16": "row 2 col 16",
- "col_17": "row 2 col 17",
- "col_18": "row 2 col 18",
- "col_19": "row 2 col 19"
- },
- {
- "col_0": "row 3 col 0",
- "col_1": "row 3 col 1",
- "col_2": "row 3 col 2",
- "col_3": "row 3 col 3",
- "col_4": "row 3 col 4",
- "col_5": "row 3 col 5",
- "col_6": "row 3 col 6",
- "col_7": "row 3 col 7",
- "col_8": "row 3 col 8",
- "col_9": "row 3 col 9",
- "col_10": "row 3 col 10",
- "col_11": "row 3 col 11",
- "col_12": "row 3 col 12",
- "col_13": "row 3 col 13",
- "col_14": "row 3 col 14",
- "col_15": "row 3 col 15",
- "col_16": "row 3 col 16",
- "col_17": "row 3 col 17",
- "col_18": "row 3 col 18",
- "col_19": "row 3 col 19"
- },
- {
- "col_0": "row 4 col 0",
- "col_1": "row 4 col 1",
- "col_2": "row 4 col 2",
- "col_3": "row 4 col 3",
- "col_4": "row 4 col 4",
- "col_5": "row 4 col 5",
- "col_6": "row 4 col 6",
- "col_7": "row 4 col 7",
- "col_8": "row 4 col 8",
- "col_9": "row 4 col 9",
- "col_10": "row 4 col 10",
- "col_11": "row 4 col 11",
- "col_12": "row 4 col 12",
- "col_13": "row 4 col 13",
- "col_14": "row 4 col 14",
- "col_15": "row 4 col 15",
- "col_16": "row 4 col 16",
- "col_17": "row 4 col 17",
- "col_18": "row 4 col 18",
- "col_19": "row 4 col 19"
- },
- {
- "col_0": "row 5 col 0",
- "col_1": "row 5 col 1",
- "col_2": "row 5 col 2",
- "col_3": "row 5 col 3",
- "col_4": "row 5 col 4",
- "col_5": "row 5 col 5",
- "col_6": "row 5 col 6",
- "col_7": "row 5 col 7",
- "col_8": "row 5 col 8",
- "col_9": "row 5 col 9",
- "col_10": "row 5 col 10",
- "col_11": "row 5 col 11",
- "col_12": "row 5 col 12",
- "col_13": "row 5 col 13",
- "col_14": "row 5 col 14",
- "col_15": "row 5 col 15",
- "col_16": "row 5 col 16",
- "col_17": "row 5 col 17",
- "col_18": "row 5 col 18",
- "col_19": "row 5 col 19"
- },
- {
- "col_0": "row 6 col 0",
- "col_1": "row 6 col 1",
- "col_2": "row 6 col 2",
- "col_3": "row 6 col 3",
- "col_4": "row 6 col 4",
- "col_5": "row 6 col 5",
- "col_6": "row 6 col 6",
- "col_7": "row 6 col 7",
- "col_8": "row 6 col 8",
- "col_9": "row 6 col 9",
- "col_10": "row 6 col 10",
- "col_11": "row 6 col 11",
- "col_12": "row 6 col 12",
- "col_13": "row 6 col 13",
- "col_14": "row 6 col 14",
- "col_15": "row 6 col 15",
- "col_16": "row 6 col 16",
- "col_17": "row 6 col 17",
- "col_18": "row 6 col 18",
- "col_19": "row 6 col 19"
- },
- {
- "col_0": "row 7 col 0",
- "col_1": "row 7 col 1",
- "col_2": "row 7 col 2",
- "col_3": "row 7 col 3",
- "col_4": "row 7 col 4",
- "col_5": "row 7 col 5",
- "col_6": "row 7 col 6",
- "col_7": "row 7 col 7",
- "col_8": "row 7 col 8",
- "col_9": "row 7 col 9",
- "col_10": "row 7 col 10",
- "col_11": "row 7 col 11",
- "col_12": "row 7 col 12",
- "col_13": "row 7 col 13",
- "col_14": "row 7 col 14",
- "col_15": "row 7 col 15",
- "col_16": "row 7 col 16",
- "col_17": "row 7 col 17",
- "col_18": "row 7 col 18",
- "col_19": "row 7 col 19"
- },
- {
- "col_0": "row 8 col 0",
- "col_1": "row 8 col 1",
- "col_2": "row 8 col 2",
- "col_3": "row 8 col 3",
- "col_4": "row 8 col 4",
- "col_5": "row 8 col 5",
- "col_6": "row 8 col 6",
- "col_7": "row 8 col 7",
- "col_8": "row 8 col 8",
- "col_9": "row 8 col 9",
- "col_10": "row 8 col 10",
- "col_11": "row 8 col 11",
- "col_12": "row 8 col 12",
- "col_13": "row 8 col 13",
- "col_14": "row 8 col 14",
- "col_15": "row 8 col 15",
- "col_16": "row 8 col 16",
- "col_17": "row 8 col 17",
- "col_18": "row 8 col 18",
- "col_19": "row 8 col 19"
- },
- {
- "col_0": "row 9 col 0",
- "col_1": "row 9 col 1",
- "col_2": "row 9 col 2",
- "col_3": "row 9 col 3",
- "col_4": "row 9 col 4",
- "col_5": "row 9 col 5",
- "col_6": "row 9 col 6",
- "col_7": "row 9 col 7",
- "col_8": "row 9 col 8",
- "col_9": "row 9 col 9",
- "col_10": "row 9 col 10",
- "col_11": "row 9 col 11",
- "col_12": "row 9 col 12",
- "col_13": "row 9 col 13",
- "col_14": "row 9 col 14",
- "col_15": "row 9 col 15",
- "col_16": "row 9 col 16",
- "col_17": "row 9 col 17",
- "col_18": "row 9 col 18",
- "col_19": "row 9 col 19"
- }
- ],
- "display_index": false,
- "columns": [
- "col_0",
- "col_1",
- "col_2",
- "col_3",
- "col_4",
- "col_5",
- "col_6",
- "col_7",
- "col_8",
- "col_9",
- "col_10",
- "col_11",
- "col_12",
- "col_13",
- "col_14",
- "col_15",
- "col_16",
- "col_17",
- "col_18",
- "col_19"
- ],
- "machine_time": "2020-01-10T11:06:59.065891+00:00",
- "line_no": 490,
- "indices": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ]
- },
- {
- "category": "DEFAULT",
- "description": "Table Log: long cells",
- "meta_type": "entry",
- "type": "TableLog",
- "utc_time": "2020-01-10T03:06:59.070773+00:00",
- "table": [
- {
- "Name": "Bob Stevens",
- "Age": "33",
- "Address": "89 Trinsdale Avenue, LONDON, E8 0XW"
- },
- {
- "Name": "Susan Evans",
- "Age": "21",
- "Address": "100 Loop Road, SWANSEA, U8 12JK"
- },
- {
- "Name": "Trevor Dune",
- "Age": "88",
- "Address": "28 Kings Lane, MANCHESTER, MT16 2YT"
- },
- {
- "Name": "Belinda Baggins",
- "Age": "38",
- "Address": "31 Prospect Hill, DOYNTON, BS30 9DN"
- },
- {
- "Name": "Cosimo Hornblower",
- "Age": "89",
- "Address": "65 Prospect Hill, SURREY, PH33 4TY"
- },
- {
- "Name": "Sabine Wurfel",
- "Age": "31",
- "Address": "88 Clasper Way, HEXWORTHY, PL20 4BG"
- }
- ],
- "display_index": false,
- "columns": [
- "Name",
- "Age",
- "Address"
- ],
- "machine_time": "2020-01-10T11:06:59.070780+00:00",
- "line_no": 504,
- "indices": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5
- ]
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "ca8979be-8eb3-4ff4-8c18-aba4c8348bac",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.102866+00:00",
- "start": "2020-01-10T03:06:59.087638+00:00"
- }
- },
- "hash": -6007544999293600650,
- "runtime_status": "finished",
- "name": "test_dict_namespace",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Simple dict match",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.087672+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Passed",
- [
- "int",
- "1"
- ],
- [
- "int",
- "1"
- ]
- ],
- [
- 0,
- "bar",
- "Failed",
- [
- "int",
- "2"
- ],
- [
- "int",
- "5"
- ]
- ],
- [
- 0,
- "extra-key",
- "Failed",
- [
- null,
- "ABSENT"
- ],
- [
- "int",
- "10"
- ]
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.087677+00:00",
- "exclude_keys": null,
- "line_no": 524
- },
- {
- "category": "DEFAULT",
- "description": "Nested dict match",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.089583+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Failed",
- "",
- ""
- ],
- [
- 1,
- "alpha",
- "Failed",
- "",
- ""
- ],
- [
- 1,
- "",
- "Passed",
- [
- "int",
- "1"
- ],
- [
- "int",
- "1"
- ]
- ],
- [
- 1,
- "",
- "Passed",
- [
- "int",
- "2"
- ],
- [
- "int",
- "2"
- ]
- ],
- [
- 1,
- "",
- "Failed",
- [
- "int",
- "3"
- ],
- [
- null,
- null
- ]
- ],
- [
- 1,
- "beta",
- "Failed",
- "",
- ""
- ],
- [
- 2,
- "color",
- "Failed",
- [
- "str",
- "red"
- ],
- [
- "str",
- "blue"
- ]
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.089619+00:00",
- "exclude_keys": null,
- "line_no": 542
- },
- {
- "category": "DEFAULT",
- "description": "Dict match: Custom comparators",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.091710+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Passed",
- "",
- ""
- ],
- [
- 0,
- "",
- "Passed",
- [
- "int",
- "1"
- ],
- [
- "int",
- "1"
- ]
- ],
- [
- 0,
- "",
- "Passed",
- [
- "int",
- "2"
- ],
- [
- "int",
- "2"
- ]
- ],
- [
- 0,
- "",
- "Passed",
- [
- "int",
- "3"
- ],
- [
- "func",
- ""
- ]
- ],
- [
- 0,
- "bar",
- "Passed",
- "",
- ""
- ],
- [
- 1,
- "color",
- "Passed",
- [
- "str",
- "blue"
- ],
- [
- "func",
- "VAL in ['blue', 'red', 'yellow']"
- ]
- ],
- [
- 0,
- "baz",
- "Passed",
- [
- "str",
- "hello world"
- ],
- [
- "REGEX",
- "\\w+ world"
- ]
- ]
- ],
- "passed": true,
- "machine_time": "2020-01-10T11:06:59.091718+00:00",
- "exclude_keys": null,
- "line_no": 560
- },
- {
- "category": "DEFAULT",
- "description": "default assertion passes because the values are numerically equal",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.093424+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Passed",
- [
- "int",
- "1"
- ],
- [
- "float",
- 1.0
- ]
- ],
- [
- 0,
- "bar",
- "Passed",
- [
- "int",
- "2"
- ],
- [
- "float",
- 2.0
- ]
- ],
- [
- 0,
- "baz",
- "Passed",
- [
- "int",
- "3"
- ],
- [
- "float",
- 3.0
- ]
- ]
- ],
- "passed": true,
- "machine_time": "2020-01-10T11:06:59.093432+00:00",
- "exclude_keys": null,
- "line_no": 572
- },
- {
- "category": "DEFAULT",
- "description": "when we check types the assertion will fail",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.094973+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Failed",
- [
- "int",
- "1"
- ],
- [
- "float",
- 1.0
- ]
- ],
- [
- 0,
- "bar",
- "Failed",
- [
- "int",
- "2"
- ],
- [
- "float",
- 2.0
- ]
- ],
- [
- 0,
- "baz",
- "Failed",
- [
- "int",
- "3"
- ],
- [
- "float",
- 3.0
- ]
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.094981+00:00",
- "exclude_keys": null,
- "line_no": 578
- },
- {
- "category": "DEFAULT",
- "description": "use a custom comparison function to check within a tolerance",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.096547+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "foo",
- "Passed",
- [
- "float",
- 1.02
- ],
- [
- "float",
- 0.98
- ]
- ],
- [
- 0,
- "bar",
- "Passed",
- [
- "float",
- 2.28
- ],
- [
- "float",
- 2.33
- ]
- ],
- [
- 0,
- "baz",
- "Passed",
- [
- "float",
- 3.5
- ],
- [
- "float",
- 3.46
- ]
- ]
- ],
- "passed": true,
- "machine_time": "2020-01-10T11:06:59.096554+00:00",
- "exclude_keys": null,
- "line_no": 587
- },
- {
- "category": "DEFAULT",
- "description": "only report the failing comparison",
- "meta_type": "assertion",
- "type": "DictMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.098102+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- "bad_key",
- "Failed",
- [
- "str",
- "actual"
- ],
- [
- "str",
- "expected"
- ]
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.098109+00:00",
- "exclude_keys": null,
- "line_no": 601
- },
- {
- "absent_keys_diff": [
- "bar"
- ],
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "has_keys_diff": [
- "alpha"
- ],
- "type": "DictCheck",
- "utc_time": "2020-01-10T03:06:59.099751+00:00",
- "passed": false,
- "absent_keys": [
- "bar",
- "beta"
- ],
- "machine_time": "2020-01-10T11:06:59.099760+00:00",
- "line_no": 611,
- "has_keys": [
- "foo",
- "alpha"
- ]
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "entry",
- "type": "DictLog",
- "utc_time": "2020-01-10T03:06:59.101282+00:00",
- "flattened_dict": [
- [
- 0,
- "foo",
- ""
- ],
- [
- 0,
- "",
- [
- "int",
- "1"
- ]
- ],
- [
- 0,
- "",
- [
- "int",
- "2"
- ]
- ],
- [
- 0,
- "",
- [
- "int",
- "3"
- ]
- ],
- [
- 0,
- "bar",
- ""
- ],
- [
- 1,
- "color",
- [
- "str",
- "blue"
- ]
- ],
- [
- 0,
- "baz",
- [
- "str",
- "hello world"
- ]
- ]
- ],
- "machine_time": "2020-01-10T11:06:59.101290+00:00",
- "line_no": 620
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 0,
- "failed": 1,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "826ee3d4-0dea-412b-9652-86f5847706d9",
- "status": "failed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.116938+00:00",
- "start": "2020-01-10T03:06:59.111312+00:00"
- }
- },
- "hash": 3253704292606433761,
- "runtime_status": "finished",
- "name": "test_fix_namespace",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "type": "FixMatch",
- "include_keys": null,
- "utc_time": "2020-01-10T03:06:59.111446+00:00",
- "actual_description": null,
- "expected_description": null,
- "comparison": [
- [
- 0,
- 36,
- "Passed",
- [
- "int",
- "6"
- ],
- [
- "int",
- "6"
- ]
- ],
- [
- 0,
- 22,
- "Passed",
- [
- "int",
- "5"
- ],
- [
- "int",
- "5"
- ]
- ],
- [
- 0,
- 55,
- "Passed",
- [
- "int",
- "2"
- ],
- [
- "int",
- "2"
- ]
- ],
- [
- 0,
- 38,
- "Passed",
- [
- "int",
- "5"
- ],
- [
- "func",
- "VAL >= 4"
- ]
- ],
- [
- 0,
- 555,
- "Failed",
- "",
- ""
- ],
- [
- 0,
- "",
- "Failed",
- "",
- ""
- ],
- [
- 1,
- 600,
- "Passed",
- [
- "str",
- "A"
- ],
- [
- "str",
- "A"
- ]
- ],
- [
- 1,
- 601,
- "Failed",
- [
- "str",
- "A"
- ],
- [
- "str",
- "B"
- ]
- ],
- [
- 1,
- 683,
- "Passed",
- "",
- ""
- ],
- [
- 1,
- "",
- "Passed",
- "",
- ""
- ],
- [
- 2,
- 688,
- "Passed",
- [
- "str",
- "a"
- ],
- [
- "str",
- "a"
- ]
- ],
- [
- 2,
- 689,
- "Passed",
- [
- "str",
- "a"
- ],
- [
- "REGEX",
- "[a-z]"
- ]
- ],
- [
- 1,
- "",
- "Passed",
- "",
- ""
- ],
- [
- 2,
- 688,
- "Passed",
- [
- "str",
- "b"
- ],
- [
- "str",
- "b"
- ]
- ],
- [
- 2,
- 689,
- "Passed",
- [
- "str",
- "b"
- ],
- [
- "str",
- "b"
- ]
- ],
- [
- 0,
- "",
- "Failed",
- "",
- ""
- ],
- [
- 1,
- 600,
- "Failed",
- [
- "str",
- "B"
- ],
- [
- "str",
- "C"
- ]
- ],
- [
- 1,
- 601,
- "Passed",
- [
- "str",
- "B"
- ],
- [
- "str",
- "B"
- ]
- ],
- [
- 1,
- 683,
- "Passed",
- "",
- ""
- ],
- [
- 1,
- "",
- "Passed",
- "",
- ""
- ],
- [
- 2,
- 688,
- "Passed",
- [
- "str",
- "c"
- ],
- [
- "str",
- "c"
- ]
- ],
- [
- 2,
- 689,
- "Passed",
- [
- "str",
- "c"
- ],
- [
- "func",
- "VAL in ('c', 'd')"
- ]
- ],
- [
- 1,
- "",
- "Passed",
- "",
- ""
- ],
- [
- 2,
- 688,
- "Passed",
- [
- "str",
- "d"
- ],
- [
- "str",
- "d"
- ]
- ],
- [
- 2,
- 689,
- "Passed",
- [
- "str",
- "d"
- ],
- [
- "str",
- "d"
- ]
- ]
- ],
- "passed": false,
- "machine_time": "2020-01-10T11:06:59.111452+00:00",
- "exclude_keys": null,
- "line_no": 708
- },
- {
- "absent_keys_diff": [
- 555
- ],
- "category": "DEFAULT",
- "description": null,
- "meta_type": "assertion",
- "has_keys_diff": [
- 26,
- 11
- ],
- "type": "FixCheck",
- "utc_time": "2020-01-10T03:06:59.113689+00:00",
- "passed": false,
- "absent_keys": [
- 444,
- 555
- ],
- "machine_time": "2020-01-10T11:06:59.113697+00:00",
- "line_no": 716,
- "has_keys": [
- 26,
- 22,
- 11
- ]
- },
- {
- "category": "DEFAULT",
- "description": null,
- "meta_type": "entry",
- "type": "FixLog",
- "utc_time": "2020-01-10T03:06:59.115483+00:00",
- "flattened_dict": [
- [
- 0,
- 36,
- [
- "int",
- "6"
- ]
- ],
- [
- 0,
- 22,
- [
- "int",
- "5"
- ]
- ],
- [
- 0,
- 55,
- [
- "int",
- "2"
- ]
- ],
- [
- 0,
- 38,
- [
- "int",
- "5"
- ]
- ],
- [
- 0,
- 555,
- ""
- ],
- [
- 0,
- "",
- ""
- ],
- [
- 1,
- 556,
- [
- "str",
- "USD"
- ]
- ],
- [
- 1,
- 624,
- [
- "int",
- "1"
- ]
- ],
- [
- 0,
- "",
- ""
- ],
- [
- 1,
- 556,
- [
- "str",
- "EUR"
- ]
- ],
- [
- 1,
- 624,
- [
- "int",
- "2"
- ]
- ]
- ],
- "machine_time": "2020-01-10T11:06:59.115490+00:00",
- "line_no": 729
- }
- ]
- },
- {
- "category": "testcase",
- "logs": [],
- "description": null,
- "suite_related": false,
- "counter": {
- "passed": 1,
- "failed": 0,
- "total": 1
- },
- "status_reason": null,
- "type": "TestCaseReport",
- "uid": "52a8a7d9-80e6-4f7f-8eef-065bb25d38f8",
- "status": "passed",
- "parent_uids": [
- "Assertions Example",
- "Assertions Test",
- "SampleSuite"
- ],
- "timer": {
- "run": {
- "end": "2020-01-10T03:06:59.129247+00:00",
- "start": "2020-01-10T03:06:59.123570+00:00"
- }
- },
- "hash": -5041530229790182508,
- "runtime_status": "finished",
- "name": "test_xml_namespace",
- "status_override": null,
- "tags": {},
- "entries": [
- {
- "category": "DEFAULT",
- "description": "Simple XML check for existence of xpath.",
- "meta_type": "assertion",
- "type": "XMLCheck",
- "utc_time": "2020-01-10T03:06:59.123813+00:00",
- "namespaces": null,
- "data": [],
- "passed": true,
- "xml": "\n Foo\n \n",
- "machine_time": "2020-01-10T11:06:59.123821+00:00",
- "tags": null,
- "line_no": 751,
- "message": "xpath: `/Root/Test` exists in the XML.",
- "xpath": "/Root/Test"
- },
- {
- "category": "DEFAULT",
- "description": "XML check for tags in the given xpath.",
- "meta_type": "assertion",
- "type": "XMLCheck",
- "utc_time": "2020-01-10T03:06:59.125438+00:00",
- "namespaces": null,
- "data": [
- [
- "Value1",
- null,
- null,
- null
- ],
- [
- "Value2",
- null,
- null,
- null
- ]
- ],
- "passed": true,
- "xml": "\n Value1\n Value2\n \n",
- "machine_time": "2020-01-10T11:06:59.125447+00:00",
- "tags": [
- "Value1",
- "Value2"
- ],
- "line_no": 765,
- "message": null,
- "xpath": "/Root/Test"
- },
- {
- "category": "DEFAULT",
- "description": "XML check with namespace matching.",
- "meta_type": "assertion",
- "type": "XMLCheck",
- "utc_time": "2020-01-10T03:06:59.127250+00:00",
- "namespaces": {
- "a": "http://testplan"
- },
- "data": [
- [
- "Hello world!",
- null,
- null,
- "REGEX(Hello*)"
- ]
- ],
- "passed": true,
- "xml": "\n \n \n Hello world!\n \n \n",
- "machine_time": "2020-01-10T11:06:59.127259+00:00",
- "tags": [
- "re.compile('Hello*')"
- ],
- "line_no": 784,
- "message": null,
- "xpath": "//*/a:message"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
-}
diff --git a/testplan/web_ui/testing/src/__tests__/documents/index.js b/testplan/web_ui/testing/src/__tests__/documents/index.js
deleted file mode 100644
index 28d20aa41..000000000
--- a/testplan/web_ui/testing/src/__tests__/documents/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-if(process.env.NODE_ENV !== 'production') {
- module.exports = {
- TESTPLAN_REPORT_1: require('./TESTPLAN_REPORT_1.json'),
- TESTPLAN_REPORT_2: require('./TESTPLAN_REPORT_2.json'),
- SIMPLE_REPORT: require('./SIMPLE_REPORT.json'),
- fakeReportAssertions: require('./fakeReportAssertions.json'),
- FakeInteractiveReport: require('./FakeInteractiveReport'),
- };
-} else {
- module.exports = {};
-}
diff --git a/testplan/web_ui/testing/src/index.js b/testplan/web_ui/testing/src/index.js
new file mode 100644
index 000000000..7bcb80085
--- /dev/null
+++ b/testplan/web_ui/testing/src/index.js
@@ -0,0 +1,38 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import BatchReport from './Report/BatchReport';
+import InteractiveReport from './Report/InteractiveReport';
+import EmptyReport from './Report/EmptyReport';
+import {POLL_MS} from './Common/defaults.js';
+
+// import registerServiceWorker from './registerServiceWorker';
+import 'bootstrap/dist/css/bootstrap.min.css';
+import { Router, Route, Switch } from "react-router-dom";
+import Provider from 'react-redux/es/components/Provider';
+import appHistory from './state/appHistory';
+import store from './state/store';
+
+/**
+ * This single App provides multiple functions controlled via the URL path
+ * accessed. We are using React-Router to control which type of report is
+ * rendered and to extract the report UID from the URL when necessary.
+ */
+const AppRouter = () => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+ReactDOM.render(, document.getElementById('root'));
+// registerServiceWorker();
diff --git a/testplan/web_ui/testing/src/index.jsx b/testplan/web_ui/testing/src/index.jsx
deleted file mode 100644
index 6b7eb130d..000000000
--- a/testplan/web_ui/testing/src/index.jsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import 'bootstrap/dist/css/bootstrap.min.css';
-import React, { lazy } from 'react';
-import ReactDOM from 'react-dom';
-import { Route } from 'react-router';
-
-import { POLL_MS } from './Common/defaults';
-import SwitchRequireSlash from './Common/SwitchRequireSlash';
-import AppWrapper from './state/AppWrapper';
-
-// Don't make users download scripts that they won't use.
-// see: https://reactjs.org/docs/code-splitting.html#route-based-code-splitting
-const BatchReport = lazy(() => import('./Report/BatchReport'));
-const InteractiveReport = lazy(() => import('./Report/InteractiveReport'));
-const EmptyReport = lazy(() => import('./Report/EmptyReport'));
-const Home = lazy(() => import('./Common/Home'));
-
-/**
- * This single App provides multiple functions controlled via the URL path
- * accessed. We are using React-Router to control which type of report is
- * rendered and to extract the report UID from the URL when necessary.
- */
-const App = () => (
-
-
-
-
-
- } />
-
-
-
-
-
-
- {/* Must be last */}
-
-
-
-);
-
-ReactDOM.render(, document.getElementById('root'));
diff --git a/testplan/web_ui/testing/src/setupTests.js b/testplan/web_ui/testing/src/setupTests.js
index 7900ecd19..7a1fee7e8 100644
--- a/testplan/web_ui/testing/src/setupTests.js
+++ b/testplan/web_ui/testing/src/setupTests.js
@@ -1,10 +1,4 @@
-/**
- * This file follows the rules of Jest's "setupFilesAfterEnv".
- * @see https://jestjs.io/docs/en/configuration#setupfilesafterenv-array
- */
-import 'expect-puppeteer';
-import '@testing-library/jest-dom/extend-expect';
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
-configure({ adapter: new Adapter() });
+configure({ adapter: new Adapter() });
\ No newline at end of file
diff --git a/testplan/web_ui/testing/src/state/AppProvider.jsx b/testplan/web_ui/testing/src/state/AppProvider.jsx
deleted file mode 100644
index 4c1bccf02..000000000
--- a/testplan/web_ui/testing/src/state/AppProvider.jsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react';
-import Provider from 'react-redux/es/components/Provider';
-import ErrorCatch from '../Common/ErrorCatch';
-import store from './store';
-
-export default function AppProvider({ children }) {
- return (
-
-
- {children}
-
-
- );
-}
-
diff --git a/testplan/web_ui/testing/src/state/AppRouter.jsx b/testplan/web_ui/testing/src/state/AppRouter.jsx
deleted file mode 100644
index aceaf8159..000000000
--- a/testplan/web_ui/testing/src/state/AppRouter.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React from 'react';
-import { createBrowserHistory } from 'history';
-import { Router } from 'react-router';
-import ErrorCatch from '../Common/ErrorCatch';
-
-export const appHistory = createBrowserHistory({ basename: '/' });
-
-export default function AppRouter({ children }) {
- return (
-
-
- {children}
-
-
- );
-}
diff --git a/testplan/web_ui/testing/src/state/AppWrapper.jsx b/testplan/web_ui/testing/src/state/AppWrapper.jsx
deleted file mode 100644
index f3bbba676..000000000
--- a/testplan/web_ui/testing/src/state/AppWrapper.jsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import React from 'react';
-import LoadingAnimation from '../Common/LoadingAnimation';
-import AppRouter from './AppRouter';
-import AppProvider from './AppProvider';
-import ErrorCatch from '../Common/ErrorCatch';
-
-export default function AppWrapper({ children }) {
- return (
-
-
-
-
- }>
- {children}
-
-
-
-
-
- );
-}
diff --git a/testplan/web_ui/testing/src/state/__tests__/appSlice.test.js b/testplan/web_ui/testing/src/state/__tests__/appSlice.test.js
deleted file mode 100644
index 2b3430fac..000000000
--- a/testplan/web_ui/testing/src/state/__tests__/appSlice.test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import configureStore from 'redux-mock-store';
-import appSlice from '../appSlice';
-import * as appActions from '../appActions';
-import * as appSelectors from '../appSelectors';
-import appMiddleware from '../appMiddleware';
-
-describe('PLACEHOLDER', () => {
-
- beforeAll(() => {
-
- });
-
- beforeEach(() => {
-
- });
-
- it('PLACEHOLDER', () => {
-
- });
-
- afterEach(() => {
-
- });
-
- afterAll(() => {
-
- });
-
-});
diff --git a/testplan/web_ui/testing/src/state/__tests__/store.test.js b/testplan/web_ui/testing/src/state/__tests__/store.test.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/testplan/web_ui/testing/src/state/appActions.js b/testplan/web_ui/testing/src/state/appActions.js
index 5bcbefe07..5bdd7fc48 100644
--- a/testplan/web_ui/testing/src/state/appActions.js
+++ b/testplan/web_ui/testing/src/state/appActions.js
@@ -1,6 +1,6 @@
import appSlice from './appSlice';
-export const { // eslint-disable-line no-empty-pattern
+export const {
setIsDevel,
setIsTesting,
setSkipFetch,
diff --git a/testplan/web_ui/testing/src/state/appHistory.js b/testplan/web_ui/testing/src/state/appHistory.js
new file mode 100644
index 000000000..ccbb95f52
--- /dev/null
+++ b/testplan/web_ui/testing/src/state/appHistory.js
@@ -0,0 +1,3 @@
+import { createBrowserHistory } from 'history';
+
+export default createBrowserHistory({ basename: '/' });
diff --git a/testplan/web_ui/testing/src/state/appMiddleware.js b/testplan/web_ui/testing/src/state/appMiddleware.js
index 3df93beb9..8540cf6f0 100644
--- a/testplan/web_ui/testing/src/state/appMiddleware.js
+++ b/testplan/web_ui/testing/src/state/appMiddleware.js
@@ -1,11 +1,16 @@
import URLParamRegistry from '../Common/URLParamRegistry';
-import { appHistory } from './AppRouter';
+import appHistory from './appHistory';
import { setIsDevel } from './appActions';
import { setIsTesting } from './appActions';
import { setSkipFetch } from './appActions';
export default new URLParamRegistry(appHistory)
.registerBidirectionalListener('isDevel', setIsDevel)
+ .registerQueryParamListener('development', setIsDevel)
+ .registerQueryParamListener('devel', setIsDevel)
+ .registerQueryParamListener('dev', setIsDevel)
.registerBidirectionalListener('isTesting', setIsTesting)
+ .registerQueryParamListener('testing', setIsTesting)
+ .registerQueryParamListener('test', setIsTesting)
.registerBidirectionalListener('skipFetch', setSkipFetch)
.createMiddleware();
diff --git a/testplan/web_ui/testing/src/state/appSelectors.js b/testplan/web_ui/testing/src/state/appSelectors.js
index f327071e6..30b09a846 100644
--- a/testplan/web_ui/testing/src/state/appSelectors.js
+++ b/testplan/web_ui/testing/src/state/appSelectors.js
@@ -1,18 +1,34 @@
+import { createSelector } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
-export const mkGetApiHeaders = () => st => st.app.apiHeaders;
+export const mkGetAppState = () => state => state.app;
+
+export const mkGetApiHeaders = () => createSelector(
+ mkGetAppState(),
+ appState => appState.apiHeaders,
+);
export const getApiHeaders = mkGetApiHeaders();
-export const mkGetApiBaseURL = () => st => st.app.apiBaseURL;
-export const getApiBaseURL = mkGetApiBaseURL();
+export const mkGetApiBaseURL = () => createSelector(
+ mkGetAppState(),
+ appState => appState.apiBaseURL,
+);
-export const mkGetIsTesting = () => st => st.app.isTesting;
-export const getIsTesting = mkGetIsTesting();
+export const mkGetIsTesting = () => createSelector(
+ mkGetAppState(),
+ appState => appState.isTesting,
+);
-export const mkGetIsDevel = () => st => st.app.isDevel;
-export const getIsDevel = mkGetIsDevel();
+export const mkGetIsDevel = () => createSelector(
+ mkGetAppState(),
+ appState => appState.isDevel,
+);
-export const mkGetSkipFetch = () => st => st.app.skipFetch;
-export const getSkipFetch = mkGetSkipFetch();
+export const mkGetSkipFetch = () => createSelector(
+ mkGetAppState(),
+ appState => appState.skipFetch,
+);
-export const mkGetDocumentationURL = () => st => st.app.apiBaseURL;
-export const getDocumentationURL = mkGetDocumentationURL();
+export const mkGetDocumentationURL = () => createSelector(
+ mkGetAppState(),
+ appState => appState.documentationURL,
+);
diff --git a/testplan/web_ui/testing/src/state/appSlice.js b/testplan/web_ui/testing/src/state/appSlice.js
index fc3259a7f..410a88830 100644
--- a/testplan/web_ui/testing/src/state/appSlice.js
+++ b/testplan/web_ui/testing/src/state/appSlice.js
@@ -1,5 +1,6 @@
// @ts-nocheck
import { createSlice } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
+import AxiosDefaults from 'axios/lib/defaults';
const __DEV__ = process.env.NODE_ENV !== 'production';
const REACT_APP_API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
@@ -27,9 +28,9 @@ export default createSlice({
documentationURL: 'http://testplan.readthedocs.io/',
apiBaseURL: API_BASE_URL.toString(),
apiHeaders: {
+ ...AxiosDefaults.headers.common,
...API_CORS_HEADERS,
'Accept': 'application/json',
- 'Accept-Charset': 'utf-8',
},
},
reducers: {
diff --git a/testplan/web_ui/testing/src/state/store.js b/testplan/web_ui/testing/src/state/store.js
index 5c0ab5b63..0537a1383 100644
--- a/testplan/web_ui/testing/src/state/store.js
+++ b/testplan/web_ui/testing/src/state/store.js
@@ -1,21 +1,127 @@
+// @ts-nocheck
import { configureStore } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
import { combineReducers } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
import { getDefaultMiddleware } from '@reduxjs/toolkit/dist/redux-toolkit.esm';
import appMiddleware from './appMiddleware';
-import uiMiddleware from '../Report/BatchReport/state/uiMiddleware';
+import uiMiddleware from '../Report/BatchReportBeta/state/uiMiddleware';
+import { fetchReport } from '../Report/BatchReportBeta/state/reportActions';
+import {
+ getLastResponseContentLength
+} from '../Report/BatchReportBeta/state/reportSelectors';
+import { setSelectedEntry } from '../Report/BatchReportBeta/state/uiActions';
+import uiHistory from '../Report/BatchReportBeta/state/uiHistory';
+import appHistory from './appHistory';
+
+const __DEV__ = process.env.NODE_ENV !== 'production';
+const FIX_DEVTOOL_SPEED = process.env.REACT_APP_FIX_DEVTOOL_SPEED === 'true';
+// eslint-disable-next-line max-len
+const DISABLE_REDUX_DEVTOOLS = process.env.REACT_APP_DISABLE_REDUX_DEVTOOLS === 'true';
+let shaveObjectEntriesFromObject = null;
+if(__DEV__ && FIX_DEVTOOL_SPEED && !DISABLE_REDUX_DEVTOOLS) {
+ console.warn(
+ "You've set the environment variable REACT_APP_FIX_DEVTOOL_SPEED=true" +
+ " which will disable several features in Redux Devtools. "
+ );
+ const _isObjectLike = require('lodash/isObjectLike');
+ const _isFunction = require('lodash/isFunction');
+ shaveObjectEntriesFromObject = (entry, placeholder = '<>') => (
+ !_isObjectLike(entry) ? entry : Object.fromEntries(
+ Object.entries(entry).map(([ prop, val ]) => [
+ prop,
+ _isObjectLike(val)
+ ? _isFunction(placeholder) ? placeholder(prop, val) : placeholder
+ : val
+ ])
+ ));
+}
const createReducer = () => combineReducers({
app: require('./appSlice').default.reducer,
- report: require('../Report/BatchReport/state/reportSlice').default.reducer,
- ui: require('../Report/BatchReport/state/uiSlice').default.reducer,
+ // eslint-disable-next-line max-len
+ report: require('../Report/BatchReportBeta/state/reportSlice').default.reducer,
+ ui: require('../Report/BatchReportBeta/state/uiSlice').default.reducer,
});
const store = configureStore({
reducer: createReducer(),
- middleware: [ appMiddleware, uiMiddleware, ...getDefaultMiddleware() ],
+ middleware: [
+ appMiddleware,
+ uiMiddleware,
+ ...getDefaultMiddleware({
+ thunk: {
+ extraArgument: { uiHistory, appHistory }
+ },
+ serializableCheck: __DEV__ && (!FIX_DEVTOOL_SPEED ? true : {
+ ignoredPaths: [
+ 'report.document',
+ 'ui.selectedEntry',
+ ],
+ ignoredActions: [
+ fetchReport.fulfilled.type,
+ setSelectedEntry.type,
+ setSelectedEntry.fulfilled.type,
+ ],
+ }),
+ immutableCheck: __DEV__ && (!FIX_DEVTOOL_SPEED ? true : {
+ ignoredPaths: [
+ 'report.document',
+ 'ui.selectedEntry',
+ ],
+ }),
+ })
+ ],
+ devTools: __DEV__ && !DISABLE_REDUX_DEVTOOLS && (!FIX_DEVTOOL_SPEED ? true : {
+ name: 'testplan',
+ maxAge: 10,
+ trace: true,
+ traceLimit: 3,
+ shouldCatchErrors: true,
+ shouldRecordChanges: true,
+ shouldHotReload: true,
+ actionSanitizer: action => {
+ switch(action.type) {
+ case fetchReport.fulfilled.type:
+ return {
+ ...action,
+ payload: '<>',
+ };
+ case setSelectedEntry.type:
+ return {
+ ...action,
+ payload: shaveObjectEntriesFromObject(action.payload)
+ };
+ default:
+ return action;
+ }
+ },
+ stateSanitizer: state => {
+ // devtools crashes and the UI freezes at 45_864_416 so this number can
+ // likely be tuned up or down (right now it's just a guess)
+ if(35_000_000 < getLastResponseContentLength(state)) {
+ // these slow down the extension - and hence the UI - a lot
+ window.__CURRENT_REPORT = state.report.document;
+ window.__SELECTED_ENTRY = state.ui.selectedEntry;
+ return {
+ ...state,
+ report: {
+ ...state.report,
+ document: '<>',
+ },
+ ui: {
+ ...state.ui,
+ selectedEntry: shaveObjectEntriesFromObject(
+ state.ui.selectedEntry,
+ key => `<>`
+ ),
+ },
+ };
+ }
+ return state;
+ },
+ })
});
-if(process.env.NODE_ENV !== 'production' && module && module.hot) {
+if(__DEV__ && module && module.hot) {
module.hot.accept(() => store.replaceReducer(createReducer()));
}