1
1
import { strict as assert } from 'assert' ;
2
2
import { Suite } from 'mocha' ;
3
3
import { WALLET_PASSWORD } from '../../helpers' ;
4
+ import AccountDetailsModal from '../../page-objects/pages/dialog/account-details-modal' ;
4
5
import AccountListPage from '../../page-objects/pages/account-list-page' ;
5
6
import HeaderNavbar from '../../page-objects/pages/header-navbar' ;
6
7
import LoginPage from '../../page-objects/pages/login-page' ;
7
8
import PrivacySettings from '../../page-objects/pages/settings/privacy-settings' ;
8
9
import ResetPasswordPage from '../../page-objects/pages/reset-password-page' ;
9
10
import SettingsPage from '../../page-objects/pages/settings/settings-page' ;
10
- import { ACCOUNT_TYPE } from '../../page-objects/common ' ;
11
+ import { ACCOUNT_TYPE } from '../../constants ' ;
11
12
import { withBtcAccountSnap } from './common-btc' ;
12
13
13
14
describe ( 'Create BTC Account' , function ( this : Suite ) {
@@ -82,9 +83,11 @@ describe('Create BTC Account', function (this: Suite) {
82
83
await headerNavbar . openAccountMenu ( ) ;
83
84
const accountListPage = new AccountListPage ( driver ) ;
84
85
await accountListPage . check_pageIsLoaded ( ) ;
85
- const accountAddress = await accountListPage . getAccountAddress (
86
- 'Bitcoin Account' ,
87
- ) ;
86
+ await accountListPage . openAccountDetailsModal ( 'Bitcoin Account' ) ;
87
+
88
+ const accountDetailsModal = new AccountDetailsModal ( driver ) ;
89
+ await accountDetailsModal . check_pageIsLoaded ( ) ;
90
+ const accountAddress = await accountDetailsModal . getAccountAddress ( ) ;
88
91
await headerNavbar . openAccountMenu ( ) ;
89
92
await accountListPage . removeAccount ( 'Bitcoin Account' ) ;
90
93
@@ -97,14 +100,15 @@ describe('Create BTC Account', function (this: Suite) {
97
100
) ;
98
101
await accountListPage . closeAccountModal ( ) ;
99
102
await headerNavbar . openAccountMenu ( ) ;
100
- await accountListPage . addAccount ( ACCOUNT_TYPE . Bitcoin , '' ) ;
103
+ await accountListPage . addAccount ( { accountType : ACCOUNT_TYPE . Bitcoin } ) ;
101
104
await headerNavbar . check_accountLabel ( 'Bitcoin Account' ) ;
102
105
103
106
await headerNavbar . openAccountMenu ( ) ;
104
107
await accountListPage . check_pageIsLoaded ( ) ;
105
- const recreatedAccountAddress = await accountListPage . getAccountAddress (
106
- 'Bitcoin Account' ,
107
- ) ;
108
+ await accountListPage . openAccountDetailsModal ( 'Bitcoin Account' ) ;
109
+ await accountDetailsModal . check_pageIsLoaded ( ) ;
110
+ const recreatedAccountAddress =
111
+ await accountDetailsModal . getAccountAddress ( ) ;
108
112
109
113
assert ( accountAddress === recreatedAccountAddress ) ;
110
114
} ,
@@ -123,9 +127,10 @@ describe('Create BTC Account', function (this: Suite) {
123
127
await headerNavbar . openAccountMenu ( ) ;
124
128
const accountListPage = new AccountListPage ( driver ) ;
125
129
await accountListPage . check_pageIsLoaded ( ) ;
126
- const accountAddress = await accountListPage . getAccountAddress (
127
- 'Bitcoin Account' ,
128
- ) ;
130
+ await accountListPage . openAccountDetailsModal ( 'Bitcoin Account' ) ;
131
+ const accountDetailsModal = new AccountDetailsModal ( driver ) ;
132
+ await accountDetailsModal . check_pageIsLoaded ( ) ;
133
+ const accountAddress = await accountDetailsModal . getAccountAddress ( ) ;
129
134
130
135
// go to privacy settings page and get the SRP
131
136
await headerNavbar . openSettingsPage ( ) ;
@@ -151,14 +156,16 @@ describe('Create BTC Account', function (this: Suite) {
151
156
await headerNavbar . check_pageIsLoaded ( ) ;
152
157
await headerNavbar . openAccountMenu ( ) ;
153
158
await accountListPage . check_pageIsLoaded ( ) ;
154
- await accountListPage . addAccount ( ACCOUNT_TYPE . Bitcoin , '' ) ;
159
+ await accountListPage . addAccount ( { accountType : ACCOUNT_TYPE . Bitcoin } ) ;
155
160
await headerNavbar . check_accountLabel ( 'Bitcoin Account' ) ;
156
161
157
162
await headerNavbar . openAccountMenu ( ) ;
158
163
await accountListPage . check_pageIsLoaded ( ) ;
159
- const recreatedAccountAddress = await accountListPage . getAccountAddress (
160
- 'Bitcoin Account' ,
161
- ) ;
164
+ await accountListPage . openAccountDetailsModal ( 'Bitcoin Account' ) ;
165
+ await accountDetailsModal . check_pageIsLoaded ( ) ;
166
+ const recreatedAccountAddress =
167
+ await accountDetailsModal . getAccountAddress ( ) ;
168
+
162
169
assert ( accountAddress === recreatedAccountAddress ) ;
163
170
} ,
164
171
) ;
0 commit comments