/
TooltipsTests.java
46 lines (40 loc) · 1.74 KB
/
TooltipsTests.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package io.github.epam.vuetify.tests.common;
import io.github.epam.TestsInit;
import io.github.epam.vuetify.tests.data.TooltipsTestsDataProvider;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import static com.jdiai.tools.Timer.waitCondition;
import static io.github.com.StaticSite.tooltipsPage;
import static io.github.com.pages.TooltipsPage.buttonWithTooltip;
import static io.github.com.pages.TooltipsPage.homeIconWithTooltip;
import static io.github.com.pages.TooltipsPage.textWithTooltip;
import static io.github.com.pages.TooltipsPage.tooltip;
import static io.github.com.pages.TooltipsPage.coloredButtons;
public class TooltipsTests extends TestsInit {
@BeforeClass
public void before() {
tooltipsPage.open();
waitCondition(() -> tooltipsPage.isOpened());
tooltipsPage.checkOpened();
}
@Test(description = "Test checks specific text of text tooltip")
public void textTooltipsTest() {
homeIconWithTooltip.is().displayed();
buttonWithTooltip.hover();
tooltip.is().displayed();
tooltip.has().text("Tooltip for \"Button\"");
homeIconWithTooltip.hover();
tooltip.is().displayed();
tooltip.has().text("Tooltip for \"mdi-home\"");
textWithTooltip.hover();
tooltip.is().displayed();
tooltip.has().text("Tooltip for \"This text has a tooltip\"");
}
@Test(dataProvider = "colorsTooltipsTestDataProvider", dataProviderClass = TooltipsTestsDataProvider.class,
description = "Test checks that tooltip has specific color")
public void colorTooltipTest(int index, String color) {
coloredButtons.get(index).hover();
tooltip.is().displayed();
tooltip.has().color(color);
}
}