From c7c6c105af5ea2afb5f8a200c923e33cf805d1dc Mon Sep 17 00:00:00 2001 From: Trawlnetter <250747469+Trawlnetter@users.noreply.github.com> Date: Sun, 21 Dec 2025 04:14:01 +0000 Subject: [PATCH 1/3] Update README.md for Selenium tests Update the README to reflect new changes to the compatibility of the Selenium IDE addon with Firefox and Chrome, and add new instructions. --- test/README.md | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/test/README.md b/test/README.md index 81cc557b..3c1a9653 100644 --- a/test/README.md +++ b/test/README.md @@ -4,27 +4,37 @@ This is the [Selenium IDE](https://www.selenium.dev/selenium-ide/) automated bro ## Preparing Your Own Testing Environment -Selenium IDE is currently available as a Firefox Browser Add-On and as a Chrome Browser Extension. Select one, or both, depending on which browser you are interested in testing. +The Selenium IDE addon is currently available for Firefox Browser only, though there are ways to run tests on Chrome Browser. Select one browser, or both browsers, depending on which browser you are interested in testing. ### Firefox Installation -1. Open Firefox and navigate to the download page for the [Firefox Browser Selenium IDE Add-On](https://addons.mozilla.org/en-GB/firefox/addon/selenium-ide/). -1. Follow the instructions for installing the add-on. +1. Open Firefox and install the [Firefox Browser Selenium IDE Add-On](https://addons.mozilla.org/en-GB/firefox/addon/selenium-ide/). +2. You will have to install an extension that disables CSP, such as [Disable CSP and CORS](https://addons.mozilla.org/en-US/firefox/addon/disable-csp-and-cors/), for the tests to work. Be warned that having this extension enabled comes with security risks, but without it, you will get a "call to eval() blocked by CSP" error. You may want to create a [new Firefox profile](https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles) for Selenium testing. + +#### Opening and Running Tests in Firefox + +1. Start up your local development version of the IFDB. +2. Open the browser of your choice and click on the Selenium IDE icon in the upper right corner. +3. In the pop up dialog, select `Open an existing project`. +4. Open `./IFDB.side`. +5. Select `Test suites` from the drop down menu on the upper left corner of the application. +6. Select any of the available test suites and tests. +7. To run the currently selected test, click on the `Run current test` button. +8. To run all of the tests in the suite, click on the `Run all tests in suite button`. + +For information about using the Selenium IDE, see: https://www.selenium.dev/selenium-ide/docs/en/introduction/getting-started. ### Chrome Installation -1. Open Chrome and navigate to the Chrome Web Store for the [Chrome Browser Selenium IDE Extension](https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd). -1. Follow the instructions for installing the extension. +As of December 2025, the [Chrome Browser Selenium IDE Extension](https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd) has been disabled by Google and can no longer be installed. -### Opening and Running Tests +You can download an alternative extension such as [Ui.Vision](https://chromewebstore.google.com/detail/uivision/gcbalfbdmfieckjlnblleoemohcganoc). -1. Start up your local development version of the IFDB. -1. Open the browser of your choice and click on the Selenium IDE icon in the upper right corner. -1. In the pop up dialog, select `Open an existing project`. -1. Open `./IFDB.side`. -1. Select `Test suites` from the drop down menu on the upper left corner of the application. -1. Select any of the available test suites and tests. -1. To run the currently selected test, click on the `Run current test` button. -1. To run all of the tests in the suite, click on the `Run all tests in suite button`. +For Ui.Vision: -For information about using the Selenium IDE, see: https://www.selenium.dev/selenium-ide/docs/en/introduction/getting-started. +1. Open the extension and click the settings gear icon in the upper right. +2. Click the `Selenium` tab, then click the `Import .SIDE projects` button. +3. Open `./IFDB.side`. +4. Find the IFDB folder on the left. +5. To run an individual test, select it in the left menu and click on the `Play macro` button in the upper right. +6. To run all of the tests in the suite, right click the IFDB folder on the left and click `Testsuite: Play all in folder`. From 77ae2cdd0c8089acd564fb52a4d7b1cc6f2208ea Mon Sep 17 00:00:00 2001 From: Trawlnetter <250747469+Trawlnetter@users.noreply.github.com> Date: Sun, 21 Dec 2025 04:18:03 +0000 Subject: [PATCH 2/3] Fix and rename broken Selenium test case The first Selenium test case didn't work, presumably because it relied on links in the top bar that no longer exist when the user is logged out. I fixed the test case by making it access the webpages for those links directly. It was checking that a logged-out user wouldn't be able to access any of them, and I kept that in, but the test case no longer uses the top bar to navigate. I renamed the test to "Top Bar When Logged Out" in fitting with its new purpose. --- test/IFDB.side | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/test/IFDB.side b/test/IFDB.side index ec27eaf0..aeccc10c 100644 --- a/test/IFDB.side +++ b/test/IFDB.side @@ -5,7 +5,7 @@ "url": "http://localhost:8080/", "tests": [{ "id": "fdc09b91-3859-48da-8bec-15cab03aea43", - "name": "001 Top Bar Navigation", + "name": "001 Top Bar When Logged Out", "commands": [{ "id": "4b6816e3-66ac-4647-afae-9fc66a700e52", "comment": "", @@ -38,14 +38,7 @@ "id": "b5a35547-95ab-4d9e-91df-9745906f2339", "comment": "", "command": "open", - "target": "http://localhost:8080/", - "targets": [], - "value": "" - }, { - "id": "eec82b88-800a-45c6-8f89-91229cd714b2", - "comment": "", - "command": "click", - "target": "id=topbar-profile", + "target": "http://localhost:8080/showuser", "targets": [], "value": "" }, { @@ -59,14 +52,7 @@ "id": "c5965ef1-d237-416b-80b1-c0f3cd655061", "comment": "", "command": "open", - "target": "http://localhost:8080/", - "targets": [], - "value": "" - }, { - "id": "f8a8de9e-70f9-473e-8e57-6c6251c245cc", - "comment": "", - "command": "click", - "target": "id=topbar-edit", + "target": "http://localhost:8080/editprofile", "targets": [], "value": "" }, { @@ -80,14 +66,7 @@ "id": "fbf6a986-8717-4982-846f-89d55c23bf24", "comment": "", "command": "open", - "target": "http://localhost:8080/", - "targets": [], - "value": "" - }, { - "id": "476860de-489a-4fba-b309-b0d9d58a067f", - "comment": "", - "command": "click", - "target": "id=topbar-personal", + "target": "http://localhost:8080/personal", "targets": [], "value": "" }, { @@ -101,14 +80,7 @@ "id": "8522f8b9-b870-4d7f-a153-ad0a2f4f4b25", "comment": "", "command": "open", - "target": "http://localhost:8080/", - "targets": [], - "value": "" - }, { - "id": "d964101f-b852-4279-a976-eb2036c8172e", - "comment": "", - "command": "click", - "target": "id=topbar-inbox", + "target": "http://localhost:8080/commentlog?mode=inbox", "targets": [], "value": "" }, { @@ -150,7 +122,7 @@ "id": "21994d43-f076-48e5-9021-03d72e953555", "comment": "", "command": "click", - "target": "id=topbar-search", + "target": "id=topbar-search-go-button", "targets": [], "value": "" }, { @@ -371,4 +343,4 @@ }], "urls": ["http://localhost:8080/"], "plugins": [] -} +} \ No newline at end of file From 8377d66bc3129c01b63f7d97e35f09afd39658e7 Mon Sep 17 00:00:00 2001 From: Trawlnetter <250747469+Trawlnetter@users.noreply.github.com> Date: Tue, 23 Dec 2025 04:12:17 +0000 Subject: [PATCH 3/3] Fix typo in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6a32138..a96363db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,6 @@ * When creating pull requests, target the `main` branch. Please rebase your PRs and keep each commit small and focused. It's OK to have a big PR, as long as each commit in the PR is small, but smaller PRs are better, if feasible. * It's OK to file a PR that only partially works, just to begin discussion about the code. -* We have a few Selenium tests in the `tests` directory. Please don't break the tests! +* We have a few Selenium tests in the `test` directory. Please don't break the tests! * This is PHP, so we need to be particularly careful about [XSS](https://owasp.org/www-community/attacks/xss/) bugs. * [SQL injections](https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html) are also a major risk.