Esempio n. 1
0
def mobile_ios_devices(mobile_os_version):
    "Get device name for ios devices"
    questionary.print("The devices that support iOS %s has been listed.\
                       \nPlease select any one device"%(mobile_os_version),
                       style = "bold fg:green")
    if mobile_os_version == "8.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 6",
                                          "iPhone 6 Plus",
                                          "Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "9.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 6S","iPhone 6S Plus",
                                          "Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "10.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 7",
                                          "Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "11.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 6","iPhone 6S",
                                          "iPhone 6S Plus","iPhone SE",
                                          "Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "12.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 7","iPhone 8",
                                          "iPhone XS","Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "13.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 11","iPhone 11 Pro",
                                          "iPhone 8","Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    elif mobile_os_version == "14.0":
        device_name = questionary.select("Select the device name",
                                          choices=["iPhone 11","iPhone 12",
                                          "iPhone 12 Pro","Other Devices"]).ask()
        if device_name == "Other Devices":
            device_name = questionary.text("Enter the device name").ask()

    else:
        device_name = questionary.text("Enter the Device name").ask()

    return device_name
Esempio n. 2
0
    def decrypt(self):
        message = questionary.text("Enter message to decrypt:", multiline=True).unsafe_ask()

        decrypted = self.gpg.decrypt(message)
        if decrypted.ok:
            questionary.print(str(decrypted), style=STYLE_TXT)
        else:
            questionary.print("Decryption failed: " + decrypted.status, style=STYLE_ERR)
Esempio n. 3
0
    def verify_signature(self):
        message = questionary.text("Enter message to verify:", multiline=True).unsafe_ask()

        result = self.gpg.verify(message)
        if result:
            questionary.print("Valid data", style=STYLE_TXT)
        else:
            questionary.print("Message could not be verified!", style=STYLE_ERR)
Esempio n. 4
0
def get_os_name(remote_flag):
    "Get OS Name"
    os_name = questionary.select("Enter the OS version",choices=conf.os_list).ask()
    os_version = []
    if remote_flag == "Y":
        questionary.print("Please select the OS Version",style="bold fg:darkred")

    return os_name, os_version
Esempio n. 5
0
def go():
    """
    Main program, takes users input (their current
    car and daily miles estimation) to compare their
    annual carbon emissions and spendings to that of
    other drivers. Program will then make recommendations
    of necessary milage reduction and potential new car
    purchases.
    """
    # Creates database if none already exists, skips this
    # computationally expensive processes otherwise.
    try:
        conn = sqlite3.connect('file:cscc.db?mode=rw', uri=True)
    except sqlite3.OperationalError:
        print('Local Database not found.\n' 'Creating database...')
        conn = sqlite3.connect('cscc.db')
        build_db(conn)

    id_ = get_id(conn)
    use_miles = get_miles()

    emissions, gpm = get_emissions(conn, id_, use_miles)
    reduce_str = get_cut_recommendation(emissions, gpm)
    q.print(f'\nYearly CO2 emission: {emissions} grams.', style=S_CONFIG[1][1])
    q.print(reduce_str, style=S_CONFIG[1][1])
    input('Press any key to continue...\n')

    rank_order = rank_pref()
    rec_df = recommend_cars(conn, id_, use_miles, rank_order, gpm)
    if isinstance(rec_df, str):
        final_df = rec_df
    else:
        q.print('\nCalculating recommendations...', style=S_CONFIG[1][1])
        if emissions < AVG_EMISSION:
            q.print(
                'Here are some cars that would help you further decrease '
                'your carbon emission:',
                style=S_CONFIG[1][1])
        else:
            q.print(
                'Here are some cars that would help you decrease your '
                'carbon emission to the average:',
                style=S_CONFIG[1][1])
        df_with_savings = get_savings(conn, id_, use_miles, rec_df)
        df_with_prices, old_car_price = get_car_prices(df_with_savings)
        full_df = calculate_savings(df_with_prices, old_car_price)
    col = [
        'make', 'model', 'year', 'co2_emission', 'weekly_savings',
        'yearly_savings', 'price', 'difference', 'five_year_savings'
    ]
    final_df = full_df[col]
    final_df = final_df.sort_values(['five_year_savings', 'co2_emission'],
                                    ascending=[False, True])
    print(
        final_df.to_string(index=False,
                           max_colwidth=20,
                           float_format=lambda x: f'{x:.2f}'))
    conn.close()
