use of com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig in project jmeter-plugins by undera.
the class FirefoxDriverConfigGuiTest method shouldOverrideUserAgent.
@Test
public void shouldOverrideUserAgent() {
gui.userAgentOverrideCheckbox.setSelected(true);
gui.userAgentOverrideText.setText("some user agent");
final FirefoxDriverConfig testElement = (FirefoxDriverConfig) gui.createTestElement();
assertThat(testElement.getUserAgentOverride(), is("some user agent"));
}
use of com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig in project jmeter-plugins by undera.
the class FirefoxDriverConfigGui method createTestElement.
@Override
public TestElement createTestElement() {
FirefoxDriverConfig element = new FirefoxDriverConfig();
modifyTestElement(element);
return element;
}
use of com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig in project jmeter-plugins by undera.
the class FirefoxDriverConfigGui method configure.
@Override
public void configure(TestElement element) {
super.configure(element);
if (element instanceof FirefoxDriverConfig) {
FirefoxDriverConfig config = (FirefoxDriverConfig) element;
userAgentOverrideCheckbox.setSelected(config.isUserAgentOverridden());
userAgentOverrideText.setText(config.getUserAgentOverride());
userAgentOverrideText.setEnabled(config.isUserAgentOverridden());
JMeterProperty ext = config.getExtensions();
if (!(ext instanceof NullProperty)) {
JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) ext, extensions.getModel());
}
JMeterProperty pref = config.getPreferences();
if (!(ext instanceof NullProperty)) {
JMeterPluginsUtils.collectionPropertyToTableModelRows((CollectionProperty) pref, preferences.getModel());
}
}
}
use of com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig in project jmeter-plugins by undera.
the class FirefoxDriverConfigGui method modifyTestElement.
@Override
public void modifyTestElement(TestElement element) {
super.modifyTestElement(element);
if (element instanceof FirefoxDriverConfig) {
FirefoxDriverConfig config = (FirefoxDriverConfig) element;
config.setUserAgentOverridden(userAgentOverrideCheckbox.isSelected());
config.setNtlmSetting(ntlmOverrideCheckbox.isSelected());
if (userAgentOverrideCheckbox.isSelected()) {
config.setUserAgentOverride(userAgentOverrideText.getText());
}
config.setExtensions(extensions.getModel());
config.setPreferences(preferences.getModel());
}
}
use of com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig in project jmeter-plugins by undera.
the class FirefoxDriverConfigGuiTest method shouldNotOverrideUserAgent.
@Test
public void shouldNotOverrideUserAgent() {
gui.userAgentOverrideCheckbox.setSelected(false);
gui.userAgentOverrideText.setText("some user agent");
final FirefoxDriverConfig testElement = (FirefoxDriverConfig) gui.createTestElement();
assertThat(testElement.getUserAgentOverride(), is(not("some user agent")));
}
Aggregations