Beispiel #1
0
  def testNotes_Start_SignIn_DeleteNote(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Delete Note.
    version_info, session_info, screen_info, screen = (
        self.DeleteNote(version_info, session_info, screen_info, self.note_2))
    self.AssertNotes([self.note_1, self.note_3], screen)
Beispiel #2
0
  def testNotes_Start_SignIn_Navigation(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Click on Notes button.
    response = fase_server.FaseServer.Get().ElementCallback(
        fase_model.ElementCallback(id_list=[fase.NAVIGATION_ID, 'notes_button'], method=fase.ON_CLICK_METHOD,
                                   device=self.device),
        version_info, session_info, screen_info)
    screen_info = response.screen_info
    screen = response.screen
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Click on Favourites button.
    response = fase_server.FaseServer.Get().ElementCallback(
        fase_model.ElementCallback(id_list=[fase.NAVIGATION_ID, 'favourites_button'], method=fase.ON_CLICK_METHOD,
                                   device=self.device),
        version_info, session_info, screen_info)
    screen_info = response.screen_info
    screen = response.screen
    self.AssertNotes([self.note_2], screen)

    # Click on Recent button.
    response = fase_server.FaseServer.Get().ElementCallback(
        fase_model.ElementCallback(id_list=[fase.NAVIGATION_ID, 'recent_button'], method=fase.ON_CLICK_METHOD,
                                   device=self.device),
        version_info, session_info, screen_info)
    screen_info = response.screen_info
    screen = response.screen
    self.AssertNotes([self.note_1, self.note_3, self.note_2], screen)

    # Click on Notes button again.
    response = fase_server.FaseServer.Get().ElementCallback(
        fase_model.ElementCallback(id_list=[fase.NAVIGATION_ID, 'notes_button'], method=fase.ON_CLICK_METHOD,
                                   device=self.device),
        version_info, session_info, screen_info)
    screen_info = response.screen_info
    screen = response.screen
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)
Beispiel #3
0
  def testNotes_Start_SignIn_ReverseFavouriteNote(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Copy and edit Note.
    note_3_edited = copy.copy(self.note_3)
    note_3_edited.favourite = True
    note_3_edited.datetime = datetime.datetime.utcnow()  # Should be updated by the Service.
    
    # Reverse Favourite for Note.
    version_info, session_info, screen_info, screen = (
        self.ReverseFavouriteNote(version_info, session_info, screen_info, self.note_3))
    self.AssertNotes([self.note_1, self.note_2, note_3_edited], screen)
Beispiel #4
0
  def testNotes_Start_SignIn_EditNote(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Copy and edit Note.
    note_2_edited = copy.copy(self.note_2)
    note_2_edited.header = 'Note 2 Header edited'
    note_2_edited.text = 'Note 2 text edited'
    note_2_edited.datetime = datetime.datetime.utcnow()  # Should be updated by the Service.
    
    # Edit Note.
    version_info, session_info, screen_info, screen = (
        self.EditNote(version_info, session_info, screen_info, self.note_2, note_2_edited))
    self.AssertNotes([self.note_1, note_2_edited, self.note_3], screen)
Beispiel #5
0
  def testNotes_Start_SignIn_AddNote(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Create a Note.
    note_4 = notes_model.Note(note_id=None,
                              user_id=None,
                              header='Note 4 Header',
                              text='Note 4 text',
                              datetime=None,
                              favourite=False)

    # Add Note.
    version_info, session_info, screen_info, screen = self.AddNote(version_info, session_info, screen_info, note_4)
    self.AssertNotes([self.note_1, self.note_2, self.note_3, note_4], screen)
Beispiel #6
0
  def testNotes_Start_AddNote_SignUn(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Create a Note.
    note_4 = notes_model.Note(note_id=None,
                              user_id=None,
                              header='Note 4 Header',
                              text='Note 4 text',
                              datetime=None,
                              favourite=False)

    # Add Note.
    version_info, session_info, screen_info, screen = self.AddNote(version_info, session_info, screen_info, note_4)
    self.AssertNotes([note_4], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=False,
            phone_number='+19876543210', first_name='Edward Junior', last_name='Igushev'))
    self.AssertNotes([note_4], screen)
Beispiel #7
0
  def testNotes_Start_SignIn_EditNote_Cancel(self):
    version_info, session_info, screen_info, screen = self.Start()
    self.AssertNotes([], screen)

    # Sign In.
    version_info, session_info, screen_info, screen = (
        fase_sign_in_test_util.SignInProcedure(
            version_info, session_info, screen_info,
            sign_in_id_list=[fase.NAVIGATION_ID, 'sign_in_button'], sign_in=True, phone_number='+13216549870'))
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)

    # Copy and edit Note.
    note_2_edited = copy.copy(self.note_2)
    note_2_edited.header = 'Note 2 Header edited'
    note_2_edited.text = 'Note 2 text edited'

    version_info, session_info, screen_info, screen = self.SelectNote(
        version_info, session_info, screen_info, self.note_2)

    # Edit Note.
    elements_update=fase_model.ElementsUpdate([['note_frame', 'header_text'],
                                               ['note_frame', 'text_text']], [note_2_edited.header,
                                                                              note_2_edited.text])
    screen_update = fase_model.ScreenUpdate(elements_update=elements_update, device=self.device)
    fase_server.FaseServer.Get().ScreenUpdate(screen_update, version_info, session_info, screen_info)

    # Click on Cancel button.
    response = fase_server.FaseServer.Get().ElementCallback(
        fase_model.ElementCallback(id_list=[fase.PREV_STEP_BUTTON_ID], method=fase.ON_CLICK_METHOD, device=self.device),
        version_info, session_info, screen_info)
    version_info = response.version_info 
    session_info = response.session_info
    screen_info = response.screen_info
    screen = response.screen
    # Check present of main elements.
    screen.GetElement(id_='notes_frame')
    self.AssertNotes([self.note_1, self.note_2, self.note_3], screen)