Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-19589 SBI TestKit Document created #83

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 45 additions & 29 deletions mds-test-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
# MdsTestUi

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.1.

Change url to point to spring boot server in environments/environment.ts file. Currently it is set to base_url: 'http://localhost:8080/'

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
# SBITestUi

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.1.

Change url to point to spring boot server in environments/environment.ts file. Currently it is set to base_url: 'http://localhost:8081/'

NodeJs is prerequisite

## Local Set up one time

Run `npm install` to download all the required configuration. `node_modules` will be created.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Since it is added inside java project and deployed together as one build, follow below step.

In 'environment.prod.ts' make below changes and revert after build is done.
base_url: 'http://test.mosip.io/phase2/',

In 'index.html' make below changes and revert after build is done.
<base href="/phase2/">

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
Run `ng build --prod`
Files inside `dist/` should be trasfered to mosip device service

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
4 changes: 3 additions & 1 deletion mds-test-ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { FooterComponent } from './components/footer/footer.component';
import { MatVideoModule } from 'mat-video';
import { ModalComponent } from './modal/modal.component';
import { DialogOverviewExampleDialog} from './auth/auth.component'
import { DialogOverviewCaptureDialog} from './capture/capture.component'

@NgModule({
declarations: [
Expand All @@ -31,7 +32,8 @@ import { DialogOverviewExampleDialog} from './auth/auth.component'
HeaderComponent,
FooterComponent,
ModalComponent,
DialogOverviewExampleDialog
DialogOverviewExampleDialog,
DialogOverviewCaptureDialog
],
imports: [
BrowserModule,
Expand Down
2 changes: 1 addition & 1 deletion mds-test-ui/src/app/auth/auth.compnent.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 mat-dialog-title>Authentication</h1>
<mat-label>Enter UIN</mat-label>
<input matInput name="data.uin" ngDefaultControl [(ngModel)]="data.uin">
</mat-form-field>
<p>* Default UIN is 6027349120, Provide your UIN to authenticate</p>
<p>* Default UIN is {{data.uin}}, Provide your UIN to authenticate</p>

</div>
<div mat-dialog-actions>
Expand Down
5 changes: 2 additions & 3 deletions mds-test-ui/src/app/auth/auth.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ export interface DialogData {
authloading = false;

data1 :DialogData;
uin=5698342963;
uin=6795809148;
testReportObject: any;
constructor(
private dataService: DataService,
private dialog: MatDialog,
public dialogRef: MatDialogRef<DialogOverviewExampleDialog>,
@Inject(MAT_DIALOG_DATA) public data: DialogData) {
console.log(data);

this.data1=data;
this.data1.uin="6027349120";
this.data1.uin="6795809148";
}

onNoClick(): void {
Expand Down
31 changes: 31 additions & 0 deletions mds-test-ui/src/app/capture/capture.compnent.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- <h1 mat-dialog-title>Hi {{data.testId}}</h1> -->
<h1 mat-dialog-title>Request Options</h1>

<div mat-dialog-content>
<!-- <p>Enter UIN</p> -->
<mat-form-field>
<mat-label>Enter Time Out(in ms)</mat-label>
<input matInput name="data.timeOut" ngDefaultControl [(ngModel)]="data.timeOut">
</mat-form-field>
<mat-form-field>
<mat-label>Enter Previous Hash</mat-label>
<input matInput name="data.previousHash" ngDefaultControl [(ngModel)]="data.previousHash">
</mat-form-field>
<mat-form-field>
<mat-label>Enter Request Score</mat-label>
<input matInput name="data.requestScore" ngDefaultControl [(ngModel)]="data.requestScore">
</mat-form-field>
<!-- <p>* Default UIN is 6027349120, Provide your UIN to authenticate</p> -->

</div>
<div mat-dialog-actions>
<!-- <button mat-raised-button *ngIf="isRequired(key)" (click)="getMDSResponse(testReportObject.testReport[key].requestData,
testReportObject.testReport[key].runId, key,null)" [class.spinner]="loading" [disabled]="loading">
{{getButtonName(testReportObject.testReport[key].requestData)}}</button> -->

<button mat-raised-button (click)="getMDSResponse()"
[class.spinner]="authloading" [disabled]="authloading">{{getButtonName()}}</button>

<button mat-button [mat-dialog-close]="data.timeOut" cdkFocusInitial>Ok</button>
</div>

62 changes: 62 additions & 0 deletions mds-test-ui/src/app/capture/capture.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.example-form {
min-width: 150px;
max-width: 500px;
width: 100%;
margin: 18px;
}

.example-full-width {
width: 100%;
}


.mat-form-field {
font-size: 14px;
width: 100%;
}


:host ::ng-deep .mat-tab-body-wrapper {
min-height: 150px;

}

:host ::ng-deep .mat-tab-body.mat-tab-body-active {
min-height: 150px;

}

.Passed{color: green;}
.Failed{color: red;}

.centereddiv {
text-align: center;
color: #2c3e50;
margin-top: 60px;
}

#video {
border: 5px solid transparent;
background-color: #000000;
}


@keyframes spinner {
to {transform: rotate(360deg);}
}

.spinner:before {
content: '';
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin-top: -10px;
margin-left: -10px;
border-radius: 50%;
border: 2px solid #ffffff;
border-top-color: #000000;
animation: spinner .8s linear infinite;
}
Loading