Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Brackets Server Smoke Tests
This set of Smoke Tests exercise Brackets code that requires a server. As with the main set of Smoke Tests, the intention is to keep it quick--if it takes more than 5 minutes to run the tests on a given platform (not including the initial setup time) then it's too long.
If you have trouble running through it or something is unclear, please post to the brackets-dev mailing list.
Server Setup (Mac/Windows)
You will need an HTTP and PHP server for these tests. Options are:
- Setup a local server (e.g. wamp/mamp).
- Use built-in server on Mac:
a. (OSX 10.7 and earlier) Turn on web server: System Preferences > Sharing > Web Sharing: On
b. Turn on PHP server: Edit /etc/apache2/httpd.conf, uncomment following line:
#LoadModule php5_module libexec/apache2/libphp5.so
c. Server root folder: /Library/WebServer/Documents/
d. (OSX 10.8 and later) Start (or restart) apache: run
sudo apachectl startin a terminal window (use
restartif already running)
- Use a remote server with drive mapped to local machine.
- Sprint 21: Brackets has node js built-in with an HTTP server plugin. Any project folder can be the server root. Note that this server does not support PHP, so the .php cannot be viewed, but all of the tests in that section can be run using one of the .html pages.
Server Setup (Linux)
Make sure you have the latest updates to Linux
NOTE: You only need to do this if you haven't already installed LAMP
sudo apt-get update
Install the LAMP stack if you haven't already
sudo apt-get install lamp-server^ (Mind the caret [^] that the end)
Copy the server tests and launch Brackets
cd /var/www/html sudo cp -r ~/brackets/test/smokes/server-tests . gksudo "/opt/brackets/brackets"
Proceed to "Server smoke test steps" below.
- Follow Setup steps for main set of Smoke Tests.
- Copy the server-tests folder from brackets/test/smokes to server root, or run brackets/tools/setup_server_smokes script to create a symbolic link to the files. The server root folder will be something like c:\wamp (on Win) or /Library/Webserver/Documents (on Mac). On the Mac, you may need to run the script with "sudo" to have proper permissions.
Server smoke test steps
- Launch Brackets. Use File > Open Folder... and browse to the server root folder (or smoke tests folder [brackets/test/smokes] if you don't have a local server).
- Open the server-tests folder in the project tree and verify that you see pathRel.html, pathRoot.html, server.php files, and css & images folders.
- Select File > Project Settings... to invoke Project Settings dialog. If a Base URL is specified, delete it.
- Verify informational text is displayed in empty input field. Click Done.
- Open pathRel.html, start Live Preview using File > Live Preview.
- If you trashed prefs, you'll get an info dialog explaining how Live Preview works. Click OK.
- Verify that the base URL is 127.0.0.1: nnnnn (where nnnnn is an auto-generated port number) and page renders correctly in browser.
- Open File menu, verify Live Preview has a check mark next to it, then click it to toggle off Live Preview.
- Open pathRoot.html and click Live Preview (lightning bolt) icon on right side of menu bar.
- Verify that page is opened in browser and CSS, images (with site-relative paths) are rendered correctly. Click Live Preview icon to disconnect Live Preview.
- Open server.php and start Live Preview. Verify Project Settings dialog is invoked with warning message indicating a Base URL is required.
- Enter the URL that maps to the project on your server (e.g. http://localhost/). Click OK.
- Verify that page is opened in Chrome and the URL protocol is the same as in your URL Prefix (http: or https:) and page renders correctly in browser.
- In Brackets, set the cursor in the
<body>tag, hit Cmd/Ctrl-E, and verify that it shows a single body rule.
- Edit the background color for the tag in the inline editor (#D90 is a nice color). Verify that the color changes in Chrome as you type. Also verify that the CSS file is added to the working set with the dirty bit set.
- Hit Cmd/Ctrl-E. Verify that the inline editor closes.
- Make an edit to some text in HTML page that is visible in browser. Note: some text in the page is replaced by logo image via CSS (e.g. first h1 tag and first h2 tag) so edits will not be visible; try updating text in News section.
- Verify that text has not yet changed in browser (since Live HTML is not supported on external server). Use Cmd/Ctrl-S to save changes to HTML file. Verify that saved text changes and unsaved CSS changes are shown in browser.
- Disconnect Live Preview. Undo changes in HTML file and save to get back to original state.
- Close all files and discard changes.
- Select File > Project Settings... to set Base URL back to blank.