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

com.epam.jdi.light.elements.complex.JList Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
package com.epam.jdi.light.elements.complex;

import com.epam.jdi.light.asserts.generic.UISelectAssert;
import com.epam.jdi.light.common.JDIAction;
import com.epam.jdi.light.elements.interfaces.base.IListBase;
import com.epam.jdi.tools.func.JFunc1;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import java.util.List;

/**
 * Created by Roman Iovlev on 26.09.2019
 * Email: [email protected]; Skype: roman.iovlev
 */
public class JList extends ListBase>> {
    public JList() {}
    public JList(By locator) { super(locator); }
    public JList(List elements) {
        super(elements);
    }

    @Override
    public UISelectAssert> is() {
        refresh();
        return new UISelectAssert<>().set(this);
    }
    @JDIAction("Assert that {name} list meet condition")
    public UISelectAssert> is(Matcher> condition) {
        MatcherAssert.assertThat(this, condition);
        return is();
    }
    public UISelectAssert> assertThat(Matcher> condition) {
        return is(condition);
    }

    public boolean wait(JFunc1, Boolean> condition) {
        return base().timer().wait(() -> condition.execute(this));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy