From ba5ac92b004fbba1704661a651c179e27523be5a Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Fri, 6 Jul 2018 10:32:59 -0400 Subject: [PATCH 1/2] Adjust how smoke tests are called in package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a299c2442..6b1315452 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "stop": "make stop", "test": "make test", "smoke": "tap ./test/integration/smoke-testing/*.js --timeout=3600", - "smoke-verbose": "make smoke-verbose", - "smoke-sauce": "tap ./test/integration/smoke-testing/*.js --timeout=60000", + "smoke-verbose": "tap ./test/integration/smoke-testing/*.js --timeout=3600 -R spec", + "smoke-sauce": "SMOKE_REMOTE=true tap ./test/integration/smoke-testing/*.js --timeout=60000", "watch": "make watch", "build": "make build", "dev": "make watch && make start &" From 2bb898788faaad72391d11ce3cb69349d612fea3 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Fri, 6 Jul 2018 10:33:40 -0400 Subject: [PATCH 2/2] Update Intergration README to have Saucelabs info --- test/integration/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/integration/README.md b/test/integration/README.md index b835a47b0..251e5d29a 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -9,16 +9,27 @@ # 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 make smoke` +* 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 +| `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.