-
Notifications
You must be signed in to change notification settings - Fork 0
/
CarinaDemoHeaderTest.java
124 lines (115 loc) · 6.34 KB
/
CarinaDemoHeaderTest.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package pl.solvd.carina;
import com.qaprosoft.carina.core.foundation.IAbstractTest;
import com.zebrunner.agent.core.annotation.TestLabel;
import com.zebrunner.carina.core.registrar.ownership.MethodOwner;
import com.zebrunner.carina.core.registrar.tag.Priority;
import com.zebrunner.carina.core.registrar.tag.TestPriority;
import org.testng.Assert;
import org.testng.annotations.Test;
public class CarinaDemoHeaderTest implements IAbstractTest {
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testZebrunnerLogoIsClickable() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Assert.assertTrue(overviewPage.isHeaderPresent(), "Header element wasn't found!");
Header header = overviewPage.getHeader();
Assert.assertTrue(header.isZebrunnerLogoPresent(2), "Zebrunner logo missing from header");
Assert.assertTrue(header.isZebrunnerLogoRedirectToURL(Url.OVERVIEW), "Clicking on Zerunner logo doesn't redirect to Overview page");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testCarinaText() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Header header = overviewPage.getHeader();
Assert.assertTrue(header.isUIObjectPresent(2), "Header element wasn't found!");
Assert.assertTrue(header.isCarinaBrandPresent(2), "Carina text is outside the header!");
Assert.assertTrue(header.isCarinaBrandHasText(), "Header doesn't contain Carina text");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testSearchComponent() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Header header = overviewPage.getHeader();
Assert.assertTrue(header.isUIObjectPresent(2), "Header element wasn't found!");
Assert.assertTrue(header.isSearchComponentPresent(2), "Search component element not found");
Assert.assertTrue(header.isSearchComponentElementsPresent(2), "Search component elements not found");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testGitHubLink() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Header header = overviewPage.getHeader();
Assert.assertTrue(header.isUIObjectPresent(2), "Header element wasn't found!");
Assert.assertTrue(header.isGitHubPresent(2), "Header doesn't contain GitHub link");
Assert.assertTrue(header.isGitHubRedirectToURL(Url.GITHUB), "Clicking on GitHub link doesn't redirect to GitHub page");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testHeaderSticky() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Header header = overviewPage.getHeader();
Assert.assertTrue(header.isUIObjectPresent(2), "Header element wasn't found!");
Assert.assertTrue(overviewPage.isHeaderVisibleWhileScrolling(), "Header not visible while page scrolling");
Assert.assertTrue(overviewPage.isHeaderAtTheTop(), "Header is not at the top of the page");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testNavigationVisibility() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Assert.assertTrue(overviewPage.isNavigationPresent(), "Navigation element wasn't found!");
Navigation navigation = overviewPage.getNavigation();
Assert.assertTrue(navigation.isBrandFirstElement(), "Carina heading is not first in navigation menu!");
Assert.assertTrue(navigation.isNavigationListPresent(), "Navigation list wasn't found in navigation menu!");
Assert.assertTrue(navigation.isCurrentPageHighlighted(), "Current page is not highlited");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testNavigationHiddenComponents() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Navigation navigation = overviewPage.getNavigation();
Assert.assertTrue(navigation.isUIObjectPresent(2), "Navigation menu wasn't found!");
Assert.assertTrue(navigation.isHiddenElementInNavigationMenu(), "Navigation menu has hidden elements!");
Assert.assertTrue(navigation.isNestedNavigationMenu(), "Navigation menu hasn't nested elements!");
Assert.assertTrue(navigation.isSubPagesReveals(), "Clicking on parent nav element don't reveals the links for sub-pages!");
}
@Test()
@MethodOwner(owner = "ashvedava")
@TestPriority(Priority.P3)
@TestLabel(name = "feature", value = {"web", "regression"})
public void testNavigationRedirect() {
OverviewPage overviewPage = new OverviewPage(getDriver());
overviewPage.open();
Assert.assertTrue(overviewPage.isPageOpened(), "Overview page is not opened");
Navigation navigation = overviewPage.getNavigation();
Assert.assertTrue(navigation.isUIObjectPresent(2), "Navigation menu wasn't found!");
Assert.assertTrue(navigation.isRedirectToURL(), "Clicking on link doesn't redirect to page");
}
}