Skip to content

Commit

Permalink
New Features:
Browse files Browse the repository at this point in the history
1. System Tests finished
New Pages:
1. Test History
2. Test Execution
3. Test Results
Bugs Corrected:
To Be Corrected:
0. On product delete, delete trace results
1. On product delete, delete flamegraph result
2. Add AI to System Tests
  • Loading branch information
juanfranciscocis committed Sep 3, 2024
1 parent 2e299bf commit feecc20
Show file tree
Hide file tree
Showing 37 changed files with 520 additions and 107 deletions.
49 changes: 34 additions & 15 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,36 +124,55 @@ const routes: Routes = [
},
{
path: 'flame-graph-compare',
loadChildren: () => import('./pages/flame-graph-compare/flame-graph-compare.module').then( m => m.FlameGraphComparePageModule)
loadChildren: () => import('./pages/flame-graph-compare/flame-graph-compare.module').then( m => m.FlameGraphComparePageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'board',
loadChildren: () => import('./pages/board/board.module').then( m => m.BoardPageModule)
path: 'software-testing',
loadChildren: () => import('./pages/software-testing/software-testing.module').then( m => m.SoftwareTestingPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'render-restart',
loadChildren: () => import('./pages/render-restart/render-restart.module').then( m => m.RenderRestartPageModule)
path: 'software-testing-chooser',
loadChildren: () => import('./pages/software-testing-chooser/software-testing-chooser.module').then( m => m.SoftwareTestingChooserPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'software-testing',
loadChildren: () => import('./pages/software-testing/software-testing.module').then( m => m.SoftwareTestingPageModule)
path: 'create-system-test',
loadChildren: () => import('./pages/create-system-test/create-system-test.module').then( m => m.CreateSystemTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'system-tests',
loadChildren: () => import('./pages/system-tests/system-tests.module').then( m => m.SystemTestsPageModule)
path: 'execute-system-test',
loadChildren: () => import('./pages/execute-system-test/execute-system-test.module').then( m => m.ExecuteSystemTestPageModule),
...canActivate(redirectUnauthorizedToLogin),
},







{
path: 'create-system-test',
loadChildren: () => import('./pages/create-system-test/create-system-test.module').then( m => m.CreateSystemTestPageModule)
path: 'board',
loadChildren: () => import('./pages/board/board.module').then( m => m.BoardPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'execute-system-test',
loadChildren: () => import('./pages/execute-system-test/execute-system-test.module').then( m => m.ExecuteSystemTestPageModule)
path: 'render-restart',
loadChildren: () => import('./pages/render-restart/render-restart.module').then( m => m.RenderRestartPageModule),
...canActivate(redirectUnauthorizedToLogin),
},
{
path: 'software-testing-chooser',
loadChildren: () => import('./pages/software-testing-chooser/software-testing-chooser.module').then( m => m.SoftwareTestingChooserPageModule)
path: 'view-history-system-test',
loadChildren: () => import('./pages/view-history-system-test/view-history-system-test.module').then( m => m.ViewHistorySystemTestPageModule)
},
{
path: 'view-system-test',
loadChildren: () => import('./pages/view-system-test/view-system-test.module').then( m => m.ViewSystemTestPageModule)
},

];

@NgModule({
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/create-system-test/create-system-test.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export class CreateSystemTestPage implements OnInit {

await this.hideLoading();

// Navigate to the last page
window.history.back();


}

Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/execute-system-test/execute-system-test.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export class ExecuteSystemTestPage implements OnInit {

await this.hideLoading()

// Navigate to the last page
window.history.back();

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ <h1>{{ failedSystemTests }}</h1>
<ion-card-title>{{ test.title }}</ion-card-title>
</ion-card-header>
<ion-card-content>
<ion-button color="primary" expand="block" (click)="navigateToExecuteTest(test.title)">View Test Results</ion-button>
<ion-button color="primary" expand="block" (click)="navigateToExecuteTest(test.title)">Execute Test</ion-button>
<ion-button color="primary" expand="block" (click)="navigateToViewHistorySystemTest(test.title)">View Test Results</ion-button>
<ion-button color="success" expand="block" (click)="navigateToExecuteSystemTest(test.title)">Execute Test</ion-button>
<ion-button color="danger" expand="block" (click)="deleteTest(test.title)">Delete Test</ion-button>
</ion-card-content>
</ion-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,20 @@ export class SoftwareTestingChooserPage implements OnInit {
step: this.productStep
}]);
}
navigateToExecuteTest(testTitle:string) {
navigateToExecuteSystemTest(testTitle:string) {
this.router.navigate(['/execute-system-test', {
productObjective: this.productObjective,
step: this.productStep,
testTitle: testTitle
}]);
}
navigateToViewHistorySystemTest(testTitle:string) {
this.router.navigate(['/view-history-system-test', {
productObjective: this.productObjective,
step: this.productStep,
testTitle: testTitle
}]);
}

/**
* Methods to calculate the number of passed and failed system tests.
Expand Down Expand Up @@ -140,24 +147,32 @@ export class SoftwareTestingChooserPage implements OnInit {
.filter(key => r[key].productStep === this.productStep)
.map(key => ({ timestamp: key, systemTest: r[key].systemTest }));

// Sort the data by timestamp
// @ts-ignore
for (let i = 0; i < filteredData.length; i++) {
for (let j = 0; j < filteredData.length - 1; j++) {
if (new Date(filteredData[j].timestamp).getTime() > new Date(filteredData[j + 1].timestamp).getTime()) {
let temp = filteredData[j];
filteredData[j] = filteredData[j + 1];
filteredData[j + 1] = temp;
}
}
}
// Sort the data by timestamp year, month, and day
filteredData.sort((a, b) => {
const dateA = new Date(a.timestamp).getTime();
const dateB = new Date(b.timestamp).getTime();
return dateA - dateB; // Sort in ascending order (oldest first)
});

// count the number of passed and failed tests for each date
let data = [
]

for (let test of filteredData) {
let date = new Date(test.timestamp).toLocaleDateString();

let reordered = test.timestamp.split(' ')[0].split('-');
let ordered = [reordered[2], reordered[1], reordered[0]];
console.log(ordered);
let orderTimestamp = ordered.join('/');
console.log(orderTimestamp);

let addTime = test.timestamp.split(' ')[1];

let concat = orderTimestamp + ' ' + addTime;
console.log(concat);
let date = new Date(concat).toLocaleDateString();


let passed = test.systemTest.state ? 1 : 0;
let failed = test.systemTest.state ? 0 : 1;

Expand Down
20 changes: 0 additions & 20 deletions src/app/pages/system-tests/system-tests.module.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/app/pages/system-tests/system-tests.page.html

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/pages/system-tests/system-tests.page.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/pages/system-tests/system-tests.page.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ViewHistorySystemTestPage } from './view-history-system-test.page';

const routes: Routes = [
{
path: '',
component: ViewHistorySystemTestPage
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ViewHistorySystemTestPageRoutingModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';

import { IonicModule } from '@ionic/angular';

import { ViewHistorySystemTestPageRoutingModule } from './view-history-system-test-routing.module';

import { ViewHistorySystemTestPage } from './view-history-system-test.page';
import {ComponentsModule} from "../../components/components.module";

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ViewHistorySystemTestPageRoutingModule,
ComponentsModule
],
declarations: [ViewHistorySystemTestPage]
})
export class ViewHistorySystemTestPageModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<app-header-return [title]="'History System Tests: ' + testTitle"></app-header-return>

<ion-content [fullscreen]="true">
<ion-grid>
<app-title [title]="'History System Tests: '+testTitle"></app-title>
<ion-row class="lg:m-10 md:m-10">
<ion-col size="12" size-md="4" size-lg="4" class="">
<p>System tests results for product step: {{productStep}}. Test title: {{testTitle}}</p>
</ion-col>
</ion-row>
<ion-row class="lg:m-10 md:m-10">
<ion-col size="6" size-md="6" size-lg="6" class="">
<ion-card>
<ion-card-header>
<ion-card-title class="flex flex-col justify-center items-center text-green-600">Passed Tests</ion-card-title>
</ion-card-header>
<ion-card-content class="flex flex-col justify-center items-center">
<h1>{{passed}}</h1>
</ion-card-content>
</ion-card>
</ion-col>
<ion-col size="6" size-md="6" size-lg="6" class="">
<ion-card>
<ion-card-header>
<ion-card-title class="flex flex-col justify-center items-center text-red-800">Failed Tests</ion-card-title>
</ion-card-header>
<ion-card-content class="flex flex-col justify-center items-center">
<h1>{{failed}}</h1>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
<ion-grid>
<ion-row class="lg:m-10 md:m-10">
<ion-col size="12" size-md="12" size-lg="12" class="">
<ion-card>
<ion-card-content>
<ion-list>
@for (test of systemTestHistory; track systemTestHistory){
<ion-item>
<ion-label>
<h1 class="text-white">{{test.systemTest.title}} - {{test.timestamp}}</h1>
</ion-label>
@if (test.systemTest.state){
<ion-icon aria-hidden="true" name="checkmark-circle" slot="end" color="success"></ion-icon>
<ion-icon aria-hidden="true" name="close-circle" slot="end" color=""></ion-icon>
<ion-icon aria-hidden="true" name="trash" slot="end" color="" (click)="delete(test.timestamp)"></ion-icon>
<ion-icon aria-hidden="true" name="eye" slot="start" color="" (click)="navigateToViewHistorySystemTest(test)"></ion-icon>
}
@if (!test.systemTest.state){
<ion-icon aria-hidden="true" name="checkmark-circle" slot="end" color=""></ion-icon>
<ion-icon aria-hidden="true" name="close-circle" slot="end" color="danger"></ion-icon>
<ion-icon aria-hidden="true" name="trash" slot="end" color="" (click)="delete(test.timestamp)"></ion-icon>
<ion-icon aria-hidden="true" name="eye" slot="start" color="" (click)="navigateToViewHistorySystemTest(test)"></ion-icon>
}

</ion-item>
}
</ion-list>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>

</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewHistorySystemTestPage } from './view-history-system-test.page';

describe('ViewHistorySystemTestPage', () => {
let component: ViewHistorySystemTestPage;
let fixture: ComponentFixture<ViewHistorySystemTestPage>;

beforeEach(() => {
fixture = TestBed.createComponent(ViewHistorySystemTestPage);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit feecc20

Please sign in to comment.