-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
undo changes made to the portfolio test
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
'use strict'; | ||
import { SmokeCore } from '../../tags'; | ||
import TabBarComponent from '../../pages/TabBarComponent'; | ||
import { loginToApp } from '../../viewHelper'; | ||
import { | ||
loadFixture, | ||
startFixtureServer, | ||
stopFixtureServer, | ||
} from '../../fixtures/fixture-helper'; | ||
import FixtureBuilder from '../../fixtures/fixture-builder'; | ||
import TestHelpers from '../../helpers'; | ||
import WalletView from '../../pages/wallet/WalletView'; | ||
import { getFixturesServerPort } from '../../fixtures/utils'; | ||
import FixtureServer from '../../fixtures/fixture-server'; | ||
import BrowserView from '../../pages/Browser/BrowserView'; | ||
import PortfolioHomePage from '../../pages/Browser/PortfolioHomePage'; | ||
import Assertions from '../../utils/Assertions'; | ||
import ConnectModal from '../../pages/modals/ConnectModal'; | ||
const fixtureServer = new FixtureServer(); | ||
describe(SmokeCore('Connect account to Portfolio'), () => { | ||
beforeAll(async () => { | ||
await TestHelpers.reverseServerPort(); | ||
const fixture = new FixtureBuilder().withKeyringController().build(); | ||
fixture.state.user.seedphraseBackedUp = false; | ||
await startFixtureServer(fixtureServer); | ||
await loadFixture(fixtureServer, { fixture }); | ||
await device.launchApp({ | ||
permissions: { notifications: 'YES' }, | ||
launchArgs: { fixtureServerPort: `${getFixturesServerPort()}` }, | ||
}); | ||
}); | ||
afterAll(async () => { | ||
await stopFixtureServer(fixtureServer); | ||
}); | ||
|
||
it('should connect wallet account to portfolio', async () => { | ||
await loginToApp(); | ||
await Assertions.checkIfVisible(WalletView.container); | ||
await TabBarComponent.tapBrowser(); | ||
await BrowserView.tapOpenAllTabsButton(); | ||
await BrowserView.tapCloseTabsButton(); | ||
await Assertions.checkIfVisible(BrowserView.noTabsMessage); | ||
await TabBarComponent.tapWallet(); | ||
await WalletView.tapPortfolio(); | ||
await BrowserView.waitForBrowserPageToLoad(); | ||
|
||
try { | ||
await PortfolioHomePage.closePrivacyModal(); | ||
} catch { | ||
/* eslint-disable no-console */ | ||
console.log('The Portfolio privacy modal is not visible'); | ||
} | ||
await device.disableSynchronization(); | ||
await PortfolioHomePage.tapConnectMetaMask(); | ||
await ConnectModal.tapConnectButton(); | ||
await device.enableSynchronization(); | ||
}); | ||
|
||
it('should not open additional browser tabs to portfolio', async () => { | ||
await Assertions.checkIfElementToHaveText(BrowserView.tabsNumber, '1'); | ||
await TabBarComponent.tapWallet(); | ||
await WalletView.tapPortfolio(); | ||
await BrowserView.waitForBrowserPageToLoad(); | ||
await Assertions.checkIfElementToHaveText(BrowserView.tabsNumber, '1'); | ||
}); | ||
}); |