• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leeonky / test-charm-java / 242

01 May 2025 09:52AM UTC coverage: 74.278% (+0.05%) from 74.224%
242

push

circleci

leeonky
Update version

8077 of 10874 relevant lines covered (74.28%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.35
/page-flow/src/main/java/com/github/leeonky/pf/Element.java
1
package com.github.leeonky.pf;
2

3
import com.github.leeonky.util.BeanClass;
4
import org.slf4j.Logger;
5
import org.slf4j.LoggerFactory;
6

7
import java.util.ArrayList;
8
import java.util.List;
9

10
public interface Element<T extends Element<T, E>, E> {
11
    Logger logger = LoggerFactory.getLogger(Element.class);
1✔
12

13
    @SuppressWarnings("unchecked")
14
    default T newChildren(E element) {
15
        return (T) BeanClass.create(getClass()).newInstance(element);
1✔
16
    }
17

18
    List<E> findElements(By by);
19

20
    default int defaultTimeout() {
21
        return 2000;
1✔
22
    }
23

24
    @SuppressWarnings("unchecked")
25
    default List<By> locators() {
26
        return new ArrayList<By>() {{
1✔
27
            for (T p = (T) Element.this; p != null; p = p.parent())
1✔
28
                if (p.getLocator() != null)
1✔
29
                    add(0, p.getLocator());
1✔
30
        }};
1✔
31
    }
32

33
    String getTag();
34

35
    String text();
36

37
    T click();
38

39
    T typeIn(String value);
40

41
    T clear();
42

43
    default T fillIn(Object value) {
44
        return clear().typeIn(String.valueOf(value));
1✔
45
    }
46

47
    default boolean isInput() {
48
        return false;
×
49
    }
50

51
    By getLocator();
52

53
    void setLocator(By locator);
54

55
    T parent();
56

57
    void parent(T parent);
58

59
    default Object value() {
60
        throw new IllegalStateException("Not support operation");
×
61
    }
62

63
    default String getLocation() {
64
        return null;
×
65
    }
66

67
    @SuppressWarnings("unchecked")
68
    default Elements<T> find(By locator) {
69
        return new Elements<>(locator, (T) this);
1✔
70
    }
71

72
    default Elements<T> css(String css) {
73
        return find(By.css(css));
1✔
74
    }
75

76
    default Elements<T> caption(String text) {
77
        return find(By.caption(text));
1✔
78
    }
79

80
    default Elements<T> xpath(String xpath) {
81
        return find(By.xpath(xpath));
1✔
82
    }
83

84
    default Elements<T> placeholder(String placeholder) {
85
        return find(By.placeholder(placeholder));
1✔
86
    }
87
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc