diff --git a/client/components/index.js b/client/components/index.js index f44bd2e2..0cbab7df 100644 --- a/client/components/index.js +++ b/client/components/index.js @@ -6,6 +6,7 @@ import Loading from './Loading/Loading.js' import MockDoc from './MockDoc/MockDoc.js' import ProjectCard from './ProjectCard/ProjectCard.js' import Subnav from './Subnav/Subnav.js' +import Postman from './Postman/Postman' export { Breadcrumb, @@ -15,5 +16,6 @@ export { Loading, MockDoc, ProjectCard, - Subnav + Subnav, + Postman } diff --git a/client/containers/Project/Interface/Interface.js b/client/containers/Project/Interface/Interface.js index c1d78fa5..3d763a9a 100644 --- a/client/containers/Project/Interface/Interface.js +++ b/client/containers/Project/Interface/Interface.js @@ -82,7 +82,7 @@ class Interface extends Component { - + diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js b/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js index 99e34e26..60b48c85 100644 --- a/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceCaseContent.js @@ -3,6 +3,8 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types' import { withRouter } from 'react-router' import { fetchInterfaceColList, setColData, fetchCaseData } from '../../../../reducer/modules/interfaceCol' +import { Postman } from '../../../../components' +// import Run from @connect( state => { @@ -11,7 +13,8 @@ import { fetchInterfaceColList, setColData, fetchCaseData } from '../../../../re currColId: state.interfaceCol.currColId, currCaseId: state.interfaceCol.currCaseId, currCase: state.interfaceCol.currCase, - isShowCol: state.interfaceCol.isShowCol + isShowCol: state.interfaceCol.isShowCol, + currProject: state.project.currProject } }, { @@ -33,7 +36,8 @@ export default class InterfaceCaseContent extends Component { currColId: PropTypes.number, currCaseId: PropTypes.number, currCase: PropTypes.object, - isShowCol: PropTypes.bool + isShowCol: PropTypes.bool, + currProject: PropTypes.object } constructor(props) { @@ -75,10 +79,14 @@ export default class InterfaceCaseContent extends Component { } render() { + const { currCase, currProject } = this.props; + const data = Object.assign({}, currCase, currProject); return (
-

hello caseContent

- {JSON.stringify(this.props.currCase, null, 2)} +

{currCase.casename}

+
+ +
) } diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js index deee76ba..15c16abb 100644 --- a/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js +++ b/client/containers/Project/Interface/InterfaceCol/InterfaceColContent.js @@ -46,7 +46,9 @@ export default class InterfaceColContent extends Component { let { currColId } = this.props; const params = this.props.match.params; const { actionId } = params; - currColId = +actionId || +currColId || result.payload.data.data[0].caseList[0]._id; + currColId = +actionId || + result.payload.data.data.find(item => +item._id === +currColId) && +currColId || + result.payload.data.data[0]._id; this.props.history.push('/project/' + params.id + '/interface/col/' + currColId) this.props.fetchCaseList(currColId) this.props.setColData({currColId: +currColId, isShowCol: true}) @@ -66,24 +68,24 @@ export default class InterfaceColContent extends Component { const { currCaseList } = this.props; const columns = [{ - title: '名字', + title: '用例名称', dataIndex: 'casename', key: 'casename' }, { - title: '方法', - dataIndex: 'method', - key: 'method' - }, { - title: 'PATH', + title: '用例路径', dataIndex: 'path', key: 'path' + }, { + title: '请求方式', + dataIndex: 'method', + key: 'method' }]; return (
-

接口集合

- +

测试集合

+
) diff --git a/client/containers/Project/Interface/InterfaceList/Run/Run.js b/client/containers/Project/Interface/InterfaceList/Run/Run.js index 81595052..444f6835 100644 --- a/client/containers/Project/Interface/InterfaceList/Run/Run.js +++ b/client/containers/Project/Interface/InterfaceList/Run/Run.js @@ -68,8 +68,6 @@ export default class Run extends Component { getInterfaceState(nextProps) { const props = nextProps || this.props; const { currInterface, currProject } = props; - console.log('currInterface', currInterface) - console.log('currProject', currProject) const { method, path: url,