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

Commit

Permalink
Fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Mar 19, 2017
1 parent d6c1bce commit 0c73653
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/components/ledgerPanelTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ describe('Regular payment panel tests', function () {
})

describe('auto include', function () {
Brave.beforeAll(this)
Brave.beforeEach(this)

before(function * () {
beforeEach(function * () {
yield setup(this.app.client)
yield this.app.client
.changeSetting(settings.AUTO_SUGGEST_SITES, true)
Expand All @@ -129,7 +129,7 @@ describe('Regular payment panel tests', function () {
.waitForVisible(paymentsWelcomePage)
.waitForVisible(walletSwitch)
.click(walletSwitch)
.waitForEnabled(addFundsButton)
.waitForEnabled(addFundsButton, ledgerAPIWaitTimeout)
})

it('site is added automatically', function * () {
Expand All @@ -148,6 +148,7 @@ describe('Regular payment panel tests', function () {
.waitForVisible(paymentsTab)
.click(paymentsTab)
.waitForVisible('[data-l10n-id="publisher"]')
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getAppState().then((val) => {
return val.value.siteSettings['https?://example.com'].ledgerPayments === true
Expand All @@ -164,7 +165,9 @@ describe('Regular payment panel tests', function () {
const site1 = 'http://example.com/'
const site2 = 'https://www.eff.org/'
yield this.app.client
.windowByUrl(Brave.browserWindowUrl)
.changeSetting(settings.AUTO_SUGGEST_SITES, false)
.tabByIndex(0)
.loadUrl(site1)
.windowByUrl(Brave.browserWindowUrl)
.waitForSiteEntry(site1)
Expand All @@ -177,6 +180,7 @@ describe('Regular payment panel tests', function () {
.waitForVisible(paymentsTab)
.click(paymentsTab)
.waitForVisible('[data-l10n-id="publisher"]')
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getAppState().then((val) => {
return val.value.siteSettings['https?://example.com'].ledgerPayments === false
Expand All @@ -193,11 +197,14 @@ describe('Regular payment panel tests', function () {
const site1 = 'http://example.com/'
const site2 = 'https://www.eff.org/'
yield this.app.client
.tabByIndex(0)
.loadUrl(site1)
.windowByUrl(Brave.browserWindowUrl)
.waitForSiteEntry(site1)
.tabByUrl(site1)
.windowByUrl(Brave.browserWindowUrl)
.changeSetting(settings.AUTO_SUGGEST_SITES, false)
.tabByIndex(0)
.loadUrl(site2)
.windowByUrl(Brave.browserWindowUrl)
.waitForSiteEntry(site2)
Expand All @@ -206,6 +213,7 @@ describe('Regular payment panel tests', function () {
.waitForVisible(paymentsTab)
.click(paymentsTab)
.waitForVisible('[data-l10n-id="publisher"]')
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getAppState().then((val) => {
return val.value.siteSettings['https?://example.com'].ledgerPayments === true
Expand Down

0 comments on commit 0c73653

Please sign in to comment.