Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 82aa6dd

Browse files
slu-itAxel Schüssler
authored andcommitted
Formatted code and JavaDoc
1 parent bfe83ce commit 82aa6dd

File tree

13 files changed

+364
-121
lines changed

13 files changed

+364
-121
lines changed

webtester-core/src/main/java/info/novatec/testit/webtester/conditions/Conditions.java

Lines changed: 184 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import info.novatec.testit.webtester.conditions.pagefragments.Visible;
2525
import info.novatec.testit.webtester.conditions.pagefragments.VisibleTextContains;
2626
import info.novatec.testit.webtester.conditions.pagefragments.VisibleTextEquals;
27+
import info.novatec.testit.webtester.conditions.syntax.Either;
2728
import info.novatec.testit.webtester.conditions.syntax.Has;
2829
import info.novatec.testit.webtester.conditions.syntax.Is;
2930
import info.novatec.testit.webtester.conditions.syntax.Not;
@@ -39,108 +40,290 @@
3940
@UtilityClass
4041
public class Conditions {
4142

43+
/**
44+
* Creates a new {@link Is} condition.
45+
*
46+
* @param condition the nested condition
47+
* @see Is
48+
* @since 2.0
49+
*/
4250
public static <T> Is<T> is(Condition<T> condition) {
4351
return new Is<>(condition);
4452
}
4553

54+
/**
55+
* Creates a new {@link Has} condition.
56+
*
57+
* @param condition the nested condition
58+
* @see Has
59+
* @since 2.0
60+
*/
4661
public static <T> Has<T> has(Condition<T> condition) {
4762
return new Has<>(condition);
4863
}
4964

65+
/**
66+
* Creates a new {@link Not} condition.
67+
*
68+
* @param condition the nested condition
69+
* @see Not
70+
* @since 2.0
71+
*/
5072
public static <T> Not<T> not(Condition<T> condition) {
5173
return new Not<>(condition);
5274
}
5375

54-
/* other */
76+
/**
77+
* Creates a new {@link Either} condition.
78+
*
79+
* @param conditions the nested conditions
80+
* @see Either
81+
* @since 2.1
82+
*/
83+
public static <T> Either<T> either(Condition<T>... conditions) {
84+
return new Either<>(conditions);
85+
}
5586

87+
/**
88+
* Creates a new {@link Attribute} condition.
89+
*
90+
* @param attributeName the name of the attribute to check
91+
* @see Attribute
92+
* @since 2.0
93+
*/
5694
public static Attribute attribute(String attributeName) {
5795
return new Attribute(attributeName);
5896
}
5997

98+
/**
99+
* Creates a new {@link AttributeWithValue} condition.
100+
*
101+
* @param attributeName the name of the attribute to check
102+
* @param value the value to check
103+
* @see AttributeWithValue
104+
* @since 2.0
105+
*/
60106
public static AttributeWithValue attributeWithValue(String attributeName, Object value) {
61107
return new AttributeWithValue(attributeName, value);
62108
}
63109

110+
/**
111+
* Creates a new {@link Disabled} condition.
112+
*
113+
* @see Disabled
114+
* @since 2.0
115+
*/
64116
public static Disabled disabled() {
65117
return new Disabled();
66118
}
67119

120+
/**
121+
* Creates a new {@link Editable} condition.
122+
*
123+
* @see Editable
124+
* @since 2.0
125+
*/
68126
public static Editable editable() {
69127
return new Editable();
70128
}
71129

130+
/**
131+
* Creates a new {@link Enabled} condition.
132+
*
133+
* @see Enabled
134+
* @since 2.0
135+
*/
72136
public static Enabled enabled() {
73137
return new Enabled();
74138
}
75139

140+
/**
141+
* Creates a new {@link Interactable} condition.
142+
*
143+
* @see Interactable
144+
* @since 2.0
145+
*/
76146
public static Interactable interactable() {
77147
return new Interactable();
78148
}
79149

150+
/**
151+
* Creates a new {@link Invisible} condition.
152+
*
153+
* @see Invisible
154+
* @since 2.0
155+
*/
80156
public static Invisible invisible() {
81157
return new Invisible();
82158
}
83159

160+
/**
161+
* Creates a new {@link Present} condition.
162+
*
163+
* @see Present
164+
* @since 2.0
165+
*/
84166
public static Present present() {
85167
return new Present();
86168
}
87169

170+
/**
171+
* Creates a new {@link PresentAndVisible} condition.
172+
*
173+
* @see PresentAndVisible
174+
* @since 2.0
175+
*/
88176
public static PresentAndVisible presentAndVisible() {
89177
return new PresentAndVisible();
90178
}
91179

180+
/**
181+
* Creates a new {@link ReadOnly} condition.
182+
*
183+
* @see ReadOnly
184+
* @since 2.0
185+
*/
92186
public static ReadOnly readOnly() {
93187
return new ReadOnly();
94188
}
95189

190+
/**
191+
* Creates a new {@link Selected} condition.
192+
*
193+
* @see Selected
194+
* @since 2.0
195+
*/
96196
public static Selected selected() {
97197
return new Selected();
98198
}
99199

200+
/**
201+
* Creates a new {@link SelectedIndex} condition.
202+
*
203+
* @param index the expected selected index
204+
* @see SelectedIndex
205+
* @since 2.0
206+
*/
100207
public static SelectedIndex selectionWithIndex(Integer index) {
101208
return new SelectedIndex(index);
102209
}
103210

211+
/**
212+
* Creates a new {@link SelectedIndices} condition.
213+
*
214+
* @param indices the expected selected indices
215+
* @see SelectedIndices
216+
* @since 2.0
217+
*/
104218
public static SelectedIndices selectionWithIndices(Integer... indices) {
105219
return new SelectedIndices(indices);
106220
}
107221

222+
/**
223+
* Creates a new {@link SelectedIndices} condition.
224+
*
225+
* @param indices the expected selected indices
226+
* @see SelectedIndices
227+
* @since 2.0
228+
*/
108229
public static SelectedIndices selectionWithIndices(Collection<Integer> indices) {
109230
return new SelectedIndices(indices);
110231
}
111232

233+
/**
234+
* Creates a new {@link SelectedText} condition.
235+
*
236+
* @param text the expected selected text
237+
* @see SelectedText
238+
* @since 2.0
239+
*/
112240
public static SelectedText selectionWithText(String text) {
113241
return new SelectedText(text);
114242
}
115243

244+
/**
245+
* Creates a new {@link SelectedTexts} condition.
246+
*
247+
* @param texts the expected selected texts
248+
* @see SelectedTexts
249+
* @since 2.0
250+
*/
116251
public static SelectedTexts selectionWithTexts(String... texts) {
117252
return new SelectedTexts(texts);
118253
}
119254

255+
/**
256+
* Creates a new {@link SelectedTexts} condition.
257+
*
258+
* @param texts the expected selected texts
259+
* @see SelectedTexts
260+
* @since 2.0
261+
*/
120262
public static SelectedTexts selectionWithTexts(Collection<String> texts) {
121263
return new SelectedTexts(texts);
122264
}
123265

266+
/**
267+
* Creates a new {@link SelectedValue} condition.
268+
*
269+
* @param value the expected selected value
270+
* @see SelectedValue
271+
* @since 2.0
272+
*/
124273
public static SelectedValue selectionWithValue(String value) {
125274
return new SelectedValue(value);
126275
}
127276

277+
/**
278+
* Creates a new {@link SelectedValues} condition.
279+
*
280+
* @param values the expected selected values
281+
* @see SelectedValues
282+
* @since 2.0
283+
*/
128284
public static SelectedValues selectionWithValues(String... values) {
129285
return new SelectedValues(values);
130286
}
131287

288+
/**
289+
* Creates a new {@link SelectedValues} condition.
290+
*
291+
* @param values the expected selected values
292+
* @see SelectedValues
293+
* @since 2.0
294+
*/
132295
public static SelectedValues selectionWithValues(Collection<String> values) {
133296
return new SelectedValues(values);
134297
}
135298

299+
/**
300+
* Creates a new {@link Visible} condition.
301+
*
302+
* @see Visible
303+
* @since 2.0
304+
*/
136305
public static Visible visible() {
137306
return new Visible();
138307
}
139308

309+
/**
310+
* Creates a new {@link VisibleTextEquals} condition.
311+
*
312+
* @param text the expected visible text
313+
* @see VisibleTextEquals
314+
* @since 2.0
315+
*/
140316
public static VisibleTextEquals visibleText(String text) {
141317
return new VisibleTextEquals(text);
142318
}
143319

320+
/**
321+
* Creates a new {@link VisibleTextContains} condition.
322+
*
323+
* @param partialText the expected visible partial text
324+
* @see VisibleTextContains
325+
* @since 2.0
326+
*/
144327
public static VisibleTextContains visibleTextContaining(String partialText) {
145328
return new VisibleTextContains(partialText);
146329
}

0 commit comments

Comments
 (0)