All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sdl.selenium.materialui.form.CheckBox Maven / Gradle / Ivy

Go to download

Automated Acceptance Testing. Selenium and Selenium WebDriver test framework for web applications. (optimized for dynamic html, ExtJS, Bootstrap, complex UI, simple web applications/sites)

The newest version!
package com.sdl.selenium.materialui.form;

import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;
import com.sdl.selenium.web.form.Field;
import com.sdl.selenium.web.form.ICheck;
import com.sdl.selenium.web.form.IField;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CheckBox extends Field implements IField, ICheck {

    public CheckBox() {
        setClassName("Checkbox");
        setType("checkbox");
        setTag("input");
        setLabelTag("span");
        setLabelPosition("/preceding-sibling::*//");
    }

    public CheckBox(WebLocator container) {
        this();
        setContainer(container);
    }

    public CheckBox(WebLocator container, String label, SearchType... searchTypes) {
        this(container);
        if (searchTypes.length == 0) {
            searchTypes = new SearchType[]{SearchType.EQUALS};
        }
        setLabel(label, searchTypes);
    }

    @Override
    public boolean isChecked() {
        return ready() && executor.isSelected(this);
    }

    public String getValue() {
        return String.valueOf(isChecked());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy