summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2017-03-20 15:45:41 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2017-03-30 15:51:11 -0300
commit715419e88dcbc4d5f0b8286d917b26b8d425d85b (patch)
tree2482790a46097ead2c6ad35aad101b15e72a730f /service
parent9f0cd9888c3b435a44a5d3ea1e1484618099cc84 (diff)
[#927] Creates functional tests for backup account flow
with @tayanefernandes
Diffstat (limited to 'service')
-rw-r--r--service/test/functional/features/account_recovery.feature25
-rw-r--r--service/test/functional/features/steps/backup_account.py17
2 files changed, 41 insertions, 1 deletions
diff --git a/service/test/functional/features/account_recovery.feature b/service/test/functional/features/account_recovery.feature
new file mode 100644
index 00000000..ec38399f
--- /dev/null
+++ b/service/test/functional/features/account_recovery.feature
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2017 ThoughtWorks, Inc.
+#
+# Pixelated is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Pixelated is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
+
+Feature: Account Recovery
+ As a user of Pixelated
+ I want to recover my account
+ So that I can see my emails if I lose my password
+
+ Scenario: User sets up a backup account
+ Given I am on the backup account page
+ When I submit my email
+ Then I see the confirmation page
diff --git a/service/test/functional/features/steps/backup_account.py b/service/test/functional/features/steps/backup_account.py
index 914309f2..916198f6 100644
--- a/service/test/functional/features/steps/backup_account.py
+++ b/service/test/functional/features/steps/backup_account.py
@@ -14,9 +14,24 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
-from behave import given
+from behave import given, when, then
+
+from common import (
+ fill_by_css_selector,
+ find_element_by_css_selector)
@given(u'I am on the backup account page')
def backup_account_page(context):
context.browser.get(context.backup_account_url)
+
+
+@when(u'I submit my email')
+def submit_backup_email(context):
+ fill_by_css_selector(context, 'input[name="email"]', 'test@test.com')
+ find_element_by_css_selector(context, 'button[type="submit"]').click()
+
+
+@then(u'I see the confirmation page')
+def confirmation_page(context):
+ find_element_by_css_selector(context, '.confirmation-container')