enhanced create random address test cases
This commit is contained in:
parent
4a02a33226
commit
356e016da4
|
@ -1,3 +1,4 @@
|
||||||
|
from time import time
|
||||||
from telenium.client import TeleniumHttpException
|
from telenium.client import TeleniumHttpException
|
||||||
from .telenium_process import TeleniumTestProcess
|
from .telenium_process import TeleniumTestProcess
|
||||||
from .common import ordered
|
from .common import ordered
|
||||||
|
@ -7,24 +8,49 @@ from string import ascii_lowercase
|
||||||
class CreateRandomAddress(TeleniumTestProcess):
|
class CreateRandomAddress(TeleniumTestProcess):
|
||||||
"""This is for testing randrom address creation"""
|
"""This is for testing randrom address creation"""
|
||||||
|
|
||||||
@classmethod
|
@staticmethod
|
||||||
def populate_test_data(cls):
|
def populate_test_data():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ordered
|
@ordered
|
||||||
def test_login_screen(self):
|
def test_login_screen(self):
|
||||||
|
# import pdb; pdb.set_trace()
|
||||||
"""Click on Proceed Button to Proceed to Next Screen."""
|
"""Click on Proceed Button to Proceed to Next Screen."""
|
||||||
# Checking current Screen(Login screen)
|
# Checking current Screen(Login screen)
|
||||||
self.assert_wait_no_except('//ScreenManager[@current]', timeout=15, value='login')
|
self.assert_wait_no_except('//ScreenManager[@current]', timeout=20, value='login')
|
||||||
# Clicking on Proceed Next Button
|
# Clicking on Proceed Next Button
|
||||||
|
# print(self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active'), '------------------------')
|
||||||
|
# is_checked = self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active')
|
||||||
|
# self.assertExists("//ScreenManager[@current=\"login\"]", timeout=5)
|
||||||
|
start = time()
|
||||||
|
deadline = start + 2
|
||||||
|
while time() < deadline:
|
||||||
|
try:
|
||||||
|
# Clicking on Proceed Next Button to redirect to "random" screen
|
||||||
|
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
|
except:
|
||||||
|
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
||||||
|
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
||||||
|
|
||||||
|
# if not is_checked:
|
||||||
|
# # self.assertExists('//Screen[0]//AnchorLayout[1]//Check[@active=\"True\"]', timeout=5)
|
||||||
|
# self.cli.wait_click('//Screen[0]//AnchorLayout[1]//Check', timeout=2)
|
||||||
|
# self.assertEqual(self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active'), True)
|
||||||
|
# self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
|
# else:
|
||||||
|
# self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
|
# self.assertEqual(self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active'), True)
|
||||||
|
# # self.assertExists('//Screen[0]//AnchorLayout[1]//Check[@active~=\"True\"]', timeout=5)
|
||||||
|
|
||||||
|
|
||||||
|
# self.assertTrue(self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active'), True)
|
||||||
|
# self.assertExists('//Screen[0]//AnchorLayout[1]//Check[@active~=\"True\"]', timeout=5)
|
||||||
|
# self.assertEqual(self.cli.getattr('//Screen[0]//AnchorLayout[1]//Check[@active]', 'active'), True)
|
||||||
# self.assertExists('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
# self.assertExists('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
# self.cli.wait('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
|
# self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
||||||
try:
|
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
||||||
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
|
||||||
except TeleniumHttpException:
|
|
||||||
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
|
||||||
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
|
||||||
|
|
||||||
@ordered
|
@ordered
|
||||||
def test_random_screen(self):
|
def test_random_screen(self):
|
||||||
|
@ -46,8 +72,7 @@ class CreateRandomAddress(TeleniumTestProcess):
|
||||||
@ordered
|
@ordered
|
||||||
def test_create_new_address(self):
|
def test_create_new_address(self):
|
||||||
"""Clicking on Navigation Drawer To Open New Address"""
|
"""Clicking on Navigation Drawer To Open New Address"""
|
||||||
# New screen is opening and transition effect takes time so Sleep is used
|
# CLick to Open side Nav drawer
|
||||||
# this is for opening Nav drawer
|
|
||||||
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
self.cli.wait_click('//MDActionTopAppBarButton[@icon=\"menu\"]', timeout=3)
|
||||||
# checking state of Nav drawer
|
# checking state of Nav drawer
|
||||||
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
self.assertExists("//MDNavigationDrawer[@state~=\"open\"]", timeout=2)
|
||||||
|
@ -55,25 +80,35 @@ class CreateRandomAddress(TeleniumTestProcess):
|
||||||
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
|
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
|
||||||
# Checking state of scrolled screen
|
# Checking state of scrolled screen
|
||||||
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=3)
|
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=3)
|
||||||
# Clicking on New Address Tab
|
|
||||||
self.assertExists('//NavigationItem[@text=\"New address\"]', timeout=5)
|
self.assertExists('//NavigationItem[@text=\"New address\"]', timeout=5)
|
||||||
|
# Clicking on New Address Tab
|
||||||
self.cli.wait_click('//NavigationItem[@text=\"New address\"]', timeout=3)
|
self.cli.wait_click('//NavigationItem[@text=\"New address\"]', timeout=3)
|
||||||
self.cli.sleep(1)
|
start = time()
|
||||||
|
deadline = start + 2
|
||||||
|
while time() < deadline:
|
||||||
|
try:
|
||||||
|
# Clicking on Proceed Next Button to redirect to "random" screen
|
||||||
|
self.cli.wait_click('//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=5)
|
||||||
|
except:
|
||||||
|
# Checking Current Screen(Random Screen) after Clicking on "Proceed Next" Button
|
||||||
|
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
||||||
# Checking current Screen(Login screen)
|
# Checking current Screen(Login screen)
|
||||||
# self.assertExists("//Login[@name~=\"login\"]", timeout=3)
|
# self.assertExists("//Login[@name~=\"login\"]", timeout=3)
|
||||||
self.assertExists("//ScreenManager[@current=\"login\"]", timeout=5)
|
# self.assertExists("//ScreenManager[@current=\"login\"]", timeout=5)
|
||||||
# Click on Proceed Next button to enter 'Random' Screen
|
# Click on Proceed Next button to enter 'Random' Screen
|
||||||
self.cli.wait_click(
|
# self.cli.wait_click(
|
||||||
'//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=2)
|
# '//Screen[0]//MDFillRoundFlatIconButton[@text=\"Proceed Next\"]', timeout=2)
|
||||||
# Checking Current Screen(Random Screen) after Clicking on Proceed Next Button
|
# Checking Current Screen(Random Screen) after Clicking on Proceed Next Button
|
||||||
# self.assertExists("//Random[@name~=\"random\"]", timeout=1)
|
# self.assertExists("//Random[@name~=\"random\"]", timeout=1)
|
||||||
self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
# self.assertExists("//ScreenManager[@current=\"random\"]", timeout=5)
|
||||||
# Executing above function to create new address
|
# Executing above function to create new address
|
||||||
self.test_random_screen()
|
self.test_random_screen()
|
||||||
|
|
||||||
@ordered
|
@ordered
|
||||||
def test_select_address(self):
|
def test_select_address(self):
|
||||||
|
# import pdb; pdb.set_trace()
|
||||||
"""Select First Address From Drawer-Box"""
|
"""Select First Address From Drawer-Box"""
|
||||||
|
self.assertExists("//ScreenManager[@current=\"myaddress\"]", timeout=5)
|
||||||
# This is for checking the Side nav Bar is closed
|
# This is for checking the Side nav Bar is closed
|
||||||
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
|
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5)
|
||||||
# This is for checking the menu button is appeared
|
# This is for checking the menu button is appeared
|
||||||
|
@ -88,13 +123,16 @@ class CreateRandomAddress(TeleniumTestProcess):
|
||||||
self.assertCheckScrollUp('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
|
self.assertCheckScrollUp('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
|
||||||
# Click to open Address Dropdown
|
# Click to open Address Dropdown
|
||||||
self.cli.wait_click('//NavigationItem[0]/CustomSpinner[0]', timeout=5)
|
self.cli.wait_click('//NavigationItem[0]/CustomSpinner[0]', timeout=5)
|
||||||
|
self.assertExists('//MySpinnerOption', timeout=5)
|
||||||
|
is_open = self.cli.getattr('//NavigationItem[0]/CustomSpinner[@is_open]', 'is_open')
|
||||||
|
print(is_open, '----------------------------------<true>')
|
||||||
|
# import pdb; pdb.set_trace()
|
||||||
|
self.assertEqual(is_open, True)
|
||||||
|
self.cli.wait_click('//MySpinnerOption[0]', timeout=5)
|
||||||
|
# is_open = self.cli.getattr('//NavigationItem[0]/CustomSpinner[@is_open]', 'is_open')
|
||||||
|
# print(is_open, '----------------------------------<false>')
|
||||||
|
# self.assertEqual(is_open, False)
|
||||||
|
# self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
|
||||||
# Checking the state of dropdown (Should be open)
|
# Checking the state of dropdown (Should be open)
|
||||||
self.assertNotEqual('//NavigationItem[0]/CustomSpinner[@is_open]', False)
|
# self.assertNotEqual('//NavigationItem[0]/CustomSpinner[@is_open]', False)
|
||||||
try:
|
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
|
||||||
# Select address fron Address Dropdown
|
|
||||||
self.cli.wait_click('//MySpinnerOption[0]', timeout=5)
|
|
||||||
# Checking current screen
|
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
|
|
||||||
except TeleniumHttpException:
|
|
||||||
self.cli.wait_click('//MySpinnerOption[0]', timeout=5)
|
|
||||||
self.assertExists("//Inbox[@name~=\"inbox\"]", timeout=5)
|
|
Reference in New Issue
Block a user