Skip to content

Commit

Permalink
Merge pull request #248 from nodlesh/refactor-bcw-terms-of-use-po
Browse files Browse the repository at this point in the history
Refactored ToU and enable notifications in BCW
  • Loading branch information
nodlesh committed Mar 21, 2024
2 parents 6dc4984 + c243d0d commit 7f0cef0
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 106 deletions.
1 change: 0 additions & 1 deletion aries-mobile-tests/features/bc_wallet/connect.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Feature: Connections
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
When the Holder scans the QR code sent by the "issuer"
And the Holder is taken to the Connecting Screen/modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
When the Holder receives a Non-Revocable credential offer
Expand All @@ -30,7 +29,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the user has a credential offer
Expand All @@ -48,7 +46,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the user has a credential offer of <credential>
Expand All @@ -71,7 +68,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the user has a credential offer
Expand Down Expand Up @@ -117,7 +113,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the user has existing credentials
Expand All @@ -135,7 +130,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
When the Holder receives a Non-Revocable credential offer
Expand All @@ -154,7 +148,6 @@ Feature: Offer a Credential
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a Non-Revocable credential
Expand Down
11 changes: 0 additions & 11 deletions aries-mobile-tests/features/bc_wallet/proof.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a Non-Revocable credential
Expand All @@ -36,7 +35,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a Non-Revocable credential
Expand All @@ -57,7 +55,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -82,7 +79,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And the holder has credentials
| credential | revocable | issuer_agent_type | credential_name |
Expand All @@ -104,7 +100,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -127,7 +122,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -152,7 +146,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -178,7 +171,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -204,7 +196,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand All @@ -231,7 +222,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand Down Expand Up @@ -399,7 +389,6 @@ Feature: Proof
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a credential of <credential>
Expand Down
2 changes: 1 addition & 1 deletion aries-mobile-tests/features/bc_wallet/security.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Feature: Secure your Wallet
When the User enters the first PIN as "369369"
And the User re-enters the PIN as "369369"
And the User selects Create PIN
And the User allows notifications
And the User selects to use Biometrics
And the User allows notifications
Then they have access to the app

@T005-Security @AcceptanceTest @ExceptionTest @normal
Expand Down
5 changes: 1 addition & 4 deletions aries-mobile-tests/features/bc_wallet/terms.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ Scenario: New User Accepts Terms and Conditions
Given the User has completed on-boarding
And the User is on the Terms and Conditions screen
When the users accepts the Terms and Conditions
And the user clicks continue
Then the user transitions to the PIN creation screen

@T002-TandC @AcceptanceTest @normal
@T002-TandC @AcceptanceTest @normal @depricated @wip
Scenario: New User Rejects Terms and Conditions
Given the User has completed on-boarding
And the User is on the Terms and Conditions screen
Expand All @@ -24,8 +23,6 @@ Then the User goes back to the last on-boarding screen they viewed
Scenario: New User Rejects Terms and Conditions and returns to app to accept
Given the User has completed on-boarding
And the User was on the Terms and Conditions screen
And the user has pressed the back button
And the user was taken back to the on-boarding screen
When they have closed the app
And they relaunch the app
Then they can accept the Terms and conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def step_impl(context):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
''')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def step_impl(context, using_the_app):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the user has a credential offer
Expand All @@ -161,7 +160,6 @@ def step_impl(context, using_the_app):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
And a connection has been successfully made
And the holder has a Non-Revocable credential
Expand Down
2 changes: 0 additions & 2 deletions aries-mobile-tests/features/steps/bc_wallet/proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ def step_impl(context):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
And the Holder has selected to use biometrics to unlock BC Wallet
''')

