Commit 216fcf27 authored by Watchtek's avatar Watchtek
Browse files

Add validation check on user input 1

parent a35ce7a0
Loading
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -23,8 +23,20 @@ class MultipleTest(unittest.TestCase):
    def _get_user_inputs(self):
        """Helper method to get user inputs and set up initial configuration."""
        # Test case user input
        while True:
            print("1. [필수 입력] Chrome 위치 (e.g., /opt/chrome-linux64/chrome, D:\\tmp\\chrome-win64\\chrome.exe): ")
        self.binary_location = input().strip()
            chrome_path = input().strip()

            if not chrome_path:
                print("잘못 입력하였습니다. 다시 입력해주세요.\n")
                continue

            if os.path.exists(chrome_path) and os.path.isfile(chrome_path):
                self.binary_location = chrome_path
                break
            else:
                print(f"입력한 경로가 존재하지 않거나 파일이 아닙니다: {chrome_path}")
                print("다시 입력해주세요.\n")

        print("\n2. [필수 입력] 테스트 대상 웹 (e.g., https://example.com:8443/): ")
        self.dc_address = input()