From b205f8f6c14fa12dd1e7a929dd24918d0fe00e36 Mon Sep 17 00:00:00 2001 From: mahdi Date: Tue, 7 Nov 2023 16:35:50 -0500 Subject: [PATCH] frontend: fixing the bug of json file --- frontend/src/app/selenium/test-selenium.component.html | 8 ++++---- frontend/src/app/selenium/test-selenium.component.ts | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/selenium/test-selenium.component.html b/frontend/src/app/selenium/test-selenium.component.html index 86a6f94..cd50b92 100644 --- a/frontend/src/app/selenium/test-selenium.component.html +++ b/frontend/src/app/selenium/test-selenium.component.html @@ -63,9 +63,9 @@

-

Case #{{case.id}} : {{case.caseName}}

+

Case #{{case.case_id}} : {{case.caseName}}

- @@ -81,12 +81,12 @@

Case #{{case.id}} : {{case.caseName}}

- {{action.action}} + {{action.action_type_name}} {{action.object}} {{action.input}} {{action.target}} - diff --git a/frontend/src/app/selenium/test-selenium.component.ts b/frontend/src/app/selenium/test-selenium.component.ts index abb2d30..b245361 100644 --- a/frontend/src/app/selenium/test-selenium.component.ts +++ b/frontend/src/app/selenium/test-selenium.component.ts @@ -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); @@ -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; @@ -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;