Skip to content

Commit 30134e4

Browse files
Hani YacoubHani Yacoub
authored andcommitted
test SAP google adclick
1 parent f95867a commit 30134e4

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

modules/data/navigation.components.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,17 @@
146146
"groups": [
147147
"doNotCache"
148148
]
149+
},
150+
151+
"accept-cookies": {
152+
"selectorData": "L2AGLb",
153+
"strategy": "id",
154+
"groups": []
155+
},
156+
157+
"search-result": {
158+
"selectorData": "//div[@data-text-ad]//a",
159+
"strategy": "xpath",
160+
"groups": []
149161
}
150162
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import time
2+
3+
import pytest
4+
from selenium.webdriver import Firefox
5+
6+
from modules.browser_object_navigation import Navigation
7+
8+
from modules.page_object_about_telemetry import AboutTelemetry
9+
from modules.util import Utilities
10+
11+
12+
@pytest.fixture()
13+
def add_prefs():
14+
return [
15+
("browser.search.region", "US"),
16+
]
17+
18+
19+
def test_sap_google_adclick(driver: Firefox):
20+
"""
21+
C1365108, Test SAP Google adclick - URL bar - US
22+
"""
23+
# instantiate objects
24+
nav = Navigation(driver).open()
25+
nav.search("iphone")
26+
time.sleep(2)
27+
u = Utilities()
28+
29+
# click on any ad
30+
nav.get_element("accept-cookies").click()
31+
nav.get_element("search-result").click()
32+
time.sleep(2)
33+
34+
# Click on Raw JSON, switch tab and click on Raw Data
35+
about_telemetry = AboutTelemetry(driver).open()
36+
about_telemetry.get_element("category-raw").click()
37+
about_telemetry.switch_tab()
38+
about_telemetry.get_element("rawdata-tab").click()
39+
40+
# Verify pings are recorded
41+
json_data = u.decode_url(driver)
42+
assert u.assert_json_value(
43+
json_data, '$..keyedScalars.["browser.search.adclicks.urlbar"].["google:tagged"]', 1
44+
)

0 commit comments

Comments
 (0)