forked from adobe/brackets
-
Notifications
You must be signed in to change notification settings - Fork 0
Brackets Server Smoke Tests
redmunds edited this page Feb 28, 2013
·
64 revisions
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.
You will need an HTTP and PHP server for these tests. Options are:
- Setup a local server (e.g. wamp/mamp/lamp).
- 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: runsudo apachectl start
in a terminal window (userestart
if 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. Note that this server does not support PHP, so that test cannot be run.
- 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.
- Launch Brackets. Use File > Open Folder... and browse to the server root folder.
- 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 OK.
- 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.
- Mac only: after a few seconds you should get a dialog saying you need to relaunch Chrome. Click "Relaunch". Chrome should relaunch and open the page.
- Verify that the URL protocol is file: 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, but with no CSS or images. 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 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. 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.
- Open pathRoot.html again, start Live Preview, and verify that CSS and images are now rendered. Turn off Live Preview and close file.
- Click on recent project dropdown list and use Project Settings... to set Base URL back to blank.