Skip to content

Commit 09bc440

Browse files
Hani YacoubHani Yacoub
authored andcommitted
Merge branch 'main' into Hani/cm-johnlewis-gb
2 parents 713aa85 + 855f981 commit 09bc440

File tree

8 files changed

+114
-0
lines changed

8 files changed

+114
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"url": "http://127.0.0.1:8080/cultbeauty_ad.html",
3+
"field_mapping": {
4+
"name": "a2230da4-744f-41b8-b2a3-686741e94715",
5+
"street_address": "7ec63af6-73de-4b4d-98c7-7af4239defde",
6+
"postal_code": "b4ba6987-de2d-49be-a1f5-1d983cf1525e",
7+
"address_level_2": "ef22ba0f-7275-4086-af6e-6ef43cac4c25",
8+
"telephone": "731ec27e-9e60-4fbe-858f-de1d8c168b3d",
9+
"country": "7a482a0f-85c5-4b73-ac52-639ad8038635"
10+
},
11+
12+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
13+
"fields": [
14+
"a2230da4-744f-41b8-b2a3-686741e94715",
15+
"7ec63af6-73de-4b4d-98c7-7af4239defde",
16+
"b4ba6987-de2d-49be-a1f5-1d983cf1525e",
17+
"ef22ba0f-7275-4086-af6e-6ef43cac4c25",
18+
"731ec27e-9e60-4fbe-858f-de1d8c168b3d",
19+
"7a482a0f-85c5-4b73-ac52-639ad8038635"
20+
]
21+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"url": "http://127.0.0.1:8080/cultbeauty_cc.html",
3+
"field_mapping": {
4+
"card_number": "1ae2f87d-489b-412e-8ae9-b6b7e2860b3c",
5+
"name": "dcacdef7-e39f-4c8c-a9df-aa03173c89aa",
6+
"expiration_month": "43a870b8-62fa-4cdd-a5ee-f7c0832ca4ff",
7+
"expiration_year": "fda74455-fcc3-4129-8431-a0cbadb79dab",
8+
"cvv": "d1a43343-2491-4510-b779-54ff1961ef77"
9+
},
10+
11+
"form_field": "*[data-moz-autofill-inspect-id='{name}']",
12+
"fields": [
13+
"1ae2f87d-489b-412e-8ae9-b6b7e2860b3c",
14+
"dcacdef7-e39f-4c8c-a9df-aa03173c89aa",
15+
"43a870b8-62fa-4cdd-a5ee-f7c0832ca4ff",
16+
"fda74455-fcc3-4129-8431-a0cbadb79dab",
17+
"d1a43343-2491-4510-b779-54ff1961ef77"
18+
]
19+
}

l10n_CM/region/GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"region": "GB",
33
"sites": [
4+
"cultbeauty",
45
"assos",
56
"demo",
67
"diy",

l10n_CM/run_l10n.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"cdiscount",
3535
"ceneo",
3636
"cocolita",
37+
"cultbeauty",
3738
"cupshe",
3839
"decathlon",
3940
"demo",

l10n_CM/sites/cultbeauty/GB/cultbeauty_ad.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

l10n_CM/sites/cultbeauty/GB/cultbeauty_cc.html

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

modules/browser_object_navigation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,18 @@ def refresh_page(self) -> BasePage:
307307
self.wait_for_page_to_load()
308308
return self
309309

310+
@BasePage.context_chrome
311+
def hard_reload_with_key_combo(self) -> BasePage:
312+
"""
313+
Use Cmd/Ctrl + Shift + R to hard reload the page and overide cache.
314+
"""
315+
if self.sys_platform() == "Darwin":
316+
mod_key = Keys.COMMAND
317+
else:
318+
mod_key = Keys.CONTROL
319+
self.perform_key_combo(mod_key, Keys.SHIFT, "r")
320+
return self
321+
310322
def handle_geolocation_prompt(
311323
self, button_type="primary", remember_this_decision=False
312324
):
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import pytest
2+
from selenium.common.exceptions import NoSuchElementException
3+
from selenium.webdriver import Firefox
4+
from selenium.webdriver.common.by import By
5+
6+
from modules.browser_object import TabBar
7+
from modules.browser_object_navigation import Navigation
8+
9+
10+
@pytest.fixture()
11+
def test_case():
12+
return "134642"
13+
14+
15+
TEST_URL = "https://postman-echo.com/headers"
16+
17+
18+
def test_reload_overiding_cache_keys(driver: Firefox, sys_platform: str):
19+
"""
20+
C134642 - Verify that tabs can be hard reloaded (overriding cache) using keyboard shortcut CTRL/CMD + SHIFT + R.
21+
"""
22+
23+
browser = TabBar(driver)
24+
nav = Navigation(driver)
25+
26+
# New tab + navigate
27+
browser.new_tab_by_button()
28+
driver.switch_to.window(driver.window_handles[-1])
29+
driver.get(TEST_URL)
30+
31+
# Hard reload using helper function for action CTRL/CMD + SHIFT + "r"
32+
nav.hard_reload_with_key_combo()
33+
34+
# Verify cache is not being used by checking for http request headers
35+
# Header "if-none-match" should not be sent
36+
try:
37+
etag = driver.find_element(By.ID, "/headers/if-none-match").get_attribute(
38+
"innerText"
39+
)
40+
assert False, f"Unexpected If-None-Match present: {etag!r}"
41+
except NoSuchElementException:
42+
pass
43+
44+
# Header "pragma" should be sent with with value "no-cache"
45+
pragma_text = driver.find_element(By.ID, "/headers/pragma").get_attribute(
46+
"innerText"
47+
)
48+
assert "no-cache" in pragma_text, (
49+
f"Expected 'no-cache' in pragma; got: {pragma_text!r}"
50+
)
51+
52+
# Header "cache-control" should be sent with with value "no-cache"
53+
cache_control_text = driver.find_element(
54+
By.ID, "/headers/cache-control"
55+
).get_attribute("innerText")
56+
assert "no-cache" in cache_control_text, (
57+
f"Expected 'no-cache' in cache-control; got: {cache_control_text!r}"
58+
)

0 commit comments

Comments
 (0)