PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

[WIP] Notebook User Profile Test - Draft

Open shubham3121 opened this issue 2 years ago • 1 comments

Description

A clear and concise description of what you want to test.

Type of Test

  • [ ] Unit test (e.g. checking a loop, method, or function is working as intended)
  • [ ] Integration test (e.g. checking if a certain group or set of functionality is working as intended)

Expected Behavior

A clear and concise description of what you expected to happen. Do you intend to reach a certain percentage of test coverage for this file, feature, or codebase?

Additional Context

Add any other context about the tests here.

shubham3121 avatar Mar 29 '22 07:03 shubham3121

User Profile Settings

View User Profile

  • [ ] user logs into domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile on the domain client object
  • [ ] profile information of the user is displayed
    rofile Details: 
    Name: <user name>
    Email: <user email>
    Institution: <user institution name>
    Profile Link: <url to user's public profile e.g. linkedin, github, etc.>
    
    To update your profile information, you can call:
    
        `<domain_client>.userprofile.update()`
    

Update User Profile

Successfully update user profile

  • [ ] user logs into domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.update() on the domain client object
  • [ ] If no arguments are passed inside update, a profile update widget is opened and prompted to enter new details.
    elcome to Profile Update Widget. Introduce yourself to the Domain Owner.
    our profile information is what Domain Owners see when they are vetting your requests.
    
    ote: 
     The current value of the field is shown inside round brackets (...).
     Please enter `s` to skip any field.
     Please enter `q` quit the widget. If you quit changes won't be saved.
    
    lease enter the new details:
    ame* (<current name>): <input box>
    
  • [ ] user enters name
  • [ ] user enters email
  • [ ] user enters the name of the institution
  • [ ] user enters the link to their public profile
  • [ ] on successful update, the user sees the updated profile details
    pdated Details: 
    ame: <updated name>
    mail: <updated email address>
    nstitution: <updated institution name>
    rofile Link: <updated profile link>
    

Successfully update user profile (Skip a few pre-filled fields)

  • [ ] user logs into domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.update() on the domain client object
  • [ ] If no arguments are passed inside update, a profile update widget is opened and prompted to enter new details.
  • [ ] user enters name
  • [ ] user skips email by entering s.
  • [ ] user skips institution name by entering s
  • [ ] user enters profile link
  • [ ] on successful update, the user sees the updated profile details
    pdated Details: 
    ame: <updated name>
    mail: <old email address>
    nstitution: <old institution name>
    rofile Link: <updated profile link>
    

User Quits Profile Widget

  • [ ] user logs into domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.update() on the domain client object
  • [ ] If no arguments are passed inside the update, a profile update widget is opened and prompted to enter new details.
  • [ ] user enters a new value for the prompted field
  • [ ] user enters q
  • [ ] user receives a message that widget is quitting and changes are not saved.
    elcome to Profile Update Widget. Introduce yourself to the Domain Owner.
    our profile information is what Domain Owners see when they are vetting your requests.
    
    ote: 
     The current value of the field is shown inside round brackets (...).
     Please enter `s` to skip any field.
     Please enter `q` quit the widget. If you quit changes won't be saved.
    
    lease enter the new details:
    
    ame*: (<current name>) - <new value>
    mail*: (<current email>) - q
    
    uitting the profile widget. Your changes are not saved.
    

Successfully update user profile (One field at a time)

  • [ ] user logs into domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.update()
  • [ ] user passes the field name they want to update as arguments to the update method. e.g. userprofile.update(field_name="Name")
  • [ ] Prompt to enter the value to the field_name
    lease enter the new `<field_name>`:
    field_name>: (<current value of the field>) - <input new value>
    
  • [ ] user enters a valid value to the field, a message is displayed on successful updating the field. <field_name> is successfully updated !

User profile update is unsuccessful

  • [ ] user enters an empty string for Name field
    ValidationError:
        Invalid name. Name cannot be an empty string.
    
  • [ ] user enters invalid email i.e. format of the email is not correct.
     ValidationError:
         Invalid email. Make sure your email is in a `[email protected]` format
    
  • [ ] user enters an email with which another account exists on the domain
    ValidationError:
        Seems like an account with that email already exists on this domain.
        Please try a different email address.
    
  • [ ] user tries to update a field that does not exist (when updating one field at a time). e.g. domain.userprofile.update(field_name='PhoneNumber')
  • [ ] user sees a message for invalid field
     InvalidFieldError:
          Field name `PhoneNumber` does not exist.
    
      If you're unsure of the field name please use the profile widget to
      update your profile information.
           `<domain_client>.userprofile.update()`
    
  • [ ] user tries to update their password. e.g. domain.userprofile.update(field_name="password")
  • [ ] user sees a message for invalid field with instruction to reset password command.
    nvalidFieldError:
       Field name `Password` does not exist.
    
       To reset your password, you can call:
           `<domain_client>.userprofile.reset_password()`
    

Password Reset

Successful password reset (using widget)

  • [ ] user logs into the domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.reset_password()
  • [ ] user sees a password reset widget
    elcome to Password Reset Widget.
    
    assword Requirements:
    he new password should contain atleast:
     One lowercase character
     One uppercase character
     One number
     One special character from (!,@,#,$,%,^,&,*)
     Minimum 8 characters
    
    lease provide the following details:
    urrent Password: <input current password>
    ew Password: <input new password>
    onfirm New Password: <input new password again>
    
  • [ ] user enters the current password
  • [ ] user enters a new password
  • [ ] user enters the new password again
  • [ ] user receives a message on a successful password change.
    our password has been changed successfully.
    

Successful password reset (without widget)

  • [ ] user logs into the domain
  • [ ] user receives a domain client object on successful login
  • [ ] user calls .userprofile.reset_password
  • [ ] user passed curr_password and new_password as arguments to the reset_password method.
  • [ ] user receives a message on a successful password change
    our password has been changed successfully.
    

Password reset is unsuccessful

  • [ ] user enters the incorrect current password. An error is displayed.
    uthorizationError:
        The current password you have entered is incorrect.
    
  • [ ] user enters a new password and confirms the new password, but the values in both these fields are different.
    alidationError:
        New Password and Confirm New Password does not match.
    
  • [ ] user enters a new password but it does not comply with minimum password requirements.
    alidationError:
        The new password you entered doesn't meet the minimum
        security requirements.
    
  • [ ] user logs into the domain as a guest user, and tries to access .userprofile
    uthorizationError:
       Profile is not accessible as a guest user.
       Please login or register to the domain to access your profile.
    

shubham3121 avatar Mar 29 '22 11:03 shubham3121