|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
import time
|
|
|
|
|
from flask import url_for
|
|
|
|
|
from . util import live_server_setup
|
|
|
|
|
from .util import live_server_setup, wait_for_all_checks
|
|
|
|
|
|
|
|
|
|
from ..html_tools import *
|
|
|
|
|
|
|
|
|
@ -164,6 +164,7 @@ def test_check_xpath_text_function_utf8(client, live_server):
|
|
|
|
|
assert b'Deleted' in res.data
|
|
|
|
|
|
|
|
|
|
def test_check_markup_xpath_filter_restriction(client, live_server):
|
|
|
|
|
live_server_setup(live_server)
|
|
|
|
|
sleep_time_for_fetch_thread = 3
|
|
|
|
|
|
|
|
|
|
xpath_filter = "//*[contains(@class, 'sametext')]"
|
|
|
|
@ -183,7 +184,7 @@ def test_check_markup_xpath_filter_restriction(client, live_server):
|
|
|
|
|
assert b"1 Imported" in res.data
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
# Goto the edit page, add our ignore text
|
|
|
|
|
# Add our URL to the import page
|
|
|
|
@ -195,7 +196,7 @@ def test_check_markup_xpath_filter_restriction(client, live_server):
|
|
|
|
|
assert b"Updated watch." in res.data
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
# view it/reset state back to viewed
|
|
|
|
|
client.get(url_for("diff_history_page", uuid="first"), follow_redirects=True)
|
|
|
|
@ -206,7 +207,7 @@ def test_check_markup_xpath_filter_restriction(client, live_server):
|
|
|
|
|
# Trigger a check
|
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
|
time.sleep(sleep_time_for_fetch_thread)
|
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
res = client.get(url_for("index"))
|
|
|
|
|
assert b'unviewed' not in res.data
|
|
|
|
|