Esempio n. 6
0
    def import_public_key(self):
        key = questionary.text("Enter public key to import:", multiline=True).unsafe_ask()

        import_result = self.gpg.import_keys(key)
        if import_result.count == 0:
            questionary.print(import_result, style=STYLE_ERR)
            questionary.print(import_result.count, style=STYLE_ERR)
            questionary.print(import_result.fingerprints, style=STYLE_ERR)
            questionary.print("Import Failed", style=STYLE_ERR)
        else:
            questionary.print("Import Succeed", style=STYLE_TXT)
Esempio n. 7
0
    def list_keys(self):
        public_keys = self.gpg.list_keys(False)

        is_empty = True
        for pub_key in public_keys:
            for uid in pub_key['uids']:
                questionary.print(pub_key['keyid'] + "\t" + uid, style=STYLE_TXT)
                is_empty = False

        if is_empty:
            questionary.print("No keys configured", style=STYLE_TXT)
Esempio n. 8
0
 def not_existing_directory(self, home_dir):
     question = "Directory '" + home_dir + "' does not exists. Create a directory?"
     result = questionary.confirm(question).unsafe_ask()
     if result:
         try:
             os.mkdir(home_dir)
             questionary.print("Directory created. No keypairs configured.", style=STYLE_TXT)
         except OSError:
             questionary.print("Could not create directory", style=STYLE_ERR)
             sys.exit(1)
     else:
         sys.exit(0)
Esempio n. 9
0
 def delete_public_key(self):
     delete_password = [{
         'type': 'list',
         'name': 'delete_public',
         'message': 'Do you really want to delete public key?',
         'choices': ['Yes', 'No'],
         'filter': lambda val: val.lower(),
     }]
     answer = prompt(delete_password, style=custom_style_fancy)
     if answer['delete_public'] == 'yes':
         crypto = CryptoUtility()
         if crypto.delete_public_key_file():
             print('Successfully deleted!')
Esempio n. 10
0
    def sign(self):

        signer_key = self.select_id()
        if signer_key is None:
            return

        message = questionary.text("Enter message to sign:", multiline=True).unsafe_ask()

        # TODO: Check OK Value after Signing
        signature = self.gpg.sign(message, keyid=signer_key)
        signature_string = str(signature)
        questionary.print(signature_string, style=STYLE_TXT)
        self.add_to_clipboard(signature_string)
Esempio n. 11
0
def ask_questions_api(api_url,session_flag=True):
    """This module asks the users questions to fetch the options
       they wish to run the api test with and stores their choices"""
    clear()
    while True:

        questionary.print("\nSeleted Options",style="bold fg:green")
        questionary.print("**********",style="bold fg:green")
        print("API URL:",api_url)
        print("Session flag status:",session_flag)
        questionary.print("**********",style="bold fg:green")
        response = get_user_response_api()
        clear()
        if response == "Session flag status":
            session_flag = get_sessionflag_status()

        if response == "API URL":
            api_url = get_api_url()

        if response == "Reset back to default settings":
            api_url = api_example_conf.api_url
            session_flag = True
            questionary.print("Reverted back to default settings",
                               style="bold fg:green")

        if response == "Run":
            break

        if response == "Exit":
            sys.exit("Program interrupted by user, Exiting the program....")

    return api_url,str(session_flag)
Esempio n. 12
0
    def select_id(self):
        choices = {}
        public_keys = self.gpg.list_keys(True)
        for pub_key in public_keys:
            for uid in pub_key['uids']:
                choices[uid] = pub_key['keyid']

        if not choices.keys():
            questionary.print("No keys configured. Create a keypair.", style=STYLE_ERR)
            return

        selection = questionary.select("Which ID do you want to use?", choices=choices.keys(), use_shortcuts=True).unsafe_ask()

        selected_key_id = choices[selection][0:16]
        return selected_key_id