Expand All @@ -392,7 +391,6 @@ def step_impl(context):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "369369"
And the User allows notifications
''')


Expand Down
19 changes: 10 additions & 9 deletions aries-mobile-tests/features/steps/bc_wallet/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def step_impl(context):
context.execute_steps(f'''
Given the User is on the Terms and Conditions screen
And the users accepts the Terms and Conditions
And the user clicks continue
''')


Expand All @@ -51,16 +50,14 @@ def step_impl(context, pin):
@then('the User selects Create PIN')
@when('the User selects Create PIN')
def step_impl(context):
# context.thisOnboardingBiometricsPage = context.thisPINSetupPage.create_pin()
# context.thisOnboardingBiometricsPage.on_this_page()

context.thisEnableNotificationsPage = context.thisPINSetupPage.create_pin()
context.thisOnboardingBiometricsPage = context.thisPINSetupPage.create_pin()


@step('the User allows notifications')
def step_enable_notifications(context):
assert context.thisEnableNotificationsPage.on_this_page()
context.thisOnboardingBiometricsPage = context.thisEnableNotificationsPage.select_continue()
context.thisInitializationPage = context.thisEnableNotificationsPage.select_continue()
#context.thisOnboardingBiometricsPage = context.thisEnableNotificationsPage.select_continue()
# Capabilities are setup to automatically accept system alerts.
#context.thisEnableNotificationsSystemModal = context.thisEnableNotificationsPage.select_continue()
#assert context.thisEnableNotificationsSystemModal.on_this_page()
Expand All @@ -71,13 +68,14 @@ def step_enable_notifications(context):
assert context.thisEnableNotificationsPage.on_this_page()
context.thisEnableNotificationsSystemModal = context.thisEnableNotificationsPage.select_continue()
assert context.thisEnableNotificationsSystemModal.on_this_page()
context.thisOnboardingBiometricsPage = context.thisEnableNotificationsSystemModal.select_dont_allow()
context.thisInitializationPage = context.thisEnableNotificationsSystemModal.select_dont_allow()

@when('the User selects to use Biometrics')
def step_impl(context):
assert context.thisOnboardingBiometricsPage.on_this_page()
assert context.thisOnboardingBiometricsPage.select_biometrics()
context.thisInitializationPage = context.thisOnboardingBiometricsPage.select_continue()
#context.thisInitializationPage = context.thisOnboardingBiometricsPage.select_continue()
context.thisEnableNotificationsPage = context.thisOnboardingBiometricsPage.select_continue()
context.device_service_handler.biometrics_authenticate(True)

@then('they have access to the app')
Expand Down Expand Up @@ -140,8 +138,10 @@ def step_impl(context):
context.biometrics_choosen = True
context.execute_steps('''
When the User selects to use Biometrics
And the User allows notifications
Then they land on the Home screen
''')


@when('they have closed the app')
@given('they have closed the app')
Expand Down Expand Up @@ -256,8 +256,9 @@ def step_access_app_with_pin(context):
@given('the User has choosen not to use biometrics to unlock BC Wallet')
def step_impl(context):
context.biometrics_choosen = False
context.thisInitializationPage = context.thisOnboardingBiometricsPage.select_continue()
context.thisEnableNotificationsPage = context.thisOnboardingBiometricsPage.select_continue()
context.execute_steps('''
Given the User allows notifications
Then they land on the Home screen
''')

Expand Down
7 changes: 1 addition & 6 deletions aries-mobile-tests/features/steps/bc_wallet/terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ def step_impl(context):
@given('the users accepts the Terms and Conditions')
@when('the users accepts the Terms and Conditions')
def step_impl(context):
context.thisTermsAndConditionsPage.select_accept()
context.thisPINSetupPage = context.thisTermsAndConditionsPage.select_accept()

@given('the user clicks continue')
@when('the user clicks continue')
def step_impl(context):
context.thisPINSetupPage = context.thisTermsAndConditionsPage.select_continue()


@given('the User is on the PIN creation screen')
Expand All @@ -71,7 +67,6 @@ def step_impl(context):
context.execute_steps(f'''
Given the User is on the Terms and Conditions screen
Given the users accepts the Terms and Conditions
When the user clicks continue
Then the user transitions to the PIN creation screen
''')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def an_existing_wallet_user(context, actor=None):
Given the User has completed on-boarding
And the User has accepted the Terms and Conditions
And a PIN has been set up with "{pin}"
And the User allows notifications
''')
if biometrics == 'on':
context.execute_steps('''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from appium.webdriver.common.appiumby import AppiumBy
from pageobjects.basepage import BasePage, WaitCondition
from pageobjects.bc_wallet.onboarding_biometrics import OnboardingBiometricsPage
from pageobjects.bc_wallet.initialization import InitializationPage

# These classes can inherit from a BasePage to do common setup and functions
class EnableNotificationsPage(BasePage):
Expand All @@ -24,7 +24,7 @@ def on_this_page(self):
def select_continue(self):
self.find_by(self.continue_locator, wait_condition=WaitCondition.ELEMENT_TO_BE_CLICKABLE).click()

return OnboardingBiometricsPage(self.driver)
return InitializationPage(self.driver)


class EnableNotificationsSystemModal(BasePage):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from appium.webdriver.common.appiumby import AppiumBy
from pageobjects.basepage import BasePage
from pageobjects.bc_wallet.initialization import InitializationPage
from pageobjects.bc_wallet.enable_notifications import EnableNotificationsPage

class OnboardingBiometricsPage(BasePage):
"""Onboarding Biometrics page object"""
Expand Down Expand Up @@ -32,7 +32,8 @@ def select_continue(self):
if self.on_this_page():
self.find_by(self.continue_button_locator).click()

# return the wallet initialization page
return InitializationPage(self.driver)
# return the wallet enable notifications page
return EnableNotificationsPage(self.driver)

else:
raise Exception(f"App not on the {type(self)} page")
6 changes: 3 additions & 3 deletions aries-mobile-tests/pageobjects/bc_wallet/pinsetup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from appium.webdriver.common.appiumby import AppiumBy
from pageobjects.basepage import BasePage
from pageobjects.bc_wallet.enable_notifications import EnableNotificationsPage
from pageobjects.bc_wallet.onboarding_biometrics import OnboardingBiometricsPage


class PINSetupPage(BasePage):
Expand Down Expand Up @@ -58,8 +58,8 @@ def get_second_pin(self):
def create_pin(self):
self.find_by(self.create_pin_button_tid_locator).click()

# return the wallet enable notifications page
return EnableNotificationsPage(self.driver)
# return the wallet biometrics page
return OnboardingBiometricsPage(self.driver)

def does_pin_match(self, header: str = "PINs do not match"):
if self.on_this_page():
Expand Down
Loading

0 comments on commit 7f0cef0

Please sign in to comment.