-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests: add sidebar tests -p3 #3211
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ import * as constants from '../../support/constants' | |
import * as main from '../pages/main.page' | ||
import * as sideBar from '../pages/sidebar.pages' | ||
import * as ls from '../../support/localstorage_data.js' | ||
import * as assets from '../pages/assets.pages.js' | ||
|
||
const newSafeName = 'Added safe 3' | ||
const oldSafeName = 'Added safe 2' | ||
const oldSafeName = 'Added safe 900' | ||
const staticSafe100 = 'Added safe 100' | ||
const staticSafe200 = 'Added safe 200' | ||
|
||
describe('Sidebar added sidebar tests', () => { | ||
beforeEach(() => { | ||
cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_13) | ||
cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_13) | ||
cy.wait(2000) | ||
cy.clearLocalStorage() | ||
main.acceptCookies() | ||
|
@@ -45,4 +47,19 @@ describe('Sidebar added sidebar tests', () => { | |
sideBar.openSidebar() | ||
sideBar.verifySafeReadOnlyState(staticSafe100) | ||
}) | ||
|
||
it('Verify Fiat currency changes when edited in the assets tab', () => { | ||
assets.changeCurrency(constants.currencies.cad) | ||
sideBar.checkCurrencyInHeader(constants.currencies.cad) | ||
}) | ||
|
||
it('Verify "wallet" tag counter if the safe has tx ready for execution', () => { | ||
sideBar.openSidebar() | ||
sideBar.verifyMissingSignature(staticSafe200) | ||
}) | ||
|
||
it('Verify "Wallet" tag counter only shows for owners', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with this description, is not correct. The gray tag with the "check" icon shows how many tx are in queue for everyone (owners, non-owners, disconnected users) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is original test title taken from our hub of tests and scheduled for automation, the implementation is according to the title. If there are changes needed in updating test title, we can do this later, outside of the scope of this task. |
||
sideBar.openSidebar() | ||
sideBar.verifyQueuedTx(staticSafe200) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as constants from '../../support/constants.js' | ||
import * as main from '../pages/main.page.js' | ||
import * as sideBar from '../pages/sidebar.pages.js' | ||
import * as navigation from '../pages/navigation.page.js' | ||
import * as ls from '../../support/localstorage_data.js' | ||
|
||
const addedOwner = 'Added owner' | ||
const addedNonowner = 'Added non-owner' | ||
|
||
describe('Sidebar non-owner tests', () => { | ||
beforeEach(() => { | ||
cy.visit(constants.homeUrl + constants.SEPOLIA_TEST_SAFE_17_SIDEBAR_NONOWNER) | ||
cy.wait(2000) | ||
cy.clearLocalStorage() | ||
main.acceptCookies() | ||
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addedSafes, ls.addedSafes.set3) | ||
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__addressBook, ls.addressBookData.addedSafes) | ||
}) | ||
|
||
it('Verify New Transaction button enabled for users with Spending limits allowed', () => { | ||
navigation.verifyTxBtnStatus(constants.enabledStates.enabled) | ||
}) | ||
|
||
it('Verify tag counting queue tx show for owners and non-owners', () => { | ||
sideBar.openSidebar() | ||
sideBar.verifyQueuedTx(addedOwner).contains(2) | ||
sideBar.verifyQueuedTx(addedNonowner).contains(2) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ const CurrencySelect = (): ReactElement => { | |
<InputLabel id="currency-label">Currency</InputLabel> | ||
|
||
<Select | ||
data-testid="currency-selector" | ||
labelId="currency-label" | ||
id="currency" | ||
value={currency.toUpperCase()} | ||
|
@@ -43,7 +44,7 @@ const CurrencySelect = (): ReactElement => { | |
onClose={() => handleTrack('Close')} | ||
> | ||
{fiatCurrencies.map((item) => ( | ||
<MenuItem key={item} value={item} sx={{ overflow: 'hidden' }}> | ||
<MenuItem data-testid="currency-item" key={item} value={item} sx={{ overflow: 'hidden' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a big fan of having a data test id that should be unique in several elements. Is there a way to have it being "currency-item-1", "currency-item-2", ... ? Not a blocker if not possible/too cumbersome to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to keep these data-testeds as is, this is a common practise to assign data-testid for the same element types which can be accessed through Cypress in more precise way. |
||
{item.toUpperCase()} | ||
</MenuItem> | ||
))} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test description is not correct. That counter counts how many tx in queue the current connected owner can sign, not necesarely they can be executed.
Change it to something like "Verify "wallet" tag counter of tx that need signature from current owner"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is original test title taken from our hub of tests and scheduled for automation, the implementation is according to the title. If there are changes needed in updating test title, we can do this later, outside of the scope of this task.