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

Fix default selenium driver, onlyValidate & documentation #23

Merged
merged 1 commit into from
Dec 5, 2024
Merged
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
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ Documentation about MIG-T and the language can be found in this repo's [wiki](ht

# MIG-T API Documentation

Explore the API endpoints and documentation here: <https://app.swaggerhub.com/apis-docs/PGSENO02/MIG-TAPIs/1.0.0#/>

### API Endpoints

MIG-T supports both GUI and API interaction. Two endpoints are available for API interaction:
Expand All @@ -98,7 +96,7 @@ MIG-T supports both GUI and API interaction. Two endpoints are available for API

#### /execute [POST]

Check the validity of the test and run the test.
Check the validity of the test and run the test. The *onlyValidate* parameter is available, if enabled the test will only be validated but not executed (e.g., `/execute?onlyValidate=true`)

Input:
```json
Expand All @@ -114,6 +112,14 @@ Input:
Output:
- HTTP status code 200 (ok)

If the validation of the test fails, the output is:
```json
{
"success": false,
"error": "the error"
}
```

#### /result [GET]

Checks whether the test is finished and returns the result.
Expand Down
5 changes: 3 additions & 2 deletions tool/src/main/java/migt/ExecuteWebServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -111,8 +112,8 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest,

// verify errors
JsonObject result = new JsonObject();
String error = mainPane.lblOutput.getText();
if (false) {
if (mainPane.bot_tabbed.getBackgroundAt(mainPane.bot_tabs_index.get("Input JSON")) == Color.RED) {
String error = mainPane.txt_err_debug_tab.getText();
result.addProperty("success", false);
result.addProperty("error", error);
} else {
Expand Down
1 change: 1 addition & 0 deletions tool/src/main/java/migt/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public Main() {
//--------------------------------------
//DRIVER_PATH = Main.class.getClassLoader().getResource("driver/geckodriver").getPath();
//DRIVER_PATH = JOptionPane.showInputDialog(null, "enter the driver path:");
DRIVER_PATH = "";
//--------------------------------------

if (!DRIVER_PATH.equals("")) {
Expand Down
Loading