forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1828953 - add automated tests for the webcompat v114 and v115 int…
…erventions, remove some obsolete ones; r=denschub DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D177325
- Loading branch information
1 parent
d5393fa
commit 8abc619
Showing
36 changed files
with
708 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 0 additions & 62 deletions
62
testing/webcompat/interventions/tests/test_1803976_youtube_com.py
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
testing/webcompat/interventions/tests/test_1811325_inmac_wstore_com.py
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
testing/webcompat/interventions/tests/test_1818818_marksandspencer_com.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
testing/webcompat/interventions/tests/test_1829126_otsuka_co_jp.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pytest | ||
|
||
URL = "https://www.otsuka.co.jp/fib/" | ||
SPLASH_CSS = ".splash" | ||
ERROR_MSG = "__im_uid_11310 is not defined" | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.with_interventions | ||
async def test_enabled(client): | ||
await client.navigate(URL) | ||
assert client.await_css(SPLASH_CSS) | ||
client.await_element_hidden(client.css(SPLASH_CSS), timeout=10) | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.without_interventions | ||
async def test_disabled(client): | ||
await client.navigate(URL, await_console_message=ERROR_MSG) | ||
assert client.find_css(SPLASH_CSS, is_displayed=False) |
18 changes: 18 additions & 0 deletions
18
testing/webcompat/interventions/tests/test_1829944_411_ca.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
|
||
URL = "https://411.ca" | ||
UNSUPPORTED_CSS = "ngb-alert.header-outdated-alert" | ||
|
||
|
||
@pytest.mark.asyncio | ||
@pytest.mark.with_interventions | ||
async def test_enabled(client): | ||
await client.navigate(URL) | ||
assert not client.find_css(UNSUPPORTED_CSS) | ||
|
||
|
||
@pytest.mark.asyncio | ||
@pytest.mark.without_interventions | ||
async def test_disabled(client): | ||
await client.navigate(URL) | ||
assert client.find_css(UNSUPPORTED_CSS) |
4 changes: 2 additions & 2 deletions
4
...s/tests/test_1448747_gofreeconcepts_de.py → ...ntions/tests/test_1829947_torguard_net.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
testing/webcompat/interventions/tests/test_1829952_eventer_co_il.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import pytest | ||
|
||
URL = "https://www.eventer.co.il" | ||
EVENT_CSS = "a.slide-a-tag[href*='/event']" | ||
ELEM_CSS = ".mobileStripButton:not(.ng-hide)" | ||
|
||
|
||
async def is_too_tall(client): | ||
await client.navigate(URL) | ||
event = client.await_css(EVENT_CSS) | ||
await client.navigate(URL + client.get_element_attribute(event, "href")) | ||
elem = client.await_css(ELEM_CSS) | ||
return client.execute_script( | ||
""" | ||
return window.innerHeight == arguments[0].getBoundingClientRect().height; | ||
""", | ||
elem, | ||
) | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.with_interventions | ||
async def test_enabled(client): | ||
assert not await is_too_tall(client) | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.without_interventions | ||
async def test_disabled(client): | ||
assert await is_too_tall(client) |
27 changes: 27 additions & 0 deletions
27
testing/webcompat/interventions/tests/test_1830739_casinoextreme_eu.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
URL = "https://casinoextreme.eu/games" | ||
RUN_CSS = "a.playgame-demo[onclick^='playGame']" | ||
IFRAME_CSS = "#gameplay > iframe" | ||
GOOD_MSG = "GameViewModel" | ||
BAD_MSG = "UnsupportedDevice" | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.with_interventions | ||
async def test_enabled(client): | ||
await client.navigate(URL) | ||
client.soft_click(client.await_css(RUN_CSS)) | ||
client.switch_to_frame(client.await_css(IFRAME_CSS)) | ||
await client.promise_console_message(GOOD_MSG) | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.without_interventions | ||
async def test_disabled(client): | ||
await client.navigate(URL) | ||
client.soft_click(client.await_css(RUN_CSS)) | ||
client.switch_to_frame(client.await_css(IFRAME_CSS)) | ||
await client.promise_console_message(BAD_MSG) |
24 changes: 24 additions & 0 deletions
24
testing/webcompat/interventions/tests/test_1830739_www_cryptoloko_com.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
|
||
URL = "https://www.cryptoloko.com/webplay/?play=sweet-16-blast" | ||
IFRAME_CSS = "#gameiframe" | ||
GOOD_MSG = "GameViewModel" | ||
BAD_MSG = "UnsupportedDevice" | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.with_interventions | ||
async def test_enabled(client): | ||
await client.navigate(URL) | ||
client.switch_to_frame(client.await_css(IFRAME_CSS)) | ||
await client.promise_console_message(GOOD_MSG) | ||
|
||
|
||
@pytest.mark.only_platforms("android") | ||
@pytest.mark.asyncio | ||
@pytest.mark.without_interventions | ||
async def test_disabled(client): | ||
await client.navigate(URL) | ||
client.switch_to_frame(client.await_css(IFRAME_CSS)) | ||
await client.promise_console_message(BAD_MSG) |
Oops, something went wrong.