Esempio n. 13
0
    def select_recipient(self):
        choices = {}
        public_keys = self.gpg.list_keys(False)
        for pub_key in public_keys:
            for uid in pub_key['uids']:
                choices[uid] = pub_key['keyid']

        if not choices.keys():
            questionary.print("No Public Keys available. Import Public Key.", style=STYLE_ERR)
            return

        selection = questionary.select("Select Recipient", choices=choices.keys(), use_shortcuts=True).unsafe_ask()

        selected_key_id = choices[selection][0:16]
        return selected_key_id
Esempio n. 14
0
def set_remote_credentials():
    "set remote credentials file to run the test on browserstack or saucelabs"
    platform = questionary.select("Select the remote platform on which you wish to run the test on",
                                   choices=["Browserstack","Saucelabs"]).ask()
    if platform == "Browserstack":
        platform = "BS"
    else:
        platform = "SL"
    username = questionary.text("Enter the Username").ask()
    password = questionary.password("Enter the password").ask()
    with open("conf/remote_credentials.py",'w') as cred_file:
        cred_file.write("REMOTE_BROWSER_PLATFORM = '%s'\
                         \nUSERNAME = '******'\
                         \nACCESS_KEY = '%s'"%(platform,username,password))
    questionary.print("Updated the credentials successfully",
                       style="bold fg:green")
Esempio n. 15
0
 def main_menu(self):
     questions = [{
         'type': 'list',
         'name': 'questions',
         'message': 'What do you want to do?',
         'choices': ['Encrypt', 'Open config', 'Quit'],
         'filter': lambda val: val.lower(),
     }]
     answer = prompt(questions, style=custom_style_fancy)
     while answer['questions'] != 'quit':
         if answer['questions'] == 'encrypt':
             self.encrypt()
         elif answer['questions'] == 'open config':
             self.configure_public_key()
         answer = prompt(questions, style=custom_style_fancy)
     print('Bye Bye...')
Esempio n. 16
0
def rank_pref():
    """
    Ranks vehicle attributes that user cares most about from their
    current car. Uses this information to more accurately recommend
    a new vehicle.

    Returns:
        lst: elements are arranged in order of priority
    """
    CHOICES = [
        'Make', 'Year', 'Transmission', 'Vehicle Class', 'Fuel Type',
        'Passenger capacity', 'Luggage Capacity', 'Stop Ranking'
    ]
    DICT_MAP = {
        'Make': 'make',
        'Year': 'year',
        'Transmission': 'trany',
        'Vehicle Class': 'VClass',
        'Fuel Type': 'fuelType',
        'Luggage Capacity': 'luggage_volume'
    }
    q.print(
        'We will now ask you to rank which attributes you like most '
        'about your current vehicle.\nThese choices will be taken into '
        'consideration for car recommendation.\nYou may rank until you '
        "feel you have no more preferences or until you've exhausted all "
        'options.',
        style=S_CONFIG[1][1])

    i = 1
    pref = ''
    rank_order = []
    while len(CHOICES) > 2:
        pref = q.select('Choose preference: ',
                        choices=CHOICES,
                        style=Style(S_CONFIG),
                        qmark='\n' + str(i)).ask()
        if pref == 'Stop Ranking':
            break
        CHOICES.remove(pref)
        rank_order.append(pref)
        i += 1
    if len(CHOICES) == 2:
        rank_order.append(CHOICES[0])
    # Rename items in rank list to the less human readable col names
    return list((pd.Series(rank_order, dtype='object')).map(DICT_MAP))
Esempio n. 17
0
def get_os_version(os_name):
    "Get OS Version"
    if os_name == "windows":
        os_version = questionary.select("Select the OS version",
                                         choices=conf.windows_versions).ask()
    elif os_name == "OS X":
        if remote_credentials.REMOTE_BROWSER_PLATFORM == "SL":
            os_version = questionary.select("Select the OS version",
                                             choices=conf.sauce_labs_os_x_versions).ask()
        else:
            os_version = questionary.select("Select the OS version",
                                             choices=conf.os_x_versions).ask()
    else:
        os_version= []
        questionary.print("Please select the OS Name first",
                           style="bold fg:darkred")

    return os_version
