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

com.sdl.selenium.extjs6.form.FieldSet 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.extjs6.form;

import com.sdl.selenium.web.SearchType;
import com.sdl.selenium.web.WebLocator;

public class FieldSet extends WebLocator {

    public FieldSet() {
        setClassName("FieldSet");
        setBaseCls("x-fieldset");
        setTag("fieldset");
        setExcludeClasses("x-hide-display", "x-masked");
        setTemplate("text", "count(.//*[normalize-space(.)=%s]) > 0");
    }

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

    public FieldSet(WebLocator container, String text, SearchType... searchTypes) {
        this(container);
        setText(text, searchTypes);
    }

    public boolean isCollapsed() {
        String cls = getAttributeClass();
        return cls != null && cls.contains("x-fieldset-collapsed");
    }

    public boolean expand() {
        return !isCollapsed() || getExpandEl().click();
    }

    public boolean collapse() {
        return isCollapsed() || getExpandEl().click();
    }

    private WebLocator getExpandEl() {
        return new WebLocator(this).setClasses("x-fieldset-header-text").setText(getPathBuilder().getText());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy