def update_cc_field_panel()

in modules/page_object_prefs.py [0:0]


    def update_cc_field_panel(self, field_name: str, value: str | int) -> BasePage:
        """
        Updates a field in the credit card popup panel in about:prefs
        Change value of the field_name given
        """

        fields = {
            "card_number": "cc-number",
            "expiration_month": "cc-exp-month",
            "expiration_year": "cc-exp-year",
            "name": "cc-name",
        }
        if field_name not in fields.keys():
            raise ValueError(
                f"{field_name} is not a valid field name for the cc dialog form."
            )
        self.switch_to_edit_saved_payments_popup_iframe()
        value_field = self.find_element(By.ID, fields[field_name])
        if value_field.tag_name != "select":
            value_field.clear()
        value_field.send_keys(value)
        self.get_element("save-button").click()
        return self