Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
42 changes: 7 additions & 35 deletions test/IFDB.side
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": ""
}, {
Expand All @@ -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": ""
}, {
Expand All @@ -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": ""
}, {
Expand All @@ -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": ""
}, {
Expand Down Expand Up @@ -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": ""
}, {
Expand Down Expand Up @@ -371,4 +343,4 @@
}],
"urls": ["http://localhost:8080/"],
"plugins": []
}
}
40 changes: 25 additions & 15 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.