|
| 1 | +import { Suite } from 'mocha'; |
| 2 | +import FixtureBuilder from '../../../fixture-builder'; |
| 3 | +import { withFixtures } from '../../../helpers'; |
| 4 | +import HomePage from '../../../page-objects/pages/home/homepage'; |
| 5 | +import { Driver } from '../../../webdriver/driver'; |
| 6 | + |
| 7 | +import { loginWithoutBalanceValidation } from '../../../page-objects/flows/login.flow'; |
| 8 | +import AccountListPage from '../../../page-objects/pages/account-list-page'; |
| 9 | +import ConnectHardwareWalletPage from '../../../page-objects/pages/hardware-wallet/connect-hardware-wallet-page'; |
| 10 | +import SelectHardwareWalletAccountPage from '../../../page-objects/pages/hardware-wallet/select-hardware-wallet-account-page'; |
| 11 | +import HeaderNavbar from '../../../page-objects/pages/header-navbar'; |
| 12 | + |
| 13 | +describe('Ledger Hardware', function (this: Suite) { |
| 14 | + it('forgets device and checks if it is removed from the list', async function () { |
| 15 | + await withFixtures( |
| 16 | + { |
| 17 | + fixtures: new FixtureBuilder().withLedgerAccount().build(), |
| 18 | + title: this.test?.fullTitle(), |
| 19 | + }, |
| 20 | + async ({ driver }: { driver: Driver }) => { |
| 21 | + await loginWithoutBalanceValidation(driver); |
| 22 | + const homePage = new HomePage(driver); |
| 23 | + await homePage.checkPageIsLoaded(); |
| 24 | + const headerNavbar = new HeaderNavbar(driver); |
| 25 | + await headerNavbar.openAccountMenu(); |
| 26 | + const accountListPage = new AccountListPage(driver); |
| 27 | + await accountListPage.checkPageIsLoaded(); |
| 28 | + await accountListPage.openConnectHardwareWalletModal(); |
| 29 | + |
| 30 | + const connectHardwareWalletPage = new ConnectHardwareWalletPage(driver); |
| 31 | + await connectHardwareWalletPage.checkPageIsLoaded(); |
| 32 | + await connectHardwareWalletPage.clickConnectLedgerButton(); |
| 33 | + |
| 34 | + const selectLedgerAccountPage = new SelectHardwareWalletAccountPage( |
| 35 | + driver, |
| 36 | + ); |
| 37 | + await selectLedgerAccountPage.checkPageIsLoaded(); |
| 38 | + |
| 39 | + await selectLedgerAccountPage.clickForgetDeviceButton(); |
| 40 | + |
| 41 | + await connectHardwareWalletPage.checkPageIsLoaded(); |
| 42 | + await connectHardwareWalletPage.clickCloseButton(); |
| 43 | + |
| 44 | + await homePage.checkPageIsLoaded(); |
| 45 | + await headerNavbar.openAccountMenu(); |
| 46 | + await accountListPage.checkPageIsLoaded(); |
| 47 | + await accountListPage.checkAccountIsNotDisplayedInAccountList( |
| 48 | + 'Ledger 1', |
| 49 | + ); |
| 50 | + }, |
| 51 | + ); |
| 52 | + }); |
| 53 | +}); |
0 commit comments