Skip to content

Commit ebc11a4

Browse files
authored
Merge pull request #5377 from jdi-testing/5367_fix_sliders
Slider is a controll with v-input--slider class
2 parents 44919d7 + 5451bf1 commit ebc11a4

File tree

83 files changed

+156
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+156
-233
lines changed

jdi-light-vuetify-tests/src/main/java/io/github/com/custom/AdvancedCombobox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import static com.epam.jdi.light.driver.get.DriverData.getOs;
1313

1414
/**
15-
* To see example of AdvancedCombobox web element please visit https://vuetifyjs.com/en/components/combobox/
15+
* To see example of AdvancedCombobox web element please visit https://v2.vuetifyjs.com/en/components/combobox/
1616
*/
1717

1818
public class AdvancedCombobox extends Combobox {

jdi-light-vuetify-tests/src/main/java/io/github/com/custom/ProfileCard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Represents profile card Vuetify component on GUI.
1010
* Profile card contains avatar image, background image, username and job function.
1111
*
12-
* @see <a href="https://vuetifyjs.com/en/components/avatars/#profile-card">Profile Card Vuetify documentation</a>
12+
* @see <a href="https://v2.vuetifyjs.com/en/components/avatars/#profile-card">Profile Card Vuetify documentation</a>
1313
* @see <a href="https://jdi-testing.github.io/jdi-light/vuetify/">Vuetify test page</a>
1414
*/
1515

jdi-light-vuetify-tests/src/main/java/io/github/com/pages/FloatingActionButtonsPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/**
1414
* To see an example of Alert web element please visit
15-
* https://vuetifyjs.com/en/components/floating-action-buttons/
15+
* https://v2.vuetifyjs.com/en/components/floating-action-buttons/
1616
*/
1717

1818
public class FloatingActionButtonsPage extends VuetifyPage {

jdi-light-vuetify-tests/src/main/java/io/github/com/pages/ImagesPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class ImagesPage extends VuetifyPage {
1010

11-
@UI("#AspectRatioImage .v-slider")
11+
@UI("#AspectRatioImage .v-input__slider")
1212
public static Slider slider;
1313

1414
@UI("#AspectRatioImage .v-image")

jdi-light-vuetify-tests/src/main/java/io/github/com/pages/RatingsPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class RatingsPage extends VuetifyPage {
2929
@UI("#LengthRating .v-rating")
3030
public static Rating lengthRating;
3131

32-
@UI("#LengthRating .v-slider")
32+
@UI("#LengthRating .v-input__slider")
3333
public static Slider lengthRatingSlider;
3434

3535
@JDIRating(root = "#IncrementedRating .v-rating",

jdi-light-vuetify-tests/src/main/java/io/github/com/pages/SlidersPage.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,48 @@
99

1010
public class SlidersPage extends VuetifyPage {
1111

12-
@UI("#ColorsSlider .v-slider")
12+
@UI("#ColorsSlider .v-input__slider")
1313
public static List<Slider> colorsSlider;
1414

15-
@UI("#DisabledSlider .v-slider")
15+
@UI("#DisabledSlider .v-input__slider")
1616
public static Slider disabledSlider;
1717

18-
// @todo #5298 Locator with .v-slider should be used
19-
@UI("#DisabledSlider .v-input__control")
18+
@UI("#DisabledSlider .v-input__slider")
2019
public static Slider disabledSliderControl;
2120

22-
@UI("#DiscreteSlider .v-slider")
21+
@UI("#DiscreteSlider .v-input__slider")
2322
public static Slider discreteSlider;
2423

25-
@UI("#IconsSlider .v-slider")
24+
@UI("#IconsSlider .v-input__slider")
2625
public static List<Slider> iconsSlider;
27-
@UI("#InverseLabelSlider .v-slider")
26+
@UI("#InverseLabelSlider .v-input__slider")
2827
public static Slider inverseLabelSlider;
2928

30-
@UI("#ReadonlySlider .v-slider")
29+
@UI("#ReadonlySlider .v-input__slider")
3130
public static Slider readonlySlider;
3231

33-
@UI("#StepSlider .v-slider")
32+
@UI("#StepSlider .v-input__slider")
3433
public static Slider stepSlider;
3534

36-
@UI("#ThumbSlider .v-slider")
35+
@UI("#ThumbSlider .v-input__slider")
3736
public static List<Slider> thumbSlider;
3837

39-
@UI("#TicksSlider .v-slider")
38+
@UI("#TicksSlider .v-input__slider")
4039
public static List<Slider> ticksSlider;
4140

42-
@UI("#ValidationSlider .v-slider")
41+
@UI("#ValidationSlider .v-input__slider")
4342
public static List<Slider> validationSlider;
4443

45-
@UI("#VerticalSlidersSlider .v-slider")
44+
@UI("#VerticalSlidersSlider .v-input__slider")
4645
public static Slider verticalSlidersSlider;
4746

48-
@UI("#AppendTextFieldSlider .v-slider")
47+
@UI("#AppendTextFieldSlider .v-input__slider")
4948
public static List<Slider> appendTextFieldSlider;
5049

5150
@UI("#AppendTextFieldSlider .v-text-field__slot")
5251
public static List<TextField> appendTextField;
5352

54-
@UI("#AdjustableSlider .slider")
53+
@UI("#AdjustableSlider .v-input__slider")
5554
public static Slider adjustableSlider;
5655

5756
@UI("#AdjustableSlider .v-input--switch [1]")

jdi-light-vuetify-tests/src/main/java/io/github/com/pages/SparklinesPage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public class SparklinesPage extends VuetifyPage {
1414
@UI(".mr-2.v-card")
1515
public static WebList fillSparklineColorSwitches;
1616

17-
@UI("#FillSparkline .v-slider[1]")
17+
@UI("#FillSparkline .v-input__slider[1]")
1818
public static Slider fillSparklineWidthSlider;
1919

20-
@UI("#FillSparkline .v-slider[2]")
20+
@UI("#FillSparkline .v-input__slider[2]")
2121
public static Slider fillSparklineRadiusSlider;
2222

23-
@UI("#FillSparkline .v-slider[3]")
23+
@UI("#FillSparkline .v-input__slider[3]")
2424
public static Slider fillSparklinePaddingSlider;
2525

2626
@UI("#FillSparkline .v-input--selection-controls__input")

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

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.testng.annotations.BeforeClass;
77
import org.testng.annotations.Test;
88

9-
import java.util.stream.IntStream;
9+
import java.util.Random;
1010

1111
import static com.jdiai.tools.Timer.waitCondition;
1212
import static io.github.com.StaticSite.ratingsPage;
@@ -30,11 +30,10 @@ public void before() {
3030

3131
@Test(description = "Test checks rating's color", dataProvider = "colorRatingTestData", dataProviderClass = RatingDataProvider.class)
3232
public void colorRatingTest(String expectedColor, Rating rating) {
33-
for (int testedValue = 1; testedValue <= rating.length(); testedValue++) {
34-
rating.setValue(testedValue);
35-
rating.has().value(testedValue);
36-
rating.has().color(expectedColor);
37-
}
33+
int r = new Random().nextInt(rating.length()) + 1;
34+
rating.setValue(r);
35+
rating.has().value(r);
36+
rating.has().color(expectedColor);
3837
}
3938

4039
@Test(description = "Test checks rating's item color", dataProvider = "itemSlotRatingTestData", dataProviderClass = RatingDataProvider.class)
@@ -46,11 +45,10 @@ public void itemColorRatingTest(int index, String expectedColor) {
4645

4746
@Test(description = "Test checks rating's length")
4847
public void lengthRatingTest() {
49-
IntStream.range(1, 15).forEach(index -> {
50-
lengthRatingSlider.setValue((double) index);
51-
waitCondition(() -> lengthRating.length() == index);
52-
lengthRating.has().length(index);
53-
});
48+
int r = new Random().nextInt(14) + 1;
49+
lengthRatingSlider.setValue((double) r);
50+
lengthRating.has().length(r);
51+
5452
}
5553

5654
@Test(description = "Test checks rating's value")

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

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import com.google.common.collect.ImmutableList;
77
import io.github.epam.TestsInit;
88
import io.github.epam.vuetify.tests.data.SliderTestsDataProvider;
9-
import org.testng.annotations.BeforeMethod;
9+
import org.hamcrest.Matchers;
10+
import org.testng.annotations.BeforeClass;
1011
import org.testng.annotations.Test;
1112

1213
import java.util.List;
@@ -25,26 +26,23 @@
2526
import static io.github.com.pages.SlidersPage.disabledSliderControl;
2627
import static io.github.com.pages.SlidersPage.discreteSlider;
2728
import static io.github.com.pages.SlidersPage.errorCountTextField;
28-
import static io.github.com.pages.SlidersPage.heightTextField;
2929
import static io.github.com.pages.SlidersPage.hideDetailsSwitch;
3030
import static io.github.com.pages.SlidersPage.iconsSlider;
3131
import static io.github.com.pages.SlidersPage.inverseLabelSlider;
32-
import static io.github.com.pages.SlidersPage.loaderHeightTextField;
3332
import static io.github.com.pages.SlidersPage.loadingSwitch;
3433
import static io.github.com.pages.SlidersPage.readonlySlider;
3534
import static io.github.com.pages.SlidersPage.stepSlider;
3635
import static io.github.com.pages.SlidersPage.successMessageTextField;
3736
import static io.github.com.pages.SlidersPage.themeSwitch;
3837
import static io.github.com.pages.SlidersPage.thumbSlider;
3938
import static io.github.com.pages.SlidersPage.ticksSlider;
40-
import static io.github.com.pages.SlidersPage.validateOnBlurSwitch;
4139
import static io.github.com.pages.SlidersPage.validationSlider;
4240
import static io.github.com.pages.SlidersPage.verticalSlidersSlider;
4341
import static org.openqa.selenium.Keys.ENTER;
4442

4543
public class SlidersTests extends TestsInit {
4644

47-
@BeforeMethod
45+
@BeforeClass
4846
public void before() {
4947
slidersPage.open();
5048
waitCondition(() -> slidersPage.isOpened());
@@ -130,7 +128,6 @@ public void thumbSliderTest() {
130128
firstThumbSlider.setValue(10);
131129

132130
firstThumbSlider.has().thumbLabel().and().thumbSize(16);
133-
firstThumbSlider.thumbLabel().is().hidden();
134131
firstThumbSlider.thumb().click();
135132
firstThumbSlider.thumbLabel().is().displayed().and().has().value("10");
136133

@@ -142,8 +139,6 @@ public void thumbSliderTest() {
142139
public void labelSliderTest() {
143140
disabledSlider.show();
144141
disabledSlider.has().label("Disabled");
145-
thumbSlider.get(1).show();
146-
thumbSlider.get(1).has().noLabel();
147142
inverseLabelSlider.show();
148143
inverseLabelSlider.has().inverseLabel().and().label("Inverse label");
149144
}
@@ -213,10 +208,8 @@ public void successSliderTest() {
213208
@Test(description = "Test checks slider's messages : hint(string), persistent-hint (y/n)")
214209
public void hintSliderTest() {
215210
adjustableSlider.show();
216-
adjustableSlider.has().messagesCount(0);
217211
adjustableSlider.thumb().click();
218-
waitCondition(() -> adjustableSlider.messages().size() > 0);
219-
adjustableSlider.has().messagesCount(1);
212+
adjustableSlider.has().messagesCount(Matchers.greaterThan(0));
220213

221214
Slider hintSlider = validationSlider.get(2);
222215
hintSlider.show();
@@ -262,13 +255,6 @@ public void denseSliderTest() {
262255
adjustableSlider.is().notDense();
263256
}
264257

265-
@Test(description = "Test checks slider's height")
266-
public void heightSliderTest() {
267-
heightTextField.setText("16");
268-
adjustableSlider.show();
269-
adjustableSlider.has().height(16);
270-
}
271-
272258
@Test(description = "Test checks if slider has details hidden or not")
273259
public void hideDetailsSliderTest() {
274260
adjustableSlider.show();
@@ -282,8 +268,7 @@ public void loadingSliderTest() {
282268
adjustableSlider.show();
283269
loadingSwitch.check();
284270
adjustableSlider.is().loading();
285-
loaderHeightTextField.setText("15");
286-
adjustableSlider.loader().has().height(15);
271+
adjustableSlider.loader().has().height(10);
287272
loadingSwitch.uncheck();
288273
}
289274

@@ -292,14 +277,4 @@ public void minMaxValueSliderTest() {
292277
adjustableSlider.show();
293278
adjustableSlider.has().minValue(0).and().has().maxValue(100);
294279
}
295-
@Test(description = "Test checks slider's validate-on-blur")
296-
public void validateOnBlurSliderTest() {
297-
adjustableSlider.show();
298-
validateOnBlurSwitch.check();
299-
adjustableSlider.has().messagesCount(0);
300-
adjustableSlider.setValue(10.0);
301-
adjustableSlider.thumb().click();
302-
adjustableSlider.clickOutsideOfSlider(); //validate-on-blur works only after click on slider and then click outside
303-
adjustableSlider.has().messagesCount(1);
304-
}
305280
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public RatingAssert size(int size) {
4646

4747
@JDIAction(value = "Assert that '{name}' length is '{0}'", isAssert = true)
4848
public RatingAssert length(int length) {
49-
int actualLength = element().length();
5049
jdiAssert(element().length(), Matchers.is(length));
5150
return this;
5251
}

0 commit comments

Comments
 (0)