Esempio n. 18
0
    def create_keypair(self):
        questionary.print("Creating a new ID/Key", style=STYLE_TXT)

        name = questionary.text("What's your fullname?").unsafe_ask()
        email = questionary.text("What's your e-mail address?").unsafe_ask()
        length_options = ["1024", "2048", "4096"]
        key_length = questionary.select("Key Length", choices=length_options, use_shortcuts=True).unsafe_ask()

        input_data = self.gpg.gen_key_input(key_type="RSA",
                                            key_length=int(key_length),
                                            name_real=name,
                                            name_email=email)
        proceed = questionary.confirm("Generate?").unsafe_ask()
        if proceed:
            key_id = self.gpg.gen_key(input_data)
            key_id = str(key_id)
            questionary.print("Key generated: " + key_id, style=STYLE_TXT)
            print()
            self.print_key(key_id)
Esempio n. 19
0
def get_mobile_os_name():
    "Get the mobile OS name"
    mobile_os_name=questionary.select("Select the Mobile OS",
                                       choices=["Android","iOS"]).ask()

    if mobile_os_name == "Android":
        mobile_os_version = "8.0"
        device_name = "Samsung Galaxy S9"
        questionary.print("The default os version and device for Android has been selected.\
                           \nYou can change it as desired from the menu",
                           style="bold fg:green")
    if mobile_os_name == "iOS":
        mobile_os_version = "8.0"
        device_name = "iPhone 6"
        questionary.print("The default os version and device for iOS has been selected.\
                           \nYou can change it as desired from the menu",
                           style="bold fg:green")

    return mobile_os_name, mobile_os_version, device_name
Esempio n. 20
0
    def encrypt(self, sign=False):

        signer_key = None
        if sign:
            signer_key = self.select_id()
            if signer_key is None:
                return

        recipient = self.select_recipient()
        if recipient is None:
            return

        message = questionary.text("Enter message to encrypt:", multiline=True).unsafe_ask()

        encrypted_ascii_data = self.gpg.encrypt(message, recipient, sign=signer_key, always_trust=True)
        if encrypted_ascii_data.ok:
            data = str(encrypted_ascii_data)
            questionary.print(data, style=STYLE_TXT)
            self.add_to_clipboard(data)
        else:
            questionary.print("Encryption failed. " + encrypted_ascii_data.status + ", " + encrypted_ascii_data.stderr,
                              style=STYLE_ERR)
Esempio n. 21
0
    def main_menu(self):
        choices = {"Key Management": self.key_management,
                   "Encrypt": self.encrypt,
                   "Encrypt and Sign": self.encrypt_and_sign,
                   "Decrypt": self.decrypt,
                   "Sign": self.sign,
                   "Verify Signature": self.verify_signature,
                   "Exit": sys.exit}
        while True:
            try:
                questionary.print("")
                questionary.print("### SIMPLEGPG - MENU ###", style=STYLE_MENU)
                questionary.print("")
                selection = questionary.select("Select your task", choices=choices.keys(), use_shortcuts=True).unsafe_ask()

                choices[selection]()
            except KeyboardInterrupt:
                questionary.print(">> Action aborted", style=STYLE_ERR)
Esempio n. 22
0
 def encrypt(self):  # 1
     questions = [{
         'type': 'password',
         'message': 'Enter the password to encrypt',
         'name': 'password'
     }]
     crypto = CryptoUtility()
     if not crypto.import_public_key_from_file():
         print('No public Key found!')
     else:
         answer = prompt(questions, style=custom_style_fancy)
         print('Encrypted password: (use incl. "crypt:")\n')
         cipher_text = crypto.encrypt_text(answer['password'])
         print(f"{cipher_text}\n", style='bold blink #06c8ff')
Esempio n. 23
0
def set_default_flag_gui(browser,browser_version,os_version,os_name,
                         remote_flag,testrail_flag,tesults_flag):
    "This checks if the user wants to run the test with the default options or no"

    questionary.print("\nDefault Options",style="bold fg:green")
    questionary.print("**********",style="bold fg:green")
    display_gui_test_options(browser,browser_version,os_version,
                             os_name,remote_flag,testrail_flag,tesults_flag)
    questionary.print("**********",style="bold fg:green")

    default = questionary.select("Do you want to run the test with the default set of options?",
                                  choices=["Yes","No"]).ask()
    default_flag = True if default == "Yes" else False

    return default_flag
