From 0c73653ce71abeef9832c44a44a365ef1b8f7824 Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Sun, 19 Mar 2017 21:56:15 +0100 Subject: [PATCH] Fixes tests --- test/components/ledgerPanelTest.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/components/ledgerPanelTest.js b/test/components/ledgerPanelTest.js index cf8d98b1005..d3a401167ec 100644 --- a/test/components/ledgerPanelTest.js +++ b/test/components/ledgerPanelTest.js @@ -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) @@ -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 * () { @@ -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 @@ -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) @@ -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 @@ -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) @@ -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