/
URLBarTest.swift.orig
62 lines (55 loc) · 2.66 KB
/
URLBarTest.swift.orig
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
//
// URLBarTest.swift
// Client
//
// Created by Kiiza Joseph Bazaare on 12/19/16.
// Copyright © 2016 Mozilla. All rights reserved.
//
import XCTest
import KIF
class URLBarTest: KIFTestCase {
func testAntiTrackingButton(){
if tester.viewExistsWithLabel("Go"){
}
else{
if tester.viewExistsWithLabel("Address and Search"){
tester.tapView(withAccessibilityLabel: "Address and Search")
}
else{
tester.tapView(withAccessibilityIdentifier: "url")
}
}
tester.waitForView(withAccessibilityLabel: "Address and Search")
XCTAssertFalse(tester.viewExistsWithLabel("AntiTrackingButton"), "AntiTracking Button is displayed, It shouldn't be displayed!")
openWebPage("https://cdn.cliqz.com/mobile/browser/tests/forward_test.html")
tester.waitForView(withAccessibilityLabel: "https://cdn.cliqz.com/mobile/browser/tests/forward_test.html")
XCTAssertTrue(tester.viewExistsWithLabel("AntiTrackingButton"), "AntiTracking Button is not displayed, It should be!")
tester.tapView(withAccessibilityLabel: "Back")
resetApp(["New Tab, Most visited sites and News"])
}
func testTabsChangeNumber() {
showToolBar()
let x = tester.waitForView(withAccessibilityLabel: "Show Tabs")
XCTAssertTrue(x?.accessibilityValue == "1", "More than one tab is opened, Only one tab should be opened")
XCTAssertTrue(tester.viewExistsWithLabel("Show Tabs"), "Show Tabs button should be on this View")
<<<<<<< HEAD
tester.tapViewWithAccessibilityLabel("Show Tabs")
tester.waitForViewWithAccessibilityLabel("Favorites")
tester.waitForViewWithAccessibilityLabel("History")
tester.waitForViewWithAccessibilityLabel("Tabs")
tester.waitForViewWithAccessibilityLabel("+")
tester.tapViewWithAccessibilityLabel("+")
showToolBar()
XCTAssertTrue(x.accessibilityValue == "2", "Less than two or more than two tabs are open, Two tabs should be opened!")
=======
tester.tapView(withAccessibilityLabel: "Show Tabs")
tester.waitForView(withAccessibilityLabel: "Favorites")
tester.waitForView(withAccessibilityLabel: "History")
tester.waitForView(withAccessibilityLabel: "Tabs")
tester.waitForView(withAccessibilityLabel: "+")
tester.tapView(withAccessibilityLabel: "+")
XCTAssertTrue(x?.accessibilityValue == "2", "Less than two or more than two tabs are open, Two tabs should be opened!")
>>>>>>> Swift3 migration
resetApp(["New Tab, Most visited sites and News","New Tab, Most visited sites and News"])
}
}