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

Commit

Permalink
Fix intermittent with clear browsing data test
Browse files Browse the repository at this point in the history
  • Loading branch information
bbondy committed Aug 17, 2016
1 parent 8c065eb commit 876c8bc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/components/clearBrowsingDataPanelTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const Brave = require('../lib/brave')
const {urlInput, clearBrowsingDataPanel} = require('../lib/selectors')
const {getTargetAboutUrl} = require('../../js/lib/appUrlUtil')
const assert = require('assert')

describe('Clear Browsing Panel', function () {
function * setup (client) {
Expand Down Expand Up @@ -34,24 +33,25 @@ describe('Clear Browsing Panel', function () {
.click(clearBrowsingDataButton)
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(clearBrowsingDataPanel)
.getAppState()
})
it('can clear browsing history', function * () {
const page1Url = Brave.server.url('page1.html')
const state = yield this.app.client
yield this.app.client
.windowByUrl(Brave.browserWindowUrl)
.tabByIndex(0)
.loadUrl(page1Url)
.url(getTargetAboutUrl(page1Url))
.windowByUrl(Brave.browserWindowUrl)
.waitForVisible(clearBrowsingDataPanel)
.getAppState()
assert.equal(state.value.sites.length, 1)
yield this.app.client
.waitUntil(function () {
return this.getAppState().then((val) => {
return val.value.sites.length === 1
})
})
.click('.browserHistorySwitch .switchBackground')
.click('.clearDataButton')
.waitUntil(function () {
return this.getAppState(state).then((val) => {
return this.getAppState().then((val) => {
return val.value.sites.length === 0
})
})
Expand Down

0 comments on commit 876c8bc

Please sign in to comment.