v1.2.0: Merge pull request #31 from Financial-Times/browser-tests
Browser Tests
Adds the ability to run some smoke tests against Saucelabs. This will work for tests with elements
checks only, and requires SAUCE_USER/SAUCE_KEY to be set.
Can be true
to run against default browsers, or an array of browsers.
{
"browsers": true,
"elements": {
'.js-success': true,
'.some-selector': 3
}
}
User Session/FT.com Test Host (experimental)
Adds a user
property, which gets and includes up-to-date session cookies for a type of user (standard, expired, premium).
For this to work/be useful, it needs to be run behind preflight/on ft.com. So with much hackery, these tests will run on www.ft.com with FT-Test-Host
set to the actual host being tested.
This will allow you to test features that usually require preflight or CORS. (e.g. myFT or Premium section on front page, messaging, onward journeys
Note: this is a bit of a faff to work locally. Firstly, it only works with an ngrok host. Secondly, by default only the initial request gets the header sent. For local development, you probably also want the __dev
URL to be proxied to your app. To do this, in your test include:
requestHeaderPaths: ['__dev']
.
This will also add request headers to paths matching __dev.
What else is up?
- Prettier output