@@ -57,6 +57,8 @@ define(function (require, exports, module) {
5757 verifyProfilePopupContent ,
5858 cleanupTrialState ,
5959 popupToAppear ,
60+ performFullLogoutFlow ,
61+ verifyProfileIconBlanked ,
6062 VIEW_TRIAL_DAYS_LEFT ,
6163 VIEW_PHOENIX_PRO ,
6264 VIEW_PHOENIX_FREE ,
@@ -94,7 +96,7 @@ define(function (require, exports, module) {
9496 "Profile button to be available" ,
9597 3000
9698 ) ;
97- SharedUtils = LoginShared . getSharedUtils ( testWindow ) ;
99+ SharedUtils = LoginShared . getSharedUtils ( testWindow , LoginServiceExports ) ;
98100 VIEW_TRIAL_DAYS_LEFT = SharedUtils . VIEW_TRIAL_DAYS_LEFT ;
99101 VIEW_PHOENIX_PRO = SharedUtils . VIEW_PHOENIX_PRO ;
100102 VIEW_PHOENIX_FREE = SharedUtils . VIEW_PHOENIX_FREE ;
@@ -106,6 +108,8 @@ define(function (require, exports, module) {
106108 verifyProfilePopupContent = SharedUtils . verifyProfilePopupContent ;
107109 cleanupTrialState = SharedUtils . cleanupTrialState ;
108110 popupToAppear = SharedUtils . popupToAppear ;
111+ performFullLogoutFlow = SharedUtils . performFullLogoutFlow ;
112+ verifyProfileIconBlanked = SharedUtils . verifyProfileIconBlanked ;
109113 } , 30000 ) ;
110114
111115 afterAll ( async function ( ) {
@@ -289,41 +293,6 @@ define(function (require, exports, module) {
289293 ) ;
290294 }
291295
292- async function performFullLogoutFlow ( ) {
293- // Click profile button to open popup
294- const $profileButton = testWindow . $ ( "#user-profile-button" ) ;
295- $profileButton . trigger ( 'click' ) ;
296-
297- // Wait for profile popup
298- await popupToAppear ( PROFILE_POPUP ) ;
299-
300- // Find and click sign out button
301- let popupContent = testWindow . $ ( '.profile-popup' ) ;
302- const signOutButton = popupContent . find ( '#phoenix-signout-btn' ) ;
303- signOutButton . trigger ( 'click' ) ;
304-
305- // Wait for sign out confirmation dialog and dismiss it
306- await testWindow . __PR . waitForModalDialog ( ".modal" ) ;
307- testWindow . __PR . clickDialogButtonID ( testWindow . __PR . Dialogs . DIALOG_BTN_OK ) ;
308- await testWindow . __PR . waitForModalDialogClosed ( ".modal" ) ;
309-
310- // Wait for sign out to complete
311- await awaitsFor (
312- function ( ) {
313- return ! LoginServiceExports . LoginService . isLoggedIn ( ) ;
314- } ,
315- "User to be signed out" ,
316- 10000
317- ) ;
318- verifyProfileIconBlanked ( ) ;
319- }
320-
321- function verifyProfileIconBlanked ( ) {
322- const $profileIcon = testWindow . $ ( "#user-profile-button" ) ;
323- const initialContent = $profileIcon . html ( ) ;
324- expect ( initialContent ) . not . toContain ( 'TU' ) ;
325- }
326-
327296 describe ( "Desktop Login and Promotion Tests" , function ( ) {
328297
329298 beforeEach ( async function ( ) {
0 commit comments