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)

There is a newer version: 20.08.432.0_b2d2a09
Show newest version
package com.sdl.selenium.extjs6.form;

import com.sdl.selenium.web.WebLocator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FieldSet extends WebLocator {
    private static final Logger LOGGER = LoggerFactory.getLogger(FieldSet.class);

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

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

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

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

    public boolean expand() {
        WebLocator legendElement = new WebLocator(this).setText(getPathBuilder().getText());
        return !isCollapsed() || legendElement.click();
    }

    public boolean collapse() {
        WebLocator legendElement = new WebLocator(this).setText(getPathBuilder().getText());
        return isCollapsed() || legendElement.click();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy