To run the Translations test suite you would run the following command: ``` mach test browser/components/translations/tests toolkit/components/translations/tests ``` That runs all of the tests in our two paths where we keep Translations tests. You can add the `--headless` flag to disable the GUI and only run them in the terminal, if you want. But you'll also need to add a new test to test this PDF behavior. Just grabbing a blank PDF file should be fine. It looks like one already exists in tree: https://searchfox.org/mozilla-central/search?q=empty_pdf_file&path=&case=false®exp=false You'll need to copy this file and add it as a support file in our test code. Follow `translations-tester-es.html` as an example. You'll need to add the pdf file in similar places: https://searchfox.org/mozilla-central/search?q=translations-tester-es.html&path=&case=false®exp=false Then you will need to add a new test file itself which navigates to a PDF page and ensures that the Translations icon does not appear, and that the option to translations the page is disabled in the app menu. We have a lot of helper functions in `head.js` to help with this. Please look at the way the other tests work, and model a new test after those. When you add a new test file, you'll have to enable it in `brwoser.toml`. You can run a specific test (instead of the entire test suite) by typing a test name specifically. For example if I wanted to run the test file `browser_translations_panel_switch_languages.js` I could just invoke: ``` ./mach test panel_switch_lang ``` since `panel_switch_lang` is a substring of that file name.
Bug 1837072 Comment 8 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
To run the Translations test suite you would run the following command: ``` mach test browser/components/translations/tests toolkit/components/translations/tests ``` That runs all of the tests in our two paths where we keep Translations tests. You can add the `--headless` flag to disable the GUI and only run them in the terminal, if you want. But you'll also need to add a new test to test this PDF behavior. Just grabbing a blank PDF file should be fine. It looks like one already exists in tree: https://searchfox.org/mozilla-central/search?q=empty_pdf_file&path=&case=false®exp=false You'll need to copy this file and add it as a support file in our test code. Follow `translations-tester-es.html` as an example. You'll need to add the pdf file in similar places to make it available from `shared-head.js`: https://searchfox.org/mozilla-central/search?q=translations-tester-es.html&path=&case=false®exp=false Then you will need to add a new test file itself which navigates to a PDF page and ensures that the Translations icon does not appear, and that the option to translations the page is disabled in the app menu. We have a lot of helper functions in `head.js` to help with this. Please look at the way the other tests work, and model a new test after those. When you add a new test file, you'll have to enable it in `brwoser.toml`. You can run a specific test (instead of the entire test suite) by typing a test name specifically. For example if I wanted to run the test file `browser_translations_panel_switch_languages.js` I could just invoke: ``` ./mach test panel_switch_lang ``` since `panel_switch_lang` is a substring of that file name.