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

Commit

Permalink
Disable new tab background for tests
Browse files Browse the repository at this point in the history
Close #9240
  • Loading branch information
cezaraugusto committed Jun 19, 2017
1 parent 6478bcd commit b96f0b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
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

0 comments on commit b96f0b1

Please sign in to comment.