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

leeonky / test-charm-java / 227

21 Apr 2025 03:32PM UTC coverage: 71.06% (-3.0%) from 74.052%
227

push

circleci

leeonky
Refactor UI test

6 of 15 new or added lines in 5 files covered. (40.0%)

42 existing lines in 11 files now uncovered.

6858 of 9651 relevant lines covered (71.06%)

0.71 hits per line

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

72.22
/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(String value) {
UNCOV
44
        return clear().typeIn(value);
×
45
    }
46

47
    default boolean isInput() {
UNCOV
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() {
UNCOV
60
        throw new IllegalStateException("Not support operation");
×
61
    }
62

63
    @Deprecated
64
    default List<T> findAllBy(By locator) {
UNCOV
65
        return find(locator).list().collect();
×
66
    }
67

68
    @Deprecated
69
    default T single(By locator) {
NEW
70
        return find(locator).single();
×
71
    }
72

73
    @SuppressWarnings("unchecked")
74
    default Elements<T> find(By locator) {
75
        return new Elements<>(locator, (T) this);
1✔
76
    }
77

78
    default Elements<T> css(String css) {
79
        return find(By.css(css));
1✔
80
    }
81

82
    default Elements<T> caption(String text) {
83
        return find(By.caption(text));
1✔
84
    }
85

86
    default Elements<T> xpath(String xpath) {
87
        return find(By.xpath(xpath));
1✔
88
    }
89

90
    default Elements<T> placeholder(String placeholder) {
91
        return find(By.placeholder(placeholder));
1✔
92
    }
93
}
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