Esempio n. 24
0
 def set_public_key_from_string(self):  # 3.2.2
     questions = [{
         'type': 'input',
         'name': 'public_key',
         'message': 'Input public_key as Base64:',
     }]
     crypto = CryptoUtility()
     answer = prompt(questions, style=custom_style_fancy)
     if answer['public_key'] != '':
         try:
             crypto.set_public_key(answer['public_key'])
             print(crypto.export_public_key_to_file())
             print('Key successfully stored!\n')
         except Exception as e:
             print(e)
     self.main_menu()
You don't even have to be using a spaCy model (yet) - there are many features like assets and remotes
 that are helpful before your project is in a final state.
 
For more on spaCy projects: https://spacy.io/usage/projects"""

ORDER = """The order of this walkthrough is:

1. Project Information (Title + Description)
2. Add project directories
2. Add project assets/data Location
3. Templates/Placeholders
"""

project_yaml = {}

questionary.print("Welcome!", style="bold")
questionary.print(WELCOME, style="italic")
questionary.print(ORDER)

title = questionary.text("What's the title of the project?").ask()
project_yaml["title"] = title
description = questionary.text(
    "Please provide a short description of the project."
).ask()
project_yaml["description"] = description


project_directory = questionary.path(
    "What's the path to the current project directory?", only_directories=True
).ask()
Esempio n. 26
0
def _integorate_user_venv(config):
    questionary.print("\t" + 100 * "=")
    questionary.print(
        "\t\tRunning jobs can optionally be encapsulated into a virtual environment\n"
    )
    questionary.print(
        "\t\tThis shields the run from changes made to the remainder of the ESM-Tool installation\n"
    )
    questionary.print(
        "\t\tBefore the first run, a local copy will be installed in the experiment tree,"
    )
    questionary.print("\t\tand **this** installation will be used:")
    questionary.print(
        f"\t\t\t {config['general']['experiment_dir']}/.venv_esmtools/lib/python-{sys.version_info.major}.{sys.version_info.minor}/site-packages/esm-tools"
    )
    questionary.print("\t\tinstead of:")
    questionary.print(f"\t\t\t{find_package('esm-tools')}\n")
    questionary.print(
        "\n\t\tIf you choose to use a virtual environment, a folder named `.venv_esmtools`"
    )
    questionary.print(
        "\t\twill be created at the root of your experiment. This contains all the Python"
    )
    questionary.print(
        "\t\tlibraries used by the esm-tools. The first installation induces some overhead (~2-3 minutes)."
    )
    questionary.print(
        "\n\t\tYou may also select to install some packages in 'editable mode', in which case"
    )
    questionary.print(
        "\t\tthey will be installed in a folder `src/esm_tools/<package_name>` in the root of"
    )
    questionary.print(
        "\t\tyour experiment. Any changes made to code in that folder **will** influence how the"
    )
    questionary.print("\t\tesm-tools behave.")
    questionary.print("\n\t\tNote regarding config yamls and namelists")
    questionary.print("\t\t-----------------------------------------")
    questionary.print(
        "\t\tWhen using a virtual environment, config files and namelists will come of the"
    )
    questionary.print(
        "\t\tfolder .venv_esmtools listed above and **not** from your user install directory."
    )
    questionary.print(
        "\t\tYou should make **all** changes to the namelists and config files via your user"
    )
    questionary.print("\t\trunscript. This is recommended in all cases!!!")
    questionary.print(
        "\t\t --> Changing any settings in your user install ($HOME or similar) will therefore not change your run!! <--",
        style="fg:red")
    questionary.print("\n\t\tNotes from the development team:")
    questionary.print("\t\t--------------------------------")
    questionary.print(
        "\n\t\t --> Using an encapsulated environment is recommended for production runs <--\n",
        style="fg:green")
    questionary.print("\t Happy simulating!")
    questionary.print(
        "\t Dirk Barbi, Paul Gierz, Nadine Wieters, Miguel Andrés-Martínez, Deniz Ural, and the rest of the development team."
    )
    questionary.print("\t" + 100 * "=")

    user_confirmed = False
    while not user_confirmed:
        response = questionary.select(
            "What do you want to do?",
            choices=[
                'Run in virtualenv (You may set the flag `--contained-run` during your run call or set `general.use_venv: True`)',
                'Run using default installation (You may set the flag `--open-run` during your run call or set `general.use_venv: False`)',
            ]).ask()  # returns value of selection
        config['general']['use_venv'] = "Run in virtualenv" in response
        user_confirmed = questionary.confirm("Are you sure?").ask()
    if "Run in virtualenv" in response:
        editable_mode_choices = questionary.checkbox(
            "Which of the following packages do you want to install in 'editable mode'? End with <Enter>",
            choices=esm_tools_modules).ask()
        for choice in editable_mode_choices:
            config["general"][f"install_{choice}_editable"] = True
    return config
