Skip to main content

Code share - Test Run Summary Table with collapsible point of failure details

Video is here.

Code is here:

File: myscript1.js

function repeatTest($scope) {
  $scope.tests = [
    {testName: "Test1", overallResult: "Pass", firstError: "-", lastError: "-"},
    {testName: "Test2", overallResult: "Fail", firstError: "Page not found", lastError: "Page not found"},
    {testName: "Test3", overallResult: "Fail", firstError: "Could not select value in combobox - EmpAgeRange", lastError: "Could not find editbox - EmpAddressLine2"}
  ];
}


File: index.html

<!DOCTYPE html>
<html>

  <head>
    <script src="http://code.angularjs.org/1.2.0-rc.2/angular.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="myscript1.js"></script>

  </head>

  <body ng-app="">
    <h1>Test Run Summary</h1>
    <div ng-controller="repeatTest">
      <table>
        <thead style="background-color: lightgray;">
          <tr>
            <td style="width: 30px;"></td>
            <td>Test Name</td>
            <td>Overall Result</td>
          <td>Point of Failure</td>
          </tr>  
        </thead>
        
        
        
        <tbody>
          <tr ng-repeat-start="test in tests">
            <td>
              <button ng-if="test.expanded" ng-click="test.expanded = false">-</button>
              <button ng-if="!test.expanded" ng-click="test.expanded = true">+</button>
            </td>
            <td>{{test.testName}}</td>
            <td>{{test.overallResult}}</td>
          </tr>
          <tr ng-if="test.expanded">
          <td />
          <td />
          <td />
            <td colspan="1">First Error: <br>{{test.firstError}}</td>
          </tr>
          <tr ng-if="test.expanded" ng-repeat-end="">
          <td />
          <td />
          <td />
            <td colspan="1">Last Error: <br>{{test.lastError}}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </body> 
</html> 

Comments

Popular posts from this blog

Hello World in iPhone

meines erstes iphone Programm - Gemacht durch Code

Experimenting with Visio and VBScript

This diagram is created:               using this code:                                                                         Copy the code: Option Explicit Dim strVSDPath, filesys Dim vsoApplication, vsoDocument, vsoPages, vsoPage Dim vsoMaster1, vsoMaster2, vsoStencil Dim vsoShape1, vsoShape2, vsoConnector1 Dim itr Const visAutoConnectDirDown = 2     'Connect down. Const visAutoConnectDirLeft = 3     'Connect to the left. Const visAutoConnectDirNone = 0     'Connect without relocating the shapes. Const visAutoConnectDirRight = 4     'Connect to the right. Const visAutoConnectDirUp = 1         'Connect up....