Repository navigation
Expand file tree
/
Copy pathChangeAppConditionTests.java
More file actions
60 lines (48 loc) · 1.98 KB
/
Copy pathChangeAppConditionTests.java
File metadata and controls
60 lines (48 loc) · 1.98 KB
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
package tests;
import lib.CoreTestCase;
import lib.Platform;
import lib.ui.ArticlePageObject;
import lib.ui.SearchPageObject;
import lib.ui.factories.ArticlePageObjectFactory;
import lib.ui.factories.SearchPageObjectFactory;
import org.junit.Test;
public class ChangeAppConditionTests extends CoreTestCase {
@Test
public void testChangeScreenOrientationOnSearchResults() {
if (Platform.getInstance().isMW()) {
return;
}
SearchPageObject SearchPageObject = SearchPageObjectFactory.get(driver);
SearchPageObject.initSearchInput();
SearchPageObject.typeSearchLine("Java");
SearchPageObject.clickByArticleWithSubstring("Object-oriented programming language");
ArticlePageObject ArticlePageObject = ArticlePageObjectFactory.get(driver);
String title_before_rotation = ArticlePageObject.getArticleTitle();
this.rotateScreenLandscape();
String title_after_rotation = ArticlePageObject.getArticleTitle();
assertEquals(
"Article title have been changed after screen rotation",
title_before_rotation,
title_after_rotation
);
this.rotateScreenPortrait();
String title_after_second_rotation = ArticlePageObject.getArticleTitle();
assertEquals(
"Article title have been changed after screen rotation",
title_before_rotation,
title_after_second_rotation
);
}
@Test
public void testCheckSearchArticleInBackground() {
if (Platform.getInstance().isMW()) {
return;
}
SearchPageObject SearchPageObject = SearchPageObjectFactory.get(driver);
SearchPageObject.initSearchInput();
SearchPageObject.typeSearchLine("Java");
SearchPageObject.waitForSearchResult("Object-oriented programming language");
this.backgroundApp(2);
SearchPageObject.waitForSearchResult("Object-oriented programming language");
}
}