11import { DEFAULT_USER_CREDENTIALS } from './config/constants' ;
2- import { AccountProfile , Registration , Utils } from './page-objects' ;
2+ import { AccountProfile , Registration , Authenticated } from './page-objects' ;
33import { ToastBar } from './page-objects/toastBar' ;
44import { test , expect } from './utils/test' ;
55import { createTestUser , type ITestUser } from './utils/user-helpers' ;
@@ -8,7 +8,7 @@ test.describe('Delete Own Account', () => {
88 let poAccountProfile : AccountProfile ;
99 let poRegistration : Registration ;
1010 let poToastBar : ToastBar ;
11- let poUtils : Utils ;
11+ let poAuth : Authenticated ;
1212 let userToDelete : ITestUser ;
1313 let userWithInvalidPassword : ITestUser ;
1414 let userWithoutPermissions : ITestUser ;
@@ -25,7 +25,7 @@ test.describe('Delete Own Account', () => {
2525 poAccountProfile = new AccountProfile ( page ) ;
2626 poRegistration = new Registration ( page ) ;
2727 poToastBar = new ToastBar ( page ) ;
28- poUtils = new Utils ( page ) ;
28+ poAuth = new Authenticated ( page ) ;
2929 await page . goto ( '/home' ) ;
3030 } ) ;
3131
@@ -43,7 +43,7 @@ test.describe('Delete Own Account', () => {
4343 await poRegistration . username . fill ( userWithInvalidPassword . data . username ) ;
4444 await poRegistration . inputPassword . fill ( DEFAULT_USER_CREDENTIALS . password ) ;
4545 await poRegistration . btnLogin . click ( ) ;
46- await expect ( poUtils . mainContent ) . toBeVisible ( ) ;
46+ await poAuth . waitForDisplay ( ) ;
4747 } ) ;
4848
4949 await test . step ( 'navigate to profile and locate Delete My Account button' , async ( ) => {
@@ -81,7 +81,7 @@ test.describe('Delete Own Account', () => {
8181 await poRegistration . username . fill ( userToDelete . data . username ) ;
8282 await poRegistration . inputPassword . fill ( DEFAULT_USER_CREDENTIALS . password ) ;
8383 await poRegistration . btnLogin . click ( ) ;
84- await expect ( poUtils . mainContent ) . toBeVisible ( ) ;
84+ await poAuth . waitForDisplay ( ) ;
8585 } ) ;
8686
8787 await test . step ( 'navigate to profile and locate Delete My Account button' , async ( ) => {
@@ -105,6 +105,7 @@ test.describe('Delete Own Account', () => {
105105 } ) ;
106106
107107 await test . step ( 'verify user is redirected to login page' , async ( ) => {
108+ await poRegistration . waitForDisplay ( ) ;
108109 await expect ( poRegistration . btnLogin ) . toBeVisible ( ) ;
109110 userToDelete . markAsDeleted ( ) ;
110111 } ) ;
@@ -121,7 +122,7 @@ test.describe('Delete Own Account', () => {
121122 await poRegistration . username . fill ( userWithoutPermissions . data . username ) ;
122123 await poRegistration . inputPassword . fill ( DEFAULT_USER_CREDENTIALS . password ) ;
123124 await poRegistration . btnLogin . click ( ) ;
124- await expect ( poUtils . mainContent ) . toBeVisible ( ) ;
125+ await poAuth . waitForDisplay ( ) ;
125126 } ) ;
126127
127128 await test . step ( 'navigate to profile and locate Delete My Account button' , async ( ) => {
0 commit comments