Skip to content

Commit 2d32735

Browse files
committed
In test cases assertEqual replaced with assertExist
1 parent d17eb6a commit 2d32735

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

src/bitmessagekivy/tests/test_myaddress_screen.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ def test_disable_address(self):
6464
)
6565
# Clicking on 'Ok' Button To Dismiss the popup
6666
self.cli.wait_click('//MDFlatButton[@text=\"Ok\"]', timeout=5)
67+
# Check the thumb button on address
68+
self.assertExists(
69+
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb",
70+
timeout=5
71+
)
6772
# Clicking on toggle button to enable the address
6873
self.cli.wait_click(
6974
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn/Thumb",
@@ -72,21 +77,24 @@ def test_disable_address(self):
7277
# Checking the address is enabled
7378
self.assertExists(
7479
"//MyAddress//CustomTwoLineAvatarIconListItem[@text=\"test2\"]//ToggleBtn[@active=true]",
75-
timeout=5
80+
timeout=15
7681
)
7782
# Checking the current screen is MyAddress
7883
self.assertExists("//MyAddress[@name~=\"myaddress\"]", timeout=5)
7984

8085
@ordered
8186
def test_show_Qrcode(self):
8287
"""Show the Qr code of selected address"""
83-
# Checking labels from addresss list
84-
first_label = self.cli.getattr('//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[1][@text]', 'text')
85-
second_label = self.cli.getattr('//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0][@text]', 'text')
8688
# Checking first label
87-
self.assertEqual(first_label, 'test1')
89+
self.assertExists(
90+
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[1][@text=\"test1\"]',
91+
timeout=5
92+
)
8893
# Checking second label
89-
self.assertEqual(second_label, 'test2')
94+
self.assertExists(
95+
'//MyAddress//MDList[0]/CustomTwoLineAvatarIconListItem[0][@text=\"test2\"]',
96+
timeout=5
97+
)
9098
# Click on Address to open popup
9199
self.cli.wait_click('//MDList[0]/CustomTwoLineAvatarIconListItem[@text=\"test1\"]', timeout=5)
92100
# Check the Popup is opened

src/bitmessagekivy/tests/test_payment_subscription.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_select_subscription(self):
1313
# Dragging from sent to inbox to get Payment tab
1414
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]")
1515
# assert for checking scroll function
16-
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=3)
16+
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=5)
1717
# this is for opening Payment screen
1818
self.cli.wait_click('//NavigationItem[@text=\"Purchase\"]', timeout=5)
1919
# Checking the navbar is in closed state
@@ -25,18 +25,20 @@ def test_select_subscription(self):
2525
'//ProductCategoryLayout[0]/ProductLayout[0]',
2626
'//ProductCategoryLayout[0]/ProductLayout[1]')
2727
# assert for checking scroll function
28-
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
28+
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=5)
2929
# Scrolling Up Product list
3030
self.drag(
3131
'//ProductCategoryLayout[0]/ProductLayout[1]',
3232
'//ProductCategoryLayout[0]/ProductLayout[0]')
3333
# assert for checking scroll function
34-
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=3)
34+
self.assertCheckScrollDown('//Payment//ScrollView[0]', timeout=5)
3535
# Click on BUY Button
36-
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=2)
37-
# assert check the buying option popup is closed
38-
self.assertExists('//PaymentMethodLayout[@disabled=false]', timeout=5)
36+
self.cli.wait_click('//MDRaisedButton[@text=\"BUY\"]', timeout=5)
37+
# CLick on the Payment Method
38+
self.cli.click_on('//ScrollView[0]//ListItemWithLabel[0]')
39+
# Check pop up is opened
40+
self.assertExists('//PaymentMethodLayout[@disabled=false]', timeout=10)
3941
# Click out side to dismiss the popup
40-
self.cli.wait_click('//MDRaisedButton[3]', timeout=2)
42+
self.cli.wait_click('//MDRaisedButton[5]', timeout=5)
4143
# Checking Current screen(Payment screen)
42-
self.assertExists("//ScreenManager[@current=\"payment\"]", timeout=3)
44+
self.assertExists("//ScreenManager[@current=\"payment\"]", timeout=5)

0 commit comments

Comments
 (0)