Best Python code snippet using autotest_python
editor_widgets.py
Source: editor_widgets.py
...681 def set_value(self, value):682 self.set_valid()683 self.inputWidget.set_value(value)684 @gui.decorate_event685 def on_attribute_changed(self, widget, value):686 self.set_valid()...
wiParamsWidget.py
Source: wiParamsWidget.py
...341 self.removeAttribute.style['display'] = 'none'342343 def on_attribute_remove(self, widget):344 self.inputWidget.set_value(self._param._defaultValue)345 self.on_attribute_changed(widget, self._param._defaultValue)346347 def set_value(self, value):348 self.set_valid()349 self.inputWidget.set_value(value)350351 def on_attribute_changed(self, widget, value):352 self.set_valid()353 354 # stupid patch for bool355 attributeType = self._param._type356 if attributeType == bool or attributeType == 'bool':357 if value == 'true':358 value =True359 if value == 'false':360 value =False361 362 return self.eventManager.propagate(self.EVENT_ATTRIB_ONCHANGE, ("", self.attributeName, value))363364 def set_on_attribute_change_listener(self, callback, *userdata):365 self.eventManager.register_listener(
...
param_minmax_setup_window.py
Source: param_minmax_setup_window.py
...142 index = item.data(QtCore.Qt.UserRole)143 resulting_indices.append(index)144 return resulting_indices145 def on_add_button_pressed(self):146 self.on_attribute_changed()147 new_object = AttributeMinMax()148 new_object.name = '<unnamed attribute>'149 self.event_handler.attribute_min_max_values.append(new_object)150 self.init_table()151 self.table.selectRow(len(self.event_handler.attribute_min_max_values) - 1)152 self.attribute_name_line_edit.setFocus()153 self.attribute_name_line_edit.selectAll()154 def on_table_selection_changed(self):155 # Block signals, so we don't trigger OnAttributeChanged caused by the setValue calls on the widgets.156 self.attribute_name_line_edit.blockSignals(True)157 self.min_value_widget.blockSignals(True)158 self.max_value_widget.blockSignals(True)159 # Update widget values.160 selected_items = self.table.selectedItems()161 if len(selected_items) == 0:162 self.attribute_name_line_edit.setText('')163 self.min_value_widget.setValue(0.0)164 self.max_value_widget.setValue(1.0)165 self.attribute_name_line_edit.setEnabled(False)166 self.min_value_widget.setEnabled(False)167 self.max_value_widget.setEnabled(False)168 else:169 selected_attributes = self.get_selected_attribute_indices()170 attribute = self.event_handler.attribute_min_max_values[selected_attributes[-1]]171 self.attribute_name_line_edit.setText(attribute.name)172 self.min_value_widget.setValue(attribute.min_value)173 self.max_value_widget.setValue(attribute.max_value)174 self.attribute_name_line_edit.setEnabled(True)175 self.min_value_widget.setEnabled(True)176 self.max_value_widget.setEnabled(True)177 # Unblock signals.178 self.attribute_name_line_edit.blockSignals(False)179 self.min_value_widget.blockSignals(False)180 self.max_value_widget.blockSignals(False)181 def on_attribute_changed(self):182 selected_items = self.table.selectedItems()183 if len(selected_items) == 0:184 return185 attribute_indices = self.get_selected_attribute_indices()186 if len(attribute_indices) == 1:187 attribute = self.event_handler.attribute_min_max_values[attribute_indices[0]]188 attribute.name = self.attribute_name_line_edit.text()189 for index in attribute_indices:190 attribute = self.event_handler.attribute_min_max_values[index]191 attribute.min_value = self.min_value_widget.value()192 attribute.max_value = self.max_value_widget.value()193 self.event_handler.save_attribute_min_max_setup_to_file(self.event_handler.min_max_settings_file)194 self.init_table()195 # Remove a given list of attributes, where the remove list is a list of indices....
Check out the latest blogs from LambdaTest on this topic:
Before we discuss Scala testing, let us understand the fundamentals of Scala and how this programming language is a preferred choice for your development requirements.The popularity and usage of Scala are rapidly rising, evident by the ever-increasing open positions for Scala developers.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
The count of mobile users is on a steep rise. According to the research, by 2025, it is expected to reach 7.49 billion users worldwide. 70% of all US digital media time comes from mobile apps, and to your surprise, the average smartphone owner uses ten apps per day and 30 apps each month.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!