Esempio n. 27
0
 def _show_public_key(self):
     crypto = CryptoUtility()
     key = crypto.import_public_key_from_file()
     if key:
         print(f'Public Key: {key}\n')
Esempio n. 28
0
 def add_to_clipboard(self, text):
     pyperclip.copy(text)
     questionary.print("Message copied to the clipboard", style=STYLE_TXT)
Esempio n. 29
0
 def print_key(self, key_id):
     key = self.gpg.export_keys(key_id)
     questionary.print(key, style=STYLE_TXT)
     self.add_to_clipboard(key)
Esempio n. 30
0
def ask_questions_gui(browser,browser_version,os_version,os_name,remote_flag,
                      testrail_flag,tesults_flag):
    """This module asks the users questions on what options they wish to run
       the test with and stores their choices"""
    clear()
    while True:
        questionary.print("\nUse up and down arrow keys to switch between options.\
                           \nUse Enter key to select an option",
                           style="bold fg:yellow")
        questionary.print("\nSelected Options",style="bold fg:green")
        questionary.print("**********",style="bold fg:green")
        display_gui_test_options(browser, browser_version, os_version, os_name,
                                 remote_flag, testrail_flag, tesults_flag)
        questionary.print("**********",style="bold fg:green")
        response = get_user_response_gui()
        clear()
        if response == "Browser":
            browser=questionary.select("Select the browser",
                                        choices=conf.browsers).ask()
            browser_version = []
            if remote_flag == "Y":
                questionary.print("Please select the browser version",
                                   style="bold fg:darkred")

        if response == "Browser Version":
            if remote_flag == "Y":
                browser_version = get_browser_version(browser)
            else:
                questionary.print("Browser version can be selected only when running the test remotely.\
                                   \nPlease change the remote flag status inorder to use this option",
                                   style="bold fg:red")

        if response == "Remote flag status":
            remote_flag = get_remote_flag_status()
            if remote_flag == "Y":
                browser = "chrome"
                os_name = "Windows"
                os_version = "10"
                browser_version = "65"
                questionary.print("The default remote test options has been selected",
                                   style="bold fg:green")

        if response == "Os Version":
            os_version = get_os_version(os_name)

        if response == "Os Name":
            if remote_flag == "Y":
                os_name, os_version = get_os_name(remote_flag)
            else:
                questionary.print("OS Name can be selected only when running the test remotely.\
                                  \nPlease change the remote flag status inorder to use this option",
                                   style="bold fg:red")

        if response == "Testrail flag status":
            testrail_flag = get_testrailflag_status()

        if response == "Tesults flag status":
            tesults_flag = get_tesultsflag_status()

        if response == "Set Remote credentials":
            set_remote_credentials()

        if response == "Revert back to default options":
            browser, os_name, os_version,  browser_version, remote_flag, testrail_flag, tesults_flag = gui_default_options()
            questionary.print("Reverted back to the default options",style="bold fg:green")

        if response == "Run":
            if remote_flag == "Y":
                if browser_version == []:
                    questionary.print("Please select the browser version before you run the test",
                                       style="bold fg:darkred")
                elif os_version == []:
                    questionary.print("Please select the OS version before you run the test",
                                       style="bold fg:darkred")
                else:
                    break
            else:
                break

        if response == "Exit":
            sys.exit("Program interrupted by user, Exiting the program....")

    return browser,browser_version,remote_flag,os_name,os_version,testrail_flag,tesults_flag