Skip to content

Commit 19f1506

Browse files
emiridewklos-iohk
andauthored
test(extension): unify toast asertion (#1043)
* test(extension): unify toast asertion * test(extension): fix code formatting --------- Co-authored-by: wklos-iohk <wojciech.klos@iohk.io>
1 parent 8df74e9 commit 19f1506

16 files changed

+125
-147
lines changed

packages/e2e-tests/src/features/AdaHandleExtended.feature

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Feature: ADA handle - extended view
3737
When I fill address form with "AH 1 edited" name and "$test_handle_3" address
3838
Then Green tick icon is displayed next to ADA handle
3939
And I click "Done" button on "Edit address" drawer
40-
And I see a toast with message: "browserView.addressBook.toast.editAddress"
40+
And I see a toast with text: "Edited successfully"
4141
And I see address row with name "AH 1 edited" and address "$test_handle_3" on the list in extended mode
4242

4343
@LW-7337
@@ -58,7 +58,7 @@ Feature: ADA handle - extended view
5858
When I fill address form with "AH 1 edited" name and "$test_handle_2" address
5959
Then Green tick icon is displayed next to ADA handle
6060
And I click "Done" button on "Edit address" drawer
61-
And I see a toast with message: "addressBook.errors.givenAddressAlreadyExist"
61+
And I see a toast with text: "Given address already exists"
6262

6363
@LW-7140 @LW-7136
6464
Scenario: Extended View - Ada handles displayed and sorted by handle length
@@ -79,18 +79,23 @@ Feature: ADA handle - extended view
7979
And I see "Wallet Address" page in extended mode for wallet "WalletAdaHandle"
8080
When I click "Copy" button on "Receive" page for default wallet address
8181
Then I see a toast with text: "Address copied"
82+
And I close a toast message
8283
And Clipboard contains address of wallet: "WalletAdaHandle"
8384
When I click "Copy" button on "Receive" page for handle: "$cde"
8485
Then I see a toast with text: "Handle copied"
86+
And I close a toast message
8587
And Clipboard contains text: "$cde"
8688
When I click "Copy" button on "Receive" page for handle: "$t_h_1"
8789
Then I see a toast with text: "Handle copied"
90+
And I close a toast message
8891
And Clipboard contains text: "$t_h_1"
8992
When I click "Copy" button on "Receive" page for handle: "$test_handle_1"
9093
Then I see a toast with text: "Handle copied"
94+
And I close a toast message
9195
And Clipboard contains text: "$test_handle_1"
9296
When I click "Copy" button on "Receive" page for handle: "$test_handle_3"
9397
Then I see a toast with text: "Handle copied"
98+
And I close a toast message
9499
And Clipboard contains text: "$test_handle_3"
95100

96101
@LW-7427 @LW-7426
@@ -144,8 +149,7 @@ Feature: ADA handle - extended view
144149
And I see ADA handle NFT with custom image on the Select NFT page
145150
And the corresponding custom images are displayed
146151

147-
@LW-5025 @LW-5028 @LW-5030 @Pending
148-
@issue=LW-9885
152+
@LW-5025 @LW-5028 @LW-5030 @Pending @issue=LW-9885
149153
Scenario: Extended View - Send flow - Enter ADA handle and confirm validated
150154
When I click "Send" button on page header
151155
And I enter "$test_handle_3" in the bundle 1 recipient's address

packages/e2e-tests/src/features/AdaHandlePopup.feature

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Feature: ADA handle - popup view
3737
When I fill address form with "AH 1 edited" name and "$test_handle_3" address
3838
Then Green tick icon is displayed next to ADA handle
3939
And I click "Done" button on "Edit address" drawer
40-
And I see a toast with message: "browserView.addressBook.toast.editAddress"
40+
And I see a toast with text: "Edited successfully"
4141
And I see address row with name "AH 1 edited" and address "$test_handle_3" on the list in popup mode
4242

4343
@LW-7338
@@ -58,7 +58,7 @@ Feature: ADA handle - popup view
5858
When I fill address form with "AH 1 edited" name and "$test_handle_2" address
5959
Then Green tick icon is displayed next to ADA handle
6060
And I click "Done" button on "Edit address" drawer
61-
And I see a toast with message: "addressBook.errors.givenAddressAlreadyExist"
61+
And I see a toast with text: "Given address already exists"
6262

6363
@LW-7135 @LW-7139
6464
Scenario: Popup View - Ada handles displayed and sorted by handle length
@@ -78,18 +78,23 @@ Feature: ADA handle - popup view
7878
And I see "Wallet Address" page in popup mode for wallet "WalletAdaHandle"
7979
When I click "Copy" button on "Receive" page for default wallet address
8080
Then I see a toast with text: "Address copied"
81+
And I close a toast message
8182
And Clipboard contains address of wallet: "WalletAdaHandle"
8283
When I click "Copy" button on "Receive" page for handle: "$cde"
8384
Then I see a toast with text: "Handle copied"
85+
And I close a toast message
8486
And Clipboard contains text: "$cde"
8587
When I click "Copy" button on "Receive" page for handle: "$t_h_1"
8688
Then I see a toast with text: "Handle copied"
89+
And I close a toast message
8790
And Clipboard contains text: "$t_h_1"
8891
When I click "Copy" button on "Receive" page for handle: "$test_handle_1"
8992
Then I see a toast with text: "Handle copied"
93+
And I close a toast message
9094
And Clipboard contains text: "$test_handle_1"
9195
When I click "Copy" button on "Receive" page for handle: "$test_handle_3"
9296
Then I see a toast with text: "Handle copied"
97+
And I close a toast message
9398
And Clipboard contains text: "$test_handle_3"
9499

95100
@LW-7435 @LW-7436

packages/e2e-tests/src/features/AddressBookExtended.feature

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Feature: Address book - extended view
3636
And I click "Save address" button on "Add new address" drawer
3737
Then I see a toast with text: "Address added"
3838
And I see address row with name "<wallet_name>" and address "<address>" on the list in extended mode
39+
3940
Examples:
4041
| wallet_name | address |
4142
| Byron_manual | 37btjrVyb4KC6N6XtRHwEuLPQW2aa9JA89gbnm67PArSi8E7vGeqgA6W1pFBphc1hhrk1WKGPZpUbnvYRimVLRVnUH6M6d3dsVdxYoAC4m7oNj7Dzp |
@@ -52,6 +53,7 @@ Feature: Address book - extended view
5253
When I fill address form with "<wallet_name>" name and "<address>" address
5354
Then Contact "<name_error>" name error and "<address_error>" address error are displayed
5455
And "Save address" button is disabled on "Add new address" drawer
56+
5557
Examples:
5658
| wallet_name | address | name_error | address_error |
5759
| too_long_name_123456789 | addr_invalid | Max 20 Characters | Invalid Cardano address |
@@ -69,6 +71,7 @@ Feature: Address book - extended view
6971
And I fill address form with "<wallet_name2>" name and "<address2>" address
7072
Then Contact "<name_error>" name error and "<address_error>" address error are displayed
7173
And "Save address" button is disabled on "Add new address" drawer
74+
7275
Examples:
7376
| wallet_name | wallet_name2 | address | address2 | name_error | address_error |
7477
| name_ok | empty | 2cWKMJemoBainaQxNUjUnKDr6mGgSERDRrvKAJzWejubdymYZv1uKedpSYkkehHnSwMCf | 2cWKMJemoBainaQxNUjUnKDr6mGgSERDRrvKAJzWejubdymYZv1uKedpSYkkehHnSwMCf | Name field is required | empty |
@@ -100,19 +103,20 @@ Feature: Address book - extended view
100103
And I click "Add address" button on address book page
101104
When I fill address form with "<wallet_name>" name and address from "<wallet_address>" address
102105
And I click "Save address" button on "Add new address" drawer
103-
Then I see a toast with message: "<toast_message>"
106+
Then I see a toast with text: "<toast_message>"
107+
104108
Examples:
105-
| wallet_name | wallet_address | toast_message |
106-
| Byron | Byron | addressBook.errors.givenNameAlreadyExist |
107-
| SomeWallet | Byron | addressBook.errors.givenAddressAlreadyExist |
109+
| wallet_name | wallet_address | toast_message |
110+
| Byron | Byron | Given name already exists |
111+
| SomeWallet | Byron | Given address already exists |
108112

109113
@LW-4469
110114
Scenario: Extended-view - Address Book - Copy address button
111115
Given I close wallet synced toast
112116
And I have 3 addresses in my address book in extended mode
113117
When I click address on the list with name "Byron"
114118
And I click "Copy" button on address details page
115-
Then I see a toast with message: "general.clipboard.copiedToClipboard"
119+
Then I see a toast with text: "Copied to clipboard"
116120
And address is saved to clipboard
117121

118122
@LW-4470
@@ -124,6 +128,7 @@ Feature: Address book - extended view
124128
And I click "Done" button on "Edit address" drawer
125129
Then I see a toast with text: "Edited successfully"
126130
And I see address row with name "<wallet_name>" and address "<address>" on the list in extended mode
131+
127132
Examples:
128133
| edited_address | wallet_name | address |
129134
| Shelley | Shelley_edited | addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja |
@@ -145,17 +150,18 @@ Feature: Address book - extended view
145150
And I fill address form with "<wallet_name>" name and "<address>" address
146151
Then Contact "<name_error>" name error and "<address_error>" address error are displayed
147152
And "Done" button is disabled on "Edit address" drawer
153+
148154
Examples:
149155
| wallet_name | address | name_error | address_error |
150156
| empty | addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja | Name field is required | empty |
151157
| too_long_name_123456789 | addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja | Max 20 Characters | empty |
152158
| " name preceded by space" | addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja | Name has unnecessary white space | empty |
153-
# | valid wallet name | empty | empty | Address field is required | # TODO: Uncomment when LW-7419 is fixed
154159
| valid wallet name | invalid_address | empty | Invalid Cardano address |
155160
| valid wallet name | " addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja" | empty | Address has unnecessary white space |
156161
| valid wallet name | "addr_test1qq959a7g4spmkg4gz2yw02622c739p8crt6tzh04qzag992wcj4m99m95nmkgxhk8j0upqp2jzaxxdsj3jf9v4yhv3uqfwr6ja " | empty | Address has unnecessary white space |
157-
# | empty | empty | Name field is required | Address field is required | # TODO: Uncomment when LW-7419 is fixed
158162
| "name followed by space " | invalid_address | Name has unnecessary white space | Invalid Cardano address |
163+
# | valid wallet name | empty | empty | Address field is required | # TODO: Uncomment when LW-7419 is fixed
164+
# | empty | empty | Name field is required | Address field is required | # TODO: Uncomment when LW-7419 is fixed
159165

160166
@LW-4567
161167
Scenario Outline: Extended-view - Address Book - Edit address book entry - Uniqueness validation and toast display with text <toast_message>
@@ -164,11 +170,12 @@ Feature: Address book - extended view
164170
And I click "Edit" button on address details page
165171
And I fill address form with "<wallet_name>" name and address from "<wallet_address>" address
166172
And I click "Done" button on "Edit address" drawer
167-
Then I see a toast with message: "<toast_message>"
173+
Then I see a toast with text: "<toast_message>"
174+
168175
Examples:
169-
| wallet_name | wallet_address | toast_message |
170-
| Byron | Byron | addressBook.errors.givenNameAlreadyExist |
171-
| SomeWallet | Byron | addressBook.errors.givenAddressAlreadyExist |
176+
| wallet_name | wallet_address | toast_message |
177+
| Byron | Byron | Given name already exists |
178+
| SomeWallet | Byron | Given address already exists |
172179

173180
@LW-4535
174181
Scenario: Extended-view - Address Book - Edit address and click exit button
@@ -196,13 +203,13 @@ Feature: Address book - extended view
196203
Given I don't have any addresses added to my address book in extended mode
197204
When I click on a widget item with subtitle: "<subtitle>"
198205
Then I see a "<type>" article with title "<subtitle>"
206+
199207
Examples:
200208
| type | subtitle |
201209
| Glossary | What is the Lace address book? |
202210
| Glossary | What is a saved address? |
203211

204-
@LW-4744 @Pending
205-
@issue=LW-7697
212+
@LW-4744 @Pending @issue=LW-7697
206213
Scenario: Extended-view - Address Book - Enter and Escape buttons support when editing address
207214
Given I have 3 addresses in my address book in extended mode
208215
When I click address on the list with name "Byron"
@@ -214,7 +221,7 @@ Feature: Address book - extended view
214221
When I press keyboard Enter button
215222
And I fill address form with "Byron_edited" name and "37btjrVyb4KC6N6XtRHwEuLPQW2aa9JA89gbnm67PArSi8E7vGeqgA6W1pFBphc1hhrk1WKGPZpUbnvYRimVLRVnUH6M6d3dsVdxYoAC4m7oNj7Dzp" address
216223
When I press keyboard Enter button
217-
Then I see a toast with message: "browserView.addressBook.toast.editAddress"
224+
Then I see a toast with text: "Edited successfully"
218225

219226
@LW-4745
220227
Scenario: Extended-view - Address Book - Escape button support when closing drawer
@@ -224,8 +231,7 @@ Feature: Address book - extended view
224231
When I press keyboard Escape button
225232
Then I do not see address detail page in extended mode with details of "Byron" address
226233

227-
@LW-4779 @Pending
228-
@issue=LW-7419
234+
@LW-4779 @Pending @issue=LW-7419
229235
Scenario: Extended-view - Address Book - Display error message after filling name and clicking outside with empty address
230236
Given I don't have any addresses added to my address book in extended mode
231237
And I click "Add address" button on address book page
@@ -235,8 +241,7 @@ Feature: Address book - extended view
235241
And I click outside address form to lose focus
236242
Then Contact "empty" name error and "Address field is required" address error are displayed
237243

238-
@LW-4780 @Pending
239-
@issue=LW-7419
244+
@LW-4780 @Pending @issue=LW-7419
240245
Scenario: Extended-view - Address Book - Display error message when adding valid address and clicking outside with empty name field
241246
Given I don't have any addresses added to my address book in extended mode
242247
And I click "Add address" button on address book page
@@ -246,8 +251,7 @@ Feature: Address book - extended view
246251
And I click outside address form to lose focus
247252
Then Contact "Name field is required" name error and "empty" address error are displayed
248253

249-
@LW-4781 @Pending
250-
@issue=LW-7419
254+
@LW-4781 @Pending @issue=LW-7419
251255
Scenario: Extended-view - Address Book - No error is displayed when leaving both fields empty
252256
Given I don't have any addresses added to my address book in extended mode
253257
And I click "Add address" button on address book page
@@ -272,6 +276,7 @@ Feature: Address book - extended view
272276
And I close wallet synced toast
273277
When I add new address: "<address>" with name: "<wallet_name>" in extended mode
274278
Then I verify that address: "<address>" with name: "<wallet_name>" has been added in extended mode
279+
275280
Examples:
276281
| wallet_name | address |
277282
| example_name1 | addr_test1qzngq82mhkzqttqvdk8yl4twk4ea70ja2e7j92x9vqwatds4dm4z5j48w9mjpag2htut4g6pzfxm7x958m3wxjwc8t6q8k6txr |
@@ -295,6 +300,7 @@ Feature: Address book - extended view
295300
And I switch network to: "Mainnet" in extended mode
296301
And I open address book in extended mode
297302
Then I see address row with name "<wallet_name>" and address "<address>" on the list in extended mode
303+
298304
Examples:
299305
| wallet_name | address |
300306
| example_name2 | addr_test1qzcx0kfmglh9hg5wa7kxzt3c3e8psnm0pus38qth0wgmmljcexj60ge60d8h7nyz9ez0mzgxznr5kr6rfsemdqp74p0q9rw57j |

0 commit comments

Comments
 (0)