-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Localization Tests
These steps are designed to walk you through almost every piece of the Brackets UI. This is especially valuable when working on localization since it lets you see every string in the context it's used in.
Using Symbolic links, you can test your localization directly in the APP. (Sprint version 26.)
# In Terminal.
# Assuming you have Brackets Sprint installed into your Applications folder
$ cd /Applications/Brackets\ Sprint\ 26.app/Contents/www/nls/
# ln -s source_file/directory target_file/directory
# Change "lang" with your localization.
$ ln -s lang ~/path/to/forked/project/brackets/src/nls/lang/
# Default (root) - Fallback for language, you may change the strings.js file.
# Add your language to the LANGUAGE_xx: "Language" dict.
$ ln -s root ~/path/to/forked/project/brackets/src/nls/root/
# string.js - With your localization specified.
$ ln -s strings.js ~/path/to/forked/project/brackets/src/nls/lang/strings.js
NOTE 1: Does file already exist in the /Applications/Brackets Sprint 26.app/Contents/www/nls/
folder, you will have to delete it first, before writing your symbolic link. (ln -s) You can also use ls -la
to see were your symbolic links are pointed to.
NOTE 2: This isn't meant to overtake the "Notes for testing," only meant as another way to watch how your language looks like in the Brackets APP. This way you can simply CMD+R (if you use Brackets to make your localization) every time you save the lang/strings.js
file. To see your stuff in action as is.
- Clone the brackets git repository to your local machine. The repo contains test used for these localization tests.
-
citrus completed
test project: https://github.com/adobe/brackets/tree/master/test/smokes/citrus%20completed -
server-smokes
test project: https://github.com/adobe/brackets/tree/master/test/smokes/server-smokes - To setup each test, load the
citrus completed
project viaFile > Open folder...
- Placeholders for screenshots are written as
<image_filename_placeholder>
- To open files from the project panel (i.e. to add them to the working set), double-click on the file.
Note: Debug menu is not tested
- Top Level
- File
- Edit
- Find
- View
- Navigate
- Help
- Lightning bolt icon tooltip
<tooltip_live_preview>
- Extension Manager
- On Mac,
Brackets > About Brackets
. On Windows,Help > About Brackets
- Confirm about dialog text
<dialog_about>
- Click
View > Hide Sidebar
menu - Open the
View
menu again - Confirm the label has changed to
View > Show Sidebar
<menu_view_show_sidebar>
- Click
View > Show Sidebar
- Open
index.html
. In the Sidebar, click the gear icon in the Working Files header. Confirm the sort methods. - In the Sidebar, click the Split icon at the top. Confirm the Split View options.
- Click
File > Open...
menu - Confirm file open dialog
<dialog_file_open>
- Choose
Cancel
- Click
File > Open Folder...
menu - Confirm open folder dialog
<dialog_folder_open>
- Click
Navigate > Quick Open
- Confirm the quick open UI appears at the top of the editor
<dialog_quick_open>
On Windows, we have a backlog item to address the lack of an error message https://trello.com/c/lSdnZmBc
- In the project tree, expand the
images
folder. - Click on
events.jpg
- Confirm error message
<dialog_error_opening_file>
- Click
File > New
menu - Confirm
untitled.js
editable file name <project_panel_untitled_file> - Rename
untitled.js
tofoo:js
- Confirm error message
<dialog_error_invalid_file_name>
- Select
index.html
- Click
File > New
menu - Rename
untitled.js
toindex.html
- Confirm error message
<dialog_error_file_already_exists>
- Open
index.html
- Make any change
- Click
File > Close
menu - Confirm dialog
<dialog_save_changes_one_file>
- Choose
Cancel
- From the project tree, open
desktop.css
- Make any change
- Click
File > Quit
menu - Confirm dialog
<dialog_save_changes_multiple_files>
- Choose
Cancel
- In the operating system, delete
desktop.css
- Return to Brackets
- Confirm the external changes dialog
<dialog_external_changes_deleted>
- Choose
Close (Don't Save)
- In the operating system, restore
desktop.css
Note: These tests assume that Brackets does not update the project tree when files are added and removed. Since these tests require changes to the file system, it is recommended to work with a separate copy of the citrus completed
project and to close and restart Brackets for each test.
- In the operating system, remove write permissions from the
css
directory. On Mac, usechmod 444 css
. On Windows, open the file properties dialog. Under "Security", click "Edit...". Choose your user account, then check the "Deny" checkbox for the "Write" permission. Save permission changes when finished. - In Brackets, select the
css
directory in the project tree. - Click
File > New
menu - Hit Enter to accept the default name
- Confirm error creating file dialog
<dialog_error_creating_file_no_modifications>
- In the operating system, restore the original permissions to the
css
directory
- In the operating system, remove write permissions from
index.html
. On Mac, usechmod 444 index.html
. On Windows, open the file properties dialog. Under "Security", click "Edit...". Choose your user account, then check the "Deny" checkbox for the "Write" permission. Save permission changes when finished. - In Brackets, open
index.html
- Make any edit to the file
- Click
File > Save
menu - Confirm error saving file dialog
<dialog_error_saving_file_no_modifications>
- In the operating system, restore the original file permissions to
index.html
- In the operating system, remove read permissions from
index.html
. On Mac, usechmod 0 index.html
. On Windows, open the file properties dialog. Under "Security", click "Edit...". Choose your user account, then check the "Deny" checkbox for the "Read" permission. Save permission changes when finished. - In Brackets, open
index.html
- Confirm error opening file dialog
<dialog_error_opening_file_not_readable>
- In the operating system, restore the original file permissions to
index.html
- In Brackets, open
index.html
- Make any edit, do not save. A dirty dot should appear in the working set next to the file and in the toolbar next to the file name.
- Open
index.html
in a different program. - Dirty the file so that the last modified time metadata is updated
- Return to Brackets
- Confirm dialog
<dialog_external_changes_reload>
- In the operating system, remove read permissions from
index.html
. On Mac, usechmod 0 index.html
. On Windows, open the file properties dialog. Under "Security", click "Edit...". Choose your user account, then check the "Deny" checkbox for the "Read" permission. Save permission changes when finished. - Return to Brackets
- Choose
Reload from Disk
- Confirm dialog
<dialog_error_reloading_changes_from_disk>
- Choose
OK
and confirm the file in Brackets is still dirty - In the operating system, restore the original file permissions to index.html
- Open
index.html
in a text editor that allows saving with a different encoding (e.g. Sublime Text 2) - In the text editor save
index.html
with encoding: UTF-16 BE with BOM - Return to Brackets
- Open
index.html
- Confirm dialog
<dialog_error_reloading_changes_from_disk_generic_error_code_2>
- Choose
OK
- In the text editor save
index.html
restore the original UTF-8 encoding
- In Brackets, close
index.html
if open - In the operating system, delete
index.html
- In Brackets,
index.html
is still listed. - Attempt to open
index.html
- Confirm error opening file dialog
<dialog_error_opening_file_file_not_found>
- In the operating system, restore
index.html
- In Brackets, collapse all folders (only
css
,images
andindex.html
should be visible in the tree) - Quit and restart Brackets
- In the operating system, delete the
images
directory - Attempt to open the
images
directory - Confirm error loading project dialog
<dialog_error_loading_project_directory_contents>
- In the operating system, restore the
images
directory
- With
citrus completed
as the current project, quit Brackets - In the operating system, rename the
citrus completed
directory tofoo
- Open Brackets
- Confirm the error loading project dialog
<dialog_error_loading_project_request_nfs>
- In the operating system, restore the original directory name to
citrus completed
- Open
index.html
- Click
Find > Find
menu - Confirm find UI appears at the top of the editor
<dialog_find>
- Press escape
- Click
Find > Replace
menu - Confirm replace UI appears at the top of the editor
<dialog_replace_1>
- Type any character(s) into the text box, press Enter
- Confirm replace UI appears at the top of the editor
<dialog_replace_2>
- Type a search string that actually exists in the open document. Click
Batch..
- Confirm Replace matches UI appears at the bottom of the editor. Click the 'X' to close the UI.
- Click
Find > Find in Files
- Confirm find UI appears at the top of the editor.
- Click
No Files Excluded
button. Confirm exclusion set menu dropdown. - From that menu, click
New Exclusion Set...
. Confirm Edit Exclusion Set dialog appears. - Click
Cancel
to close the dialog. - Click
Find > Replace in Files
menu. - Confirm replace in files UI appears at the top of the editor.
- Type a search string that actually exists in the open document. Click
Replace...
- Confirm Replace in files matches UI appears at the bottom of the editor. Click the 'X' to close the UI.
- Press escape to close the Replace in Files bar.
- Click
Find > Find in Select File/Folder
- Confirm Find in selected location UI appears at the top of the editor.
- Press escape to close the Find bar.
- Click
Find > Replace in Select File/Folder
- Confirm Replace in selected location UI appears at the top of the editor.
- Press escape to close the Replace bar.
- Place cursor randomly inside a file (like html,js,json,c,etc.).
- Click
View > Collapse Current
- Confirm that the innermost block (that the current location belongs to) gets collapsed.
- Click
View > Expand Current
- Confirm that the innermost block (that the current location belongs to) gets expanded.
- Click
View > Collapse All
- Confirm that all blocks of code in the file get collapsed. Inner blocks will be hidden inside outer ones.
- Click
View > Expand All
- Confirm that all blocks of code get expanded.
- Enable
View > Enable JSLint
(a checkmark will appear when enabled) - Confirm JSLint panel title
<panel_jslint>
- Open
desktop.css
- Place the cursor on any hex color, e.g. #000. Press
CMD+E
orCtrl+E
- In the saturation/luminosity, select a new contrasting color
- Hover over the current color swatch (the new chosen color). Confirm tooltip
<current_color>
. - Hover over the original color swatch (the original color). Confirm tooltip
<original_color>
. - Hover over each button in the button bar that contains (RGBa, HEX, HSLa). Confirm tooltips
<rgba_format>
,<hex_format>
and<hsla_format>
. - Hover over one of the colors listed on the right. Confirm tooltop
<color_used_n_times>
.
- At the end of
desktop.css
, add the following line:#div2 {transition-timing-function: cubic-bezier();}
. - Place the cursor on the word
timing
in the new line. PressCMD+E
orCtrl+E
. Confirm labels on grid, and information text on right.
- At the end of
desktop.css
, add the following line:#div3 {transition-timing-function: steps();}
. - Place the cursor on the word
timing
in the new line. PressCMD+E
orCtrl+E
. Confirm labels on grid, and information text on the right.
- Within the first
<body>
tag ofindex.html
, start a new line and type<h10
. - Press
CMD+E
orCtrl+E
. Confirm New Rule inline editor appears. - Click
New Rule
. Confirm inline editor changes to show the new rule definition. - Click
New Rule
button again. Confirm a list of references to the new rule appears on the right-side of the inline editor. - Press escape to close the inline editor.
- Open
index.html
, place cursor at end of any line. - Press
CMD+E
orCtrl+E
. Confirm popover message appears with "No Quick Edit available for current cursor position", and messages fades away after 5 seconds. - Place cursor in
href
attribute of any<a>
tag. - Press
CMD+E
orCtrl+E
. Confirm popover message appears with "CSS Quick Edit: place cursor in tag, class, or id".
- Click
Help > Health Report
. - Confirm that the Brackets Health Report dialog comes up.
- Confirm that it shows the option to enable/disable sharing data.
- Also confirm that it shows the data that would be sent if sharing is enabled.
NOTE: Health Data pop up appears for the very first launch of Brackets (v1.3 onwards).
- Open
desktop.css
, place cursor in any CSS Property (e.g. "font-family"). - Press
CMD+K
orCtrl+K
. Confirm Quick Docs Viewer is opened with information for the chosen CSS Property. - Press
Esc
to close. - Place cursor at end of any line.
- Press
CMD+K
orCtrl+K
. Confirm popover message appears with "No Quick Docs available for current cursor position", and messages fades away after 5 seconds.
Requires Google Chrome to be installed http://www.google.com/chrome
- Exit Chrome if it is running.
- Open
index.html
- Click
File > Live Preview
menu - [First launch only] Confirm
Welcome to Live Preview!
dialog appears. Click OK. - In Brackets, hover over the lightning bold icon
- Confirm tooltip
<tooltip_disconnect_live_file_preview>
- Quit Chrome
- Start Chrome
- Click
File > Live Preview
menu - Confirm live preview error dialog
<dialog_live_development_connection_error>
- Click
Cancel
- Open
css\desktop.css
- Click
File > Live Preview
menu - If there is a file named
index.html
(orindex.htm
), in same folder or parent folder within project, it will be opened. - Otherwise, confirm live preview error dialog
<dialog_live_development_file_type_error>
- Close Chrome if running
- Rename the Chrome executable
- Open
index.html
- Click
File > Live Preview
menu - Confirm live preview error dialog
<dialog_live_development_chrome_not_found>
- Restore the Chrome executable name
- Open the
server-smokes
project File > Project Settings...
- Confirm project settings dialog
<project_settings_dialog>
- Open
server.php
File > Live Preview
- Confirm project settings dialog appears with warning message
<project_settings_specify_base_url>
- Enter
ftp://path/to/foo
(does not have to be a functioning path) - Confirm error message
<project_settings_error_invalid_protocol>
- Enter
http://path/to?foo
- Confirm error message
<project_settings_error_search_disallowed>
- Enter
http://path/to#foo
- Confirm error message
<project_settings_error_hash_disallowed>
- Enter
http://path to foo
- Confirm error message
<project_settings_error_invalid_char>
The following tests configure fake updates for testing Help > Check for Updates
. Update information is normally pulled from http://brackets.io.
- Click
Debug > Show Developer Tools
to open dev tools window (if Debug is not available, open Chrome, go to http://localhost:9234, then choose the last link) - Click the
Sources
tab at the top of the dev tools window - If the script console is hidden, press
esc
to open the console - In the console window, enter:
require("utils/UpdateNotification").checkForUpdate(true, {_buildNumber: 0, _lastNotifiedBuildNumber: 0})
- Confirm update information dialog appears
<dialog_update_notification_up_to_date>
- In the console window, enter:
require("utils/UpdateNotification").checkForUpdate(true, {_buildNumber: 0, _lastNotifiedBuildNumber: 0, _versionInfoURL: "https://raw.github.com/adobe/brackets/master/test/spec/UpdateNotification-test-files/versionInfo.json"})
- Confirm update information dialog appears
<dialog_update_notification_update_available>
(Note that the actual notes of each release are not translated in this test file) - Press Cancel
- Hover over the update icon (a gift box) in the toolbar
- Confirm update information tooltip appears
<tooltip_update_notification>
-
File > Extension Manager...
Confirm Extension Manager dialog appears. - From the Available tab, click
Install from URL...
. Confirm Install Extension dialog appears. - Paste this URL https://github.com/adobe/brackets/raw/master/test/spec/extension-test-files/incompatible-version.zip and press Install
- Confirm error message appears in dialog
<install_extension_incompatible_version>
. ClickClose
. - Click Installed tab. Confirm either
No extensions installed yet.
message appears in the dialog, or, if you've previously installed one or more extensions, that they are listed. - Click
Close
-
View > Themes...
Confirm Themes dialog appears - Change Current Theme, confirm colors in Editor change
- Click Cancel, confirm editor colors revert to original colors
View > Split Vertically
- Edit 2 files in side by side panes. There are now 2 working sets named Left and Right
View > Split Horizontally
- Edit 2 files one above the other. The working sets are named Top and Bottom
- Drag separator to change pane sizes.
- In Sidebar, drag a file from one working set to the other to switch panes.
-
View > No Split
- to return to editing a single file
-
Debug > Open User Key Map
. - Delete
}
on the last line and save the file. - Confirm the title and the error message in the dialog.
-
Debug > Open User Key Map
. - Right click on keymap.json in the working set and select Show in Finder/Explorer from context menu.
- Copy an image file in Finder/Explorer and replace keymap.json. i.e rename your image file to keymap.json after copying.
- Back in Brackets keymap.json may no longer be showing in the workint set. So
Debug > Open User Key Map
again. - Verify the title and the error message in the dialog.
- Delete the fake keymap.json in Finder/Explorer.
-
Debug > Open User Key Map
. - Paste
"cmd-w": "edit.copy"
or"Ctrl-w": "edit.copy"
to the empty line inside the"overrides"
block. - Save the file and verify that you get the correct error message.
-
Debug > Open User Key Map
. - Paste
"cmd-c": "edit.selectLine"
or"Ctrl-C": "edit.selectLine"
to the empty line inside the"overrides"
block. - Save the file and verify that you get the correct error message.
- On Mac, you can also test with
"Cmd-Q"
,"Cmd-H"
or"Cmd-M"
in step 2.
"ctrl-W": "edit.selectLine",
"Ctrl-o": "edit.selectLine"
-
Debug > Open User Key Map
. - Paste the above key bindings and replace the content inside the
"overrides"
block. - Save the file and verify that you get the correct error message.
"ctrl-W": "edit.selectLine",
"Ctrl-w": "edit.lineComment",
"ctrl-w": "edit.selectLine"
-
Debug > Open User Key Map
. - Paste the above key bindings and replace the content inside the
"overrides"
block. - Save the file and verify that you get the correct error message.
"Command-W": "edit.selectLine",
"Control-w": "edit.lineComment",
"ctrl-pageup": "edit.blockComment"
-
Debug > Open User Key Map
. - Paste the above key bindings and replace the content inside the
"overrides"
block. - Save the file and verify that you get the correct error message.
"ctrl-o": "edit.NotACommand",
"Ctrl-w": "edit.noComment",
"ctrl-i": "test.blockComment"
-
Debug > Open User Key Map
. - Paste the above key bindings and replace the content inside the
"overrides"
block. - Save the file and verify that you get the correct error message.