Skip to content

Commit

Permalink
frontend: fixing the bug of json file
Browse files Browse the repository at this point in the history
  • Loading branch information
gueddimo29 committed Nov 7, 2023
1 parent 1b667c5 commit b205f8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions frontend/src/app/selenium/test-selenium.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ <h5 class="modal-title">New Case</h5>
</div><br><br>
<div class="container" *ngFor="let case of cases">

<h4>Case #{{case.id}} : {{case.caseName}}</h4>
<h4>Case #{{case.case_id}} : {{case.caseName}}</h4>
<span>
<button type="button" class="btn btn-danger" style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;" (click)="deleteCase(case.id)">
<button type="button" class="btn btn-danger" style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;" (click)="deleteCase(case.case_id)">
Delete
</button>
</span>
Expand All @@ -81,12 +81,12 @@ <h4>Case #{{case.id}} : {{case.caseName}}</h4>
</thead>
<tbody class="table-group-divider">
<tr *ngFor="let action of case.actions">
<td>{{action.action}}</td>
<td>{{action.action_type_name}}</td>
<td>{{action.object}}</td>
<td>{{action.input}}</td>
<td>{{action.target}}</td>
<td>
<button type="button" class="btn btn-danger" style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;" (click)="deleteAction(case.id,action.id)">
<button type="button" class="btn btn-danger" style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;" (click)="deleteAction(case.case_id,action.action_id)">
Delete
</button>
</td>
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/app/selenium/test-selenium.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class TestSeleniumComponent {

runMethod(cases: any) {
const apiUrl = '/api/testselenium';
this.http.get(apiUrl, cases).subscribe(
this.http.post(apiUrl, cases).subscribe(
(response) => {
console.log('tested successfully:', response);

Expand All @@ -38,7 +38,8 @@ export class TestSeleniumComponent {
}

actionChose(): void {
const action = (document.getElementById('action') as HTMLSelectElement).innerText;
const action2 = (document.getElementById('action') as HTMLSelectElement);
const action =action2.options[action2.selectedIndex].text;
const object = document.getElementById('object') as HTMLInputElement;
const input = document.getElementById('input') as HTMLInputElement;
const target = document.getElementById('target') as HTMLInputElement;
Expand Down Expand Up @@ -84,7 +85,8 @@ export class TestSeleniumComponent {

submitAction(){
let action_id = parseInt((document.getElementById('action') as HTMLSelectElement).value);
let action = (document.getElementById('action') as HTMLSelectElement).innerText;
let action2 = (document.getElementById('action') as HTMLSelectElement);
let action =action2.options[action2.selectedIndex].text;
let object = (document.getElementById('object') as HTMLInputElement).value;
let input = (document.getElementById('input') as HTMLInputElement).value;
let target = (document.getElementById('target') as HTMLInputElement).value;
Expand Down

0 comments on commit b205f8f

Please sign in to comment.