fixed test attributes and typos

This commit is contained in:
anhefti 2022-02-01 15:42:22 +01:00
parent 401419fb0e
commit fe2d89ca49
4 changed files with 23 additions and 38 deletions

View file

@ -91,7 +91,7 @@ public class LoginPage implements TemplateComposer {
gridData.verticalIndent = 10;
final Label pwd = this.widgetFactory.labelLocalized(loginGroup, TEXT_PWD);
pwd.setLayoutData(gridData);
final Text loginPassword = this.widgetFactory.passwordInput(loginGroup, TEXT_PWD);
final Text loginPassword = this.widgetFactory.passwordInput(loginGroup, TEXT_PWD.name, TEXT_PWD);
loginPassword.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
final Composite buttons = new Composite(loginGroup, SWT.NONE);

View file

@ -118,12 +118,13 @@ public final class TextFieldBuilder extends FieldBuilder<String> {
return;
}
final String testKey = (this.label != null) ? this.label.name : this.name;
final LocTextKey label = getARIALabel(builder);
final Text textInput = (this.isNumber)
? builder.widgetFactory.numberInput(fieldGrid, this.numberCheck, readonly, label)
: (this.isArea)
? builder.widgetFactory.textAreaInput(fieldGrid, readonly, label)
: builder.widgetFactory.textInput(fieldGrid, this.isPassword, readonly, label);
: builder.widgetFactory.textInput(fieldGrid, this.isPassword, readonly, testKey, label);
if (builder.pageService.getFormTooltipMode() == PageService.FormTooltipMode.INPUT) {
builder.pageService.getPolyglotPageService().injectI18nTooltip(

View file

@ -502,63 +502,47 @@ public class WidgetFactory {
return labelLocalized;
}
public Text textInput(final Composite content, final LocTextKey label) {
return textInput(content, false, false, label.name, this.i18nSupport.getText(label));
public Text textInput(final Composite content, final LocTextKey ariaLabel) {
return textInput(content, false, false, ariaLabel.name, ariaLabel);
}
public Text textInput(final Composite content, final String testKey, final LocTextKey label) {
return textInput(content, false, false, testKey, this.i18nSupport.getText(label));
public Text textInput(final Composite content, final String testKey, final LocTextKey ariaLabel) {
return textInput(content, false, false, testKey, ariaLabel);
}
public Text textInput(final Composite content, final String testKey, final String label) {
return textInput(content, false, false, testKey, label);
public Text textInput(final Composite content, final String testKey, final String ariaLabel) {
final Text textInput = textInput(content, false, false, testKey, null);
if (ariaLabel != null) {
WidgetFactory.setARIALabel(textInput, this.i18nSupport.getText(ariaLabel));
}
return textInput;
}
public Text passwordInput(final Composite content, final LocTextKey label) {
return textInput(content, true, false, label.name, this.i18nSupport.getText(label));
}
public Text passwordInput(final Composite content, final String testKey, final String label) {
return textInput(content, true, false, testKey, label);
//
public Text passwordInput(final Composite content, final String testKey, final LocTextKey ariaLabel) {
return textInput(content, true, false, testKey, ariaLabel);
}
public Text textAreaInput(
final Composite content,
final boolean readonly,
final LocTextKey label) {
return textAreaInput(content, readonly, this.i18nSupport.getText(label));
}
public Text textAreaInput(
final Composite content,
final boolean readonly,
final String label) {
final LocTextKey ariaLabel) {
final Text input = readonly
? new Text(content, SWT.LEFT | SWT.MULTI)
: new Text(content, SWT.LEFT | SWT.BORDER | SWT.MULTI);
if (label != null) {
WidgetFactory.setARIALabel(input, label);
if (ariaLabel != null) {
WidgetFactory.setARIALabel(input, this.i18nSupport.getText(ariaLabel));
}
return input;
}
public Text textInput(
final Composite content,
final boolean password,
final boolean readonly,
final LocTextKey label) {
return textInput(content, password, readonly, label.name, this.i18nSupport.getText(label));
}
public Text textInput(
final Composite content,
final boolean password,
final boolean readonly,
final String testKey,
final String label) {
final LocTextKey ariaLabel) {
final Text input = readonly
? new Text(content, SWT.LEFT)
@ -566,8 +550,8 @@ public class WidgetFactory {
? SWT.LEFT | SWT.BORDER | SWT.PASSWORD
: SWT.LEFT | SWT.BORDER);
if (label != null) {
WidgetFactory.setARIALabel(input, label);
if (ariaLabel != null) {
WidgetFactory.setARIALabel(input, this.i18nSupport.getText(ariaLabel));
}
if (testKey != null) {
setTestId(input, testKey);

View file

@ -1371,7 +1371,7 @@ sebserver.examconfig.props.label.enablePrintScreen=Allow screen capture
sebserver.examconfig.props.label.enablePrintScreen.tooltip=Controls Print Screen and OS X screen capture, corresponds with Enable screen capture in Security settings
sebserver.examconfig.props.label.enableCtrlEsc=Enable Ctrl-Esc
sebserver.examconfig.props.label.enableAltEsc=Enable Alt-Esc
sebserver.examconfig.props.label.enableAltTab=Enable Alt-Tap
sebserver.examconfig.props.label.enableAltTab=Enable Alt-Tab
sebserver.examconfig.props.label.enableAltF4=Enable Alt-F4
sebserver.examconfig.props.label.enableStartMenu=Enable Start Menu
sebserver.examconfig.props.label.enableRightMouse=Enable Right Mouse