Skip to content

Commit 354b505

Browse files
committed
Fix assert Tabs and Windows
1 parent 348df83 commit 354b505

File tree

3 files changed

+47
-62
lines changed

3 files changed

+47
-62
lines changed

jdi-light-vuetify-tests/src/test/java/io/github/epam/vuetify/tests/complex/TabsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public static void verticalTabsTest() {
135135
waitCondition(() -> verticalTabs.icons().get(finalOpt).isVisible());
136136
verticalTabs.icons().get(finalOpt).is().visible();
137137
waitCondition(() -> verticalTabs.getTabTextContent().contains(USER_PROFILE_TEXT[finalOpt]));
138-
verticalTabs.has().tabTextContentContaining(USER_PROFILE_TEXT[finalOpt]);
138+
verticalTabs.has().tabTextContentContains(USER_PROFILE_TEXT[finalOpt]);
139139
verticalTabs.get(opt + 1).has().text(OPTIONS[finalOpt]);
140140
}
141141
contentTabs.is().notVertical();
@@ -145,7 +145,7 @@ public static void verticalTabsTest() {
145145
public static void contentTabsTest() {
146146
contentTabs.show();
147147
contentTabs.has().values(equalTo(asList("ITEM 1", "ITEM 2", "ITEM 3")));
148-
contentTabs.has().tabTextContentContaining("Lorem ipsum dolor sit amet");
148+
contentTabs.has().tabTextContentContains("Lorem ipsum dolor sit amet");
149149
}
150150

151151
@Test(description = "Test checks tab addition and removal for dynamic tabs")

jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/VuetifyTabsAssert.java

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,84 +16,80 @@ public class VuetifyTabsAssert extends UISelectAssert<VuetifyTabsAssert, Vuetify
1616
@Override
1717
@JDIAction(value = "Assert that '{name}' tab '{0}' is selected", isAssert = true)
1818
public VuetifyTabsAssert selected(int index) {
19-
jdiAssert(element().isSelected(index), Matchers.is(true), "Element is not selected");
19+
jdiAssert(element().isSelected(index), Matchers.is(true), "Tab is not selected");
2020
return this;
2121
}
2222

2323
@JDIAction(value = "Assert that '{name}' tab '{0}' is not selected", isAssert = true)
2424
public VuetifyTabsAssert notSelected(int index) {
25-
jdiAssert(element().isSelected(index), Matchers.is(false), "Element is selected");
25+
jdiAssert(element().isSelected(index), Matchers.is(false), "Tab is selected");
2626
return this;
2727
}
2828

2929
@JDIAction(value = "Assert that '{name}' has size '{0}'", isAssert = true)
3030
public VuetifyTabsAssert size(int size) {
31-
int actualSize = element().size();
32-
jdiAssert(actualSize, Matchers.is(size), String.format("Element's actual size '%s' is not equal to expected " +
33-
"'%s'", actualSize, size));
31+
jdiAssert(element().size(), Matchers.is(size));
3432
return this;
3533
}
3634
@JDIAction(value = "Assert that '{name}' is fixed", isAssert = true)
3735
public VuetifyTabsAssert fixed() {
38-
jdiAssert(element().isFixed(), Matchers.is(true), "Element is not fixed");
36+
jdiAssert(element().isFixed(), Matchers.is(true), "Tab is not fixed");
3937
return this;
4038
}
4139

4240
@JDIAction(value = "Assert that '{name}' is grow", isAssert = true)
4341
public VuetifyTabsAssert grow() {
44-
jdiAssert(element().isGrow(), Matchers.is(true), "Element is not grow");
42+
jdiAssert(element().isGrow(), Matchers.is(true), "Tab is not grow");
4543
return this;
4644
}
4745

4846
@JDIAction(value = "Assert that '{name}' is not grow", isAssert = true)
4947
public VuetifyTabsAssert notGrow() {
50-
jdiAssert(element().isGrow(), Matchers.is(false), "Element is grow");
48+
jdiAssert(element().isGrow(), Matchers.is(false), "Tab is grow");
5149
return this;
5250
}
5351

5452
@JDIAction(value = "Assert that '{name}' is right", isAssert = true)
5553
public VuetifyTabsAssert right() {
56-
jdiAssert(element().isRight(), Matchers.is(true), "Element is not right");
54+
jdiAssert(element().isRight(), Matchers.is(true), "Tab is not right");
5755
return this;
5856
}
5957

6058
@JDIAction(value = "Assert that '{name}' is not right", isAssert = true)
6159
public VuetifyTabsAssert notRight() {
62-
jdiAssert(element().isRight(), Matchers.is(false), "Element is right");
60+
jdiAssert(element().isRight(), Matchers.is(false), "Tab is right");
6361
return this;
6462
}
6563

6664
@JDIAction(value = "Assert that '{name}' is vertical", isAssert = true)
6765
public VuetifyTabsAssert vertical() {
68-
jdiAssert(element().isVertical(), Matchers.is(true), "Element is not vertical");
66+
jdiAssert(element().isVertical(), Matchers.is(true), "Tab is not vertical");
6967
return this;
7068
}
7169

7270
@JDIAction(value = "Assert that '{name}' is not vertical", isAssert = true)
7371
public VuetifyTabsAssert notVertical() {
74-
jdiAssert(element().isVertical(), Matchers.is(false), "Element is vertical");
72+
jdiAssert(element().isVertical(), Matchers.is(false), "Tab is vertical");
7573
return this;
7674
}
7775

7876
@JDIAction(value = "Assert that '{name}' tab with index '{0}' exists", isAssert = true)
7977
public VuetifyTabsAssert tabExist(int index) {
80-
jdiAssert(element().get(index).isExist(), Matchers.is(true), String.format("Tab with index '%s' doesn't " +
81-
"exist", index));
78+
jdiAssert(element().get(index).isExist(), Matchers.is(true),
79+
String.format("Tab with index '%d' doesn't exist", index));
8280
return this;
8381
}
8482

8583
@JDIAction(value = "Assert that '{name}' tab with index '{0}' doesn't exist", isAssert = true)
8684
public VuetifyTabsAssert tabNotExist(int index) {
87-
jdiAssert(element().get(index).isNotExist(), Matchers.is(true), String.format("Tab with index '%s' " +
88-
"doesn't exist", index));
85+
jdiAssert(element().get(index).isNotExist(), Matchers.is(true),
86+
String.format("Tab with index '%d' doesn't exist", index));
8987
return this;
9088
}
9189

92-
@JDIAction(value = "Assert that '{name}' tab text content is '{0}'", isAssert = true)
90+
@JDIAction(value = "Assert that '{name}' tab text content matched condition", isAssert = true)
9391
public VuetifyTabsAssert tabTextContent(Matcher<String> condition) {
94-
String actualTabTextContent = element().getTabTextContent();
95-
jdiAssert(actualTabTextContent, condition, String.format("Element's actual tab text content '%s' is not " +
96-
"equal to expected '%s'", actualTabTextContent, condition));
92+
jdiAssert(element().getTabTextContent(), condition);
9793
return this;
9894
}
9995

@@ -104,84 +100,80 @@ public VuetifyTabsAssert tabTextContent(String text) {
104100
}
105101

106102
@JDIAction(value = "Assert that '{name}' tab text content contains '{0}'", isAssert = true)
107-
public VuetifyTabsAssert tabTextContentContaining(String text) {
103+
public VuetifyTabsAssert tabTextContentContains(String text) {
108104
tabTextContent(Matchers.containsString(text));
109105
return this;
110106
}
111107

108+
// TODO Check this function
112109
@JDIAction(value = "Assert that '{name}' is align with title", isAssert = true)
113110
public VuetifyTabsAssert alignWithTitle() {
114-
jdiAssert(element().isAlignWithTitle(), Matchers.is(true), "Element is not align with title");
111+
jdiAssert(element().isAlignWithTitle(), Matchers.is(true), "Tab is not align with title");
115112
return this;
116113
}
117114

118115
@JDIAction(value = "Assert that '{name}' is not align with title", isAssert = true)
119116
public VuetifyTabsAssert notAlignWithTitle() {
120-
jdiAssert(element().isAlignWithTitle(), Matchers.is(false), "Element is align with title");
117+
jdiAssert(element().isAlignWithTitle(), Matchers.is(false), "Tab is align with title");
121118
return this;
122119
}
123120

124121
@JDIAction(value = "Assert that '{name}' has tab slider size '{0}'", isAssert = true)
125122
public VuetifyTabsAssert tabSliderSizePx(int n) {
126-
int actualTabSliderSize = element().tabsSliderSize();
127-
jdiAssert(actualTabSliderSize, Matchers.equalTo(n), String.format("Element's actual tab slider size '%s' is " +
128-
"not equal to expected '%s'", actualTabSliderSize, n));
123+
jdiAssert(element().tabsSliderSize(), Matchers.equalTo(n));
129124
return this;
130125
}
131126

132127
@JDIAction(value = "Assert that '{name}' has tab slider color '{0}'", isAssert = true)
133128
public VuetifyTabsAssert tabSliderColor(String color) {
134-
String actualTabSliderColor = element().tabsSliderColor();
135-
jdiAssert(actualTabSliderColor, Matchers.equalTo(color), String.format("Element's actual tab slider color " +
136-
"'%s' is not equal to expected '%s'", actualTabSliderColor, color));
129+
jdiAssert(element().tabsSliderColor(), Matchers.equalTo(color));
137130
return this;
138131
}
139132

140133
@JDIAction(value = "Assert that '{name}' tab '{0}' is disabled", isAssert = true)
141134
public VuetifyTabsAssert tabDisabled(int index) {
142-
jdiAssert(element().isTabDisabled(index), Matchers.is(true), String.format("Element's tab '%s' is enabled",
143-
index));
135+
jdiAssert(element().isTabDisabled(index), Matchers.is(true),
136+
String.format("Tab's tab with index '%d' is enabled", index));
144137
return this;
145138
}
146139

147140
@JDIAction(value = "Assert that '{name}' tab '{0}' is enabled", isAssert = true)
148141
public VuetifyTabsAssert tabEnabled(int index) {
149-
jdiAssert(element().isTabDisabled(index), Matchers.is(false), String.format("Element's tab '%s' is " +
150-
"disabled", index));
142+
jdiAssert(element().isTabDisabled(index), Matchers.is(false),
143+
String.format("Tab's tab with index '%d' is disabled", index));
151144
return this;
152145
}
153146

154147
@JDIAction(value = "Assert that '{name}' tab '{0}' has href", isAssert = true)
155148
public VuetifyTabsAssert tabHref(int index) {
156-
jdiAssert(element().tabHasHref(index), Matchers.is(true), String.format("Element's tab '%s' has no href",
157-
index));
149+
jdiAssert(element().tabHasHref(index), Matchers.is(true),
150+
String.format("Tab's tab with index '%d' has no href", index));
158151
return this;
159152
}
160153

161154
@JDIAction(value = "Assert that '{name}' tab '{0}' has no href", isAssert = true)
162155
public VuetifyTabsAssert noTabHref(int index) {
163-
jdiAssert(element().tabHasHref(index), Matchers.is(false), String.format("Element's tab '%s' has href",
164-
index));
156+
jdiAssert(element().tabHasHref(index), Matchers.is(false),
157+
String.format("Tab's tab with index '%d' has href", index));
165158
return this;
166159
}
167160

168-
@JDIAction(value = "Assert that '{name}' has tab slider color '{0}'", isAssert = true)
161+
@JDIAction(value = "Assert that '{name}' has tab {0} has href '{1}'", isAssert = true)
169162
public VuetifyTabsAssert tabHref(int index, String href) {
170-
String actualTabHref = element().getTabHref(index);
171-
jdiAssert(actualTabHref, Matchers.equalTo(href), String.format("Element's actual tab '%s' href '%s' is not " +
172-
"equal to expected '%s'", index, actualTabHref, href));
163+
jdiAssert(element().getTabHref(index), Matchers.equalTo(href));
173164
return this;
174165
}
175166

176167
@JDIAction(value = "Assert that '{name}' shows arrows", isAssert = true)
177168
public VuetifyTabsAssert showArrows() {
178-
jdiAssert(element().showsArrows(), Matchers.is(true), "Element's tab '%s' has no href");
169+
jdiAssert(element().showsArrows(), Matchers.is(true),
170+
"Tabs doesn't show arrows");
179171
return this;
180172
}
181173

182174
@JDIAction(value = "Assert that '{name}' doesn't show arrows", isAssert = true)
183175
public VuetifyTabsAssert notShowArrows() {
184-
jdiAssert(element().showsArrows(), Matchers.is(false), "Element shows arrows");
176+
jdiAssert(element().showsArrows(), Matchers.is(false), "Tab shows arrows");
185177
return this;
186178
}
187179
}

jdi-light-vuetify/src/main/java/com/epam/jdi/light/vuetify/asserts/WindowsAssert.java

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,41 @@
1111
public class WindowsAssert extends UIAssert<WindowsAssert, Windows> implements ThemeAssert<WindowsAssert, Windows> {
1212
@JDIAction(value = "Assert that '{name}' shows arrows on hover", isAssert = true)
1313
public WindowsAssert showArrowsOnHover() {
14-
jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Element doesn't show arrows on hover");
14+
jdiAssert(element().showArrowsOnHover(), Matchers.is(true), "Window doesn't show arrows on hover");
1515
return this;
1616
}
1717

1818
@JDIAction(value = "Assert that '{name}' doesn't show arrows on hover", isAssert = true)
1919
public WindowsAssert notShowArrowsOnHover() {
20-
jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Element shows arrows on hover");
21-
return this;
22-
}
23-
24-
@JDIAction(value = "Assert that '{name}' has no next actions button", isAssert = true)
25-
public WindowsAssert noNextActionsButton() {
26-
jdiAssert(element().nextButton().isNotExist(), Matchers.is(false), "Element's next actions " +
27-
"button exists");
20+
jdiAssert(element().showArrowsOnHover(), Matchers.is(false), "Window shows arrows on hover");
2821
return this;
2922
}
3023

3124
@JDIAction(value = "Assert that '{name}' has previous button", isAssert = true)
3225
public WindowsAssert previousButton() {
33-
jdiAssert(element().previousButton().isExist(), Matchers.is(true), "Element's previous " +
34-
"button doesn't exist");
26+
jdiAssert(element().previousButton().isExist(), Matchers.is(true),
27+
"Window's previous button doesn't exist");
3528
return this;
3629
}
3730

3831
@JDIAction(value = "Assert that '{name}' has no previous button", isAssert = true)
3932
public WindowsAssert noPreviousButton() {
40-
jdiAssert(element().previousButton().isExist(), Matchers.is(false), "Element's previous " +
41-
"button exists");
33+
jdiAssert(element().previousButton().isExist(), Matchers.is(false),
34+
"Window's previous button exists");
4235
return this;
4336
}
4437

4538
@JDIAction(value = "Assert that '{name}' has next button", isAssert = true)
4639
public WindowsAssert nextButton() {
47-
jdiAssert(element().nextButton().isExist(), Matchers.is(true), "Element's next " +
48-
"button doesn't exist");
40+
jdiAssert(element().nextButton().isExist(), Matchers.is(true),
41+
"Window's next button doesn't exist");
4942
return this;
5043
}
5144

5245
@JDIAction(value = "Assert that '{name}' has no next button", isAssert = true)
5346
public WindowsAssert noNextButton() {
54-
jdiAssert(element().nextButton().isExist(), Matchers.is(false), "Element's next " +
55-
"button exists");
47+
jdiAssert(element().nextButton().isExist(), Matchers.is(false),
48+
"Window's next button exists");
5649
return this;
5750
}
5851
}

0 commit comments

Comments
 (0)