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

Commit

Permalink
Add tests for extensions getting installed
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Sep 19, 2016
1 parent 3e84d1e commit 999cb59
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/renderer/components/browserActionButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class BrowserActionButton extends ImmutableComponent {
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center'
}}
dataButtonValue={this.props.extensionId}
onClick={this.onClicked.bind(this, this.props.extensionId, this.props.browserAction.get('title'))} />
}
}
Expand Down
1 change: 1 addition & 0 deletions js/components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Button extends ImmutableComponent {
return <span disabled={this.props.disabled}
data-l10n-id={this.props.l10nId}
style={this.props.inlineStyles}
data-button-value={this.props.dataButtonValue}
className={cx({
browserButton: true,
fa: true,
Expand Down
66 changes: 57 additions & 9 deletions test/about/extensionsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
const Brave = require('../lib/brave')
const {urlInput} = require('../lib/selectors')
const {getTargetAboutUrl} = require('../../js/lib/appUrlUtil')
const settingsConst = require('../../js/constants/settings')
const {passwordManagers, extensionIds} = require('../../js/constants/passwordManagers')
const aboutExtensionsUrl = getTargetAboutUrl('about:extensions')

describe('about:extensions', function () {
Brave.beforeAll(this)
before(function * () {
const url = getTargetAboutUrl('about:extensions')
yield this.app.client
function * setup (client) {
yield client
.waitUntilWindowLoaded()
.waitForUrl(Brave.newTabUrl)
.waitForBrowserWindow()
Expand All @@ -17,11 +18,58 @@ describe('about:extensions', function () {
.windowByUrl(Brave.browserWindowUrl)
.waitForExist('.tab[data-frame-key="1"]')
.tabByIndex(0)
.url(url)
.url(aboutExtensionsUrl)
}
describe('PDFJS', function () {
Brave.beforeAll(this)
before(function * () {
yield setup(this.app.client)
})
it('installs by default', function * () {
yield this.app.client
.waitForVisible('[data-extension-id="oemmndcbldboiebfnladdacbdfmadadm"]')
})
})

it('lists PDFJS', function * () {
yield this.app.client
.waitForVisible('[data-extension-id="oemmndcbldboiebfnladdacbdfmadadm"]')
describe('1Password', function () {
Brave.beforeAll(this)
before(function * () {
yield setup(this.app.client)
})
it('installs when enabled', function * () {
yield this.app.client
.windowByUrl(Brave.browserWindowUrl)
.changeSetting(settingsConst.ACTIVE_PASSWORD_MANAGER, passwordManagers.ONE_PASSWORD)
.waitForVisible(`.extensionBrowserAction[data-button-value="${extensionIds[passwordManagers.ONE_PASSWORD]}"]`)
.tabByIndex(0)
.waitForVisible(`[data-extension-id="${extensionIds[passwordManagers.ONE_PASSWORD]}"]`)
})
})
describe('Dashlane installs when enabled', function () {
Brave.beforeAll(this)
before(function * () {
yield setup(this.app.client)
})
it('installs', function * () {
yield this.app.client
.windowByUrl(Brave.browserWindowUrl)
.changeSetting(settingsConst.ACTIVE_PASSWORD_MANAGER, passwordManagers.DASHLANE)
.waitForVisible(`.extensionBrowserAction[data-button-value="${extensionIds[passwordManagers.DASHLANE]}"]`)
.tabByIndex(0)
.waitForVisible(`[data-extension-id="${extensionIds[passwordManagers.DASHLANE]}"]`)
})
})
describe('LastPass installs when enabled', function () {
Brave.beforeAll(this)
before(function * () {
yield setup(this.app.client)
})
it('installs', function * () {
yield this.app.client
.windowByUrl(Brave.browserWindowUrl)
.changeSetting(settingsConst.ACTIVE_PASSWORD_MANAGER, passwordManagers.LAST_PASS)
.waitForVisible(`.extensionBrowserAction[data-button-value="${extensionIds[passwordManagers.LAST_PASS]}"]`)
.tabByIndex(0)
.waitForVisible(`[data-extension-id="${extensionIds[passwordManagers.LAST_PASS]}"]`)
})
})
})

0 comments on commit 999cb59

Please sign in to comment.