class AddUsersPage { constructor ( ) { cy . get ( "h1" ) . contains ( "Add users" ) ; } fillEmailAddress ( userEmail ) { cy . findByLabelText ( "User email address(es)*" ) . type ( userEmail ) ; } selectAdminRole ( ) { cy . findByLabelText ( "Admin" ) . check ( { force : true } ) ; } submit ( ) { cy . intercept ( { method : "POST" , url : "/prod/user" , } ) . as ( "createUserRequest" ) ; cy . intercept ( { method : "GET" , url : "/prod/user" , } ) . as ( "listUsersRequest" ) ; cy . get ( "form" ) . submit ( ) ; cy . wait ( [ "@createUserRequest" , "@listUsersRequest" ] ) ; } } export default AddUsersPage ;