{/*TestGrid generated contents*/}
- {(() => {
- switch (this.state.logDownloadStatus) {
- case "ERROR":
- return
-
- Oh snap!
- Error occurred when downloading the log file content.
-
;
- case "SUCCESS":
- return
- }>
- (fetch(this.state.logDownloadLink, {
- method: "GET",
- headers: {
- 'Accept': 'application/json'
- }
- }).then(response => {
- return response.json();
- }).then(data => {
- Download(data.inputStreamContent, "test-run.log", "plain/text");
- }
- ))}
- />
- ;
- case "PENDING":
- default:
- return
-
-
- Loading test log...
-
-
-
;
- }
- })()}
+
+ }>
+ (fetch(logAllContentUrl, {
+ method: "GET",
+ headers: {
+ 'Accept': 'application/json'
+ }
+ }).then(response => {
+ this.setState({
+ showLogDownloadErrorDialog: !response.ok
+ });
+ return response.json();
+ }).then(data => {
+ if (!this.state.showLogDownloadErrorDialog) {
+ Download(data.inputStreamContent, "test-run.log", "plain/text");
+ }
+ }
+ ))}
+ />
+
+
{divider}
{/*Scenario execution summary*/}
@@ -444,80 +448,112 @@ class TestRunView extends Component {
{/*Test log*/}
Test Run Log
+ {/*Display log from file system*/}
{(() => {
- switch (this.state.logDownloadStatus) {
- case "ERROR":
- return
-
- Oh snap!
- Error occurred when downloading the log file content.
-
;
- case "SUCCESS":
- return
-
-
-
- {this.state.isLogTruncated ?
-
-
- (fetch(this.state.logDownloadLink, {
- method: "GET",
- headers: {
- 'Accept': 'application/json'
- }
- }).then(response => {
- this.setState({
- logDownloadStatus: response.ok ? "SUCCESS" : "ERROR"
- });
- return response;
- }).then(data => data.json().then(json =>
- this.setState({
- logDownloadStatus: "SUCCESS",
- logContent: json.inputStreamContent,
- isLogTruncated: false
- }),
- )))}
- label={"See More (" + this.state.inputStreamSize + ")"}
- labelStyle={{
- fontSize: '20px',
- fontWeight: 600
- }}
- style={{
- color: '#0E457C'
- }}/>
-
-
- : ""}
-
;
+ switch (this.props.active.reducer.currentInfra.testPlanStatus) {
case "PENDING":
- default:
- return
-
-
- Loading test log...
-
-
-
;
+ case "RUNNING":
+ return (
+
{
+ this.handleLiveLogData(data)
+ }}/>
+
+
+ );
+ case "FAIL":
+ case "SUCCESS":
+ default: {
+ // Display Log from S3
+ switch (this.state.logDownloadStatus) {
+ case "ERROR":
+ return
+
+ Oh snap!
+ Error occurred when downloading the log file content.
+
;
+ case "SUCCESS":
+ return
+
+ {this.state.isLogTruncated ?
+
+
+ (fetch(logAllContentUrl, {
+ method: "GET",
+ headers: {
+ 'Accept': 'application/json'
+ }
+ }).then(response => {
+ this.setState({
+ logDownloadStatus: response.ok ? "SUCCESS" : "ERROR"
+ });
+ return response;
+ }).then(data => data.json().then(json =>
+ this.setState({
+ logContent: json.inputStreamContent,
+ isLogTruncated: false
+ }),
+ )))}
+ label={"See More (" + this.state.inputStreamSize + ")"}
+ labelStyle={{
+ fontSize: '20px',
+ fontWeight: 600
+ }}
+ style={{
+ color: '#0E457C'
+ }}/>
+
+
+ : ""}
+
;
+ case "PENDING":
+ default:
+ return
+
+
+ Loading test log...
+
+
+
;
+ }
+ }
}
})()}