scratch-www/test
seotts 604238d1a0 Revert "Merge pull request #6731 from LLK/studios-rtl"
This reverts commit 830a2e3ebf, reversing
changes made to 1a2d1db3a1.
2022-04-13 16:17:49 -04:00
..
__mocks__ mock MediaQuery 2019-08-18 04:47:06 +02:00
helpers Accept studio "host" from api; use "host" in state 2021-09-17 15:50:16 -04:00
integration Fix conference integration test 2022-03-16 11:51:23 -04:00
integration-legacy Merge pull request #6295 from BryceLTaylor/convert-Tap-to-Jest-Statistics 2021-11-15 10:54:24 -05:00
localization Add Jest, Enzyme, and sample tests 2019-07-17 15:27:13 -04:00
localization-legacy Remove obsolete test 2020-05-04 08:36:59 -04:00
unit Revert "Merge pull request #6731 from LLK/studios-rtl" 2022-04-13 16:17:49 -04:00
unit-legacy Forward fix for regression introduced by changing the number of replies we fetch. This change updates the number of comment replies we fetch on project comments from 20 to 25 to be consistent with studio page. Also updates the code that controls whether to display the 'See more replies' button on comment threads. 2022-01-12 14:45:20 -05:00
.eslintrc.js Enable react linting and move test file to .jsx instead of .js. 2019-08-01 16:16:42 -04:00
README.md Run Jest tests alongside Tap tests 2019-07-17 15:33:01 -04:00

Requirements

  • Selenium
    • See this directory's package.json
  • TAP
    • In the scratch-www repo's package.json
  • Chromedriver

Running the tests

  • By default, tests run against our Staging instance, but you can pass in a different location if you want to run the tests against e.g. your local build
  • Tests can be run using Saucelabs, an online service that can test browser/os combinations remotely. Currently all tests are written for use for chrome on mac.

Using tap

  • Run all tests in the smoke-testing directory from the command-line: $ SMOKE_USERNAME=username SMOKE_PASSWORD=password ROOT_URL=https://scratch.mit.edu npm run smoke
  • To run a single file from the command-line: $ SMOKE_USERNAME=username SMOKE_PASSWORD=password ROOT_URL=https://scratch.mit.edu node_modules/.bin/tap ./test/integration/smoke-testing/filename.js --timeout=3600
    • The timeout var is for the length of the entire tap test-suite; if you are getting a timeout error, you may need to adjust this value (some of the Selenium tests take a while to run)
  • To run tests using saucelabs run this command $ SMOKE_USERNAME=username SMOKE_PASSWORD=password SAUCE_USERNAME=saucelabsUsername SAUCE_ACCESS_KEY=saucelabsAccessKey ROOT_URL=https://scratch.mit.edu npm run smoke-sauce

Configuration

Variable Default Description
ROOT_URL scratch.ly Location you want to run the tests against
SMOKE_USERNAME None Username for Scratch user you're signing in with to test
SMOKE_PASSWORD None Password for Scratch user you're signing in with to test
SMOKE_REMOTE false Tests with Sauce Labs or not. True if running smoke-sauce
SMOKE_HEADLESS false Run browser in headless mode. Flaky at the moment
SAUCE_USERNAME None Username for your Sauce Labs account
SAUCE_ACCESS_KEY None Access Key for Sauce Labs found under User Settings

Using Saucelabs

  • You will need a Saucelabs account in order to use it for testing. To find the Access Key, click your username and select User Settings from the dropdown menu. Near the bottom of the page is your access key that you can copy and use in the command line.