2023-11-13 15:39:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# run some tests and look if the 'custom-browser-search-string=1' connect string appeared in the correct containers
|
|
|
|
|
2024-02-10 23:09:12 +00:00
|
|
|
# @todo do it again but with the puppeteer one
|
|
|
|
|
2023-11-13 15:39:11 +00:00
|
|
|
# enable debug
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# A extra browser is configured, but we never chose to use it, so it should NOT show in the logs
|
2024-02-07 19:58:21 +00:00
|
|
|
docker run --rm -e "PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000" --network changedet-network test-changedetectionio bash -c 'cd changedetectionio;pytest tests/custom_browser_url/test_custom_browser_url.py::test_request_not_via_custom_browser_url'
|
2024-02-10 23:09:12 +00:00
|
|
|
docker logs sockpuppetbrowser-custom-url &>log-custom.txt
|
|
|
|
grep 'custom-browser-search-string=1' log-custom.txt
|
2023-11-13 15:39:11 +00:00
|
|
|
if [ $? -ne 1 ]
|
|
|
|
then
|
2024-02-10 23:09:12 +00:00
|
|
|
echo "Saw a request in 'sockpuppetbrowser-custom-url' container with 'custom-browser-search-string=1' when I should not - log-custom.txt"
|
2023-11-13 15:39:11 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-02-07 19:58:21 +00:00
|
|
|
docker logs sockpuppetbrowser &>log.txt
|
2023-11-13 15:39:11 +00:00
|
|
|
grep 'custom-browser-search-string=1' log.txt
|
|
|
|
if [ $? -ne 1 ]
|
|
|
|
then
|
|
|
|
echo "Saw a request in 'browser' container with 'custom-browser-search-string=1' when I should not"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Special connect string should appear in the custom-url container, but not in the 'default' one
|
2024-02-07 19:58:21 +00:00
|
|
|
docker run --rm -e "PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000" --network changedet-network test-changedetectionio bash -c 'cd changedetectionio;pytest tests/custom_browser_url/test_custom_browser_url.py::test_request_via_custom_browser_url'
|
2024-02-10 23:09:12 +00:00
|
|
|
docker logs sockpuppetbrowser-custom-url &>log-custom.txt
|
|
|
|
grep 'custom-browser-search-string=1' log-custom.txt
|
2023-11-13 15:39:11 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
2024-02-10 23:09:12 +00:00
|
|
|
echo "Did not see request in 'sockpuppetbrowser-custom-url' container with 'custom-browser-search-string=1' when I should - log-custom.txt"
|
2023-11-13 15:39:11 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-02-07 19:58:21 +00:00
|
|
|
docker logs sockpuppetbrowser &>log.txt
|
2023-11-13 15:39:11 +00:00
|
|
|
grep 'custom-browser-search-string=1' log.txt
|
|
|
|
if [ $? -ne 1 ]
|
|
|
|
then
|
|
|
|
echo "Saw a request in 'browser' container with 'custom-browser-search-string=1' when I should not"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|