Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Disable new tab background for tests #9489

Merged
merged 1 commit into from
Jun 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ You can run a subset of tests which match a `description` or `it` with:

Where `expression` could be for example `^tabs` to match all tests which start with the word tabs. This works for all testing modes (test, unittest).

## Things you should know

### Background image for new tab page is disabled by default

To speed-up tests, background image for new tab page is disabled by default. If your new webdriver test needs the background to be visible you'll need to enable this setting again, for example:

```js
it('shows new tab page background', function * () {
yield this.app.client
// enable setting again:
.changeSetting('tabs.show-dashboard-images', true)
// keep testing...
})
```

## Best practices for writing tests

- If you do anything that opens a new tab, you have to validate that the tab has opened before trying to switch to
Expand Down
2 changes: 2 additions & 0 deletions js/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const webFrame = electron.webFrame
const windowStore = require('./stores/windowStore')
const appStoreRenderer = require('./stores/appStoreRenderer')
const windowActions = require('./actions/windowActions')
const appActions = require('./actions/appActions')
const messages = require('./constants/messages')
const Immutable = require('immutable')
const patch = require('immutablepatch')
Expand All @@ -46,6 +47,7 @@ if (process.env.NODE_ENV === 'test') {
windowActions,
windowStore
}
appActions.changeSetting('tabs.show-dashboard-images', false)
}

ipc.on(messages.APP_STATE_CHANGE, (e, action) => {
Expand Down