Exemplo n.º 1
0
 def test_login_new_sign_up(self):
     
     action = actions.SignInHomePageAction(self.browser)
     exp_month = login_pages.ExpensesMonthPage(browser=action.run(username='******',password='******'))
     browser = action.run(browser=exp_month.logout(),username='******',password='******')
     exp_month = login_pages.ExpensesMonthPage(browser=browser)
     exp_month.logout()
Exemplo n.º 2
0
 def test_delete_expense(self):
     exp_month = login_pages.ExpensesMonthPage(browser=self.browser,
                                               expenses=3)
     exp_details = login_pages.ExpenseDetailsPage(
         browser=exp_month.expenses[2].details())
     exp_delete = login_pages.ExpenseDeletePage(
         browser=exp_details.delete())
     with self.assertRaises(NoSuchElementException):
         exp_month = login_pages.ExpensesMonthPage(
             browser=exp_delete.delete(), expenses=3)
Exemplo n.º 3
0
 def test_approved_for_account(self):
     action = actions.SignInHomePageAction(self.browser)
     exp_month = login_pages.ExpensesMonthPage(browser=action.run(
         username='******', password='******'),
                                               expenses=2)
     expense = exp_month.expenses[0]
     self.assertTrue(expense.approved)
Exemplo n.º 4
0
    def test_sign_up_existing_account(self):

        home_page= public_pages.HomePage(browser=self.browser)
        sign_up_page = public_pages.SignUpPage(browser=home_page.sign_up())
        account_code  = Account.objects.get(pk=1).account_code
        Dmap = {'username':'******','password':'******','email':'*****@*****.**','account_code':account_code}
        sign_up_page.form.set_input_text(Dmap,clear_form=False)
        exp_month = login_pages.ExpensesMonthPage(browser=sign_up_page.sign_up(),expenses=2)
        home_page = public_pages.HomePage(browser=exp_month.logout())
Exemplo n.º 5
0
    def test_sign_up_new_account(self):

        home_page= public_pages.HomePage(browser=self.browser)
        sign_up_page = public_pages.SignUpPage(browser=home_page.sign_up())
        Dmap = {'username':'******','password':'******','email':'*****@*****.**'}
        sign_up_page.form.set_input_text(Dmap,clear_form=False)
        exp_month = login_pages.ExpensesMonthPage(browser=sign_up_page.sign_up())
        with self.assertRaises (NoSuchElementException):
            exp_month.expenses = 1
        home_page = public_pages.HomePage(browser=exp_month.logout())
Exemplo n.º 6
0
 def test_expenses_list(self):
     action = actions.SignInHomePageAction(browser=self.browser)
     self.browser = action.run(username='******', password='******')
     exp_month = login_pages.ExpensesMonthPage(browser=self.browser,
                                               expenses=2)
     self.assertEqual(
         exp_month.expenses[0].text,
         helpers.format_today_full('School john 130 50% {today} -'))
     self.assertEqual(
         exp_month.expenses[1].text,
         helpers.format_today_full('Sneakers john 90 50% {today} -'))
Exemplo n.º 7
0
 def test_approve_expense(self):
     action = actions.SignInHomePageAction(self.browser)
     exp_month = login_pages.ExpensesMonthPage(browser=action.run(
         username='******', password='******'),
                                               expenses=2)
     exp_details = login_pages.ExpenseDetailsPage(
         browser=exp_month.expenses[0].details())
     self.assertFalse(exp_details.approved)
     self.assertTrue(exp_details.can_approve)
     self.assertFalse(exp_details.can_edit)
     self.assertFalse(exp_details.can_delete)
     exp_approve = login_pages.ExpenseApprovePage(
         browser=exp_details.approve())
     exp_approve.approve_yes()
     exp_details = login_pages.ExpenseDetailsPage(
         browser=exp_approve.save())
     self.assertTrue(exp_details.approved)
     exp_month = login_pages.ExpensesMonthPage(
         browser=exp_details.side_bar_expenses(), expenses=2)
     self.assertTrue(exp_month.expenses[0].approved)
     exp_month.logout()
Exemplo n.º 8
0
 def test_add_expense(self):
     exp_month = login_pages.ExpensesMonthPage(browser=self.browser,
                                               expenses=2)
     exp_add = login_pages.ExpenseAddPage(browser=exp_month.add_expense())
     Dinput = {
         'desc': 'Books1',
         'expense_sum': '100',
         'place_of_purchase': 'amazon.com',
         'notes': 'spare book'
     }
     exp_add.form.set_input_text(Dinput, clear_form=False)
     exp_details = login_pages.ExpenseDetailsPage(browser=exp_add.save())
     Lmodel_html = [
         'Description Books1', 'Place of purchase amazon.com',
         'Purchased by john',
         helpers.format_today('Date of Purchase {today}'), u'Cost 100.0',
         u'Divorcee participate % 50', u'Notes spare book'
     ]
     self.assertEqual(exp_details.model_html, Lmodel_html)
     exp_month = login_pages.ExpensesMonthPage(
         browser=exp_details.side_bar_expenses(), expenses=3)
     self.assertEqual(
         exp_month.expenses[2].text,
         helpers.format_today_full('Books1 john 100 50% {today} -'))
Exemplo n.º 9
0
 def test_expense_details(self):
     exp_month = login_pages.ExpensesMonthPage(browser=self.browser,
                                               expenses=2)
     self.browser = exp_month.expenses[0].details()
     exp_details = login_pages.ExpenseDetailsPage(browser=self.browser)
     Lmodel_html = [
         'Description School', 'Place of purchase Book Store',
         'Purchased by john',
         helpers.format_today('Date of Purchase {today}'), u'Cost 130.0',
         u'Divorcee participate % 50', u'Notes'
     ]
     self.assertEqual(exp_details.model_html, Lmodel_html)
     self.assertFalse(exp_details.approved)
     self.assertTrue(exp_details.can_edit)
     self.assertTrue(exp_details.can_delete)