-
Notifications
You must be signed in to change notification settings - Fork 96
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
Create text descriptions for e2e tests - Closes #1516 #1523
Changes from all commits
6a5fb9e
8702531
b1ec74d
5087823
ee46342
389ce57
91dbcad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
const ss = { | ||
app: '#app', | ||
transactoinsTable: '.transaction-results', | ||
transactionRow: '.transactions-row', | ||
seeAllTxsBtn: '.seeAllLink', | ||
txDetailsBackButton: '.transaction-details-back-button', | ||
recipientInput: '.recipient input', | ||
accountInfoTab: '.account-info', | ||
delegateStatisticsTab: '.delegate-statistics ', | ||
votedAddress: '.votes .voter-address', | ||
voterAdress: '.voters .voter-address', | ||
delegateName: '.delegate-name', | ||
accountAddress: '.copy-title', | ||
searchInput: '#autosuggest-input', | ||
showMoreVotesBtn: '.show-votes', | ||
leftBlockAccountExplorer: '.explorer-account-left-block', | ||
amountInput: '.amount input', | ||
bookmarkInput: '#bookmark-input', | ||
bookmarkList: '.bookmarkList', | ||
nextTransferBtn: '.send-next-button', | ||
sendBtn: '.send-button', | ||
transactionAddress: '.transaction-address span', | ||
chooseDelegateName: '.choose-name', | ||
delegateNameInput: '.delegate-name input', | ||
submitDelagateNameBtn: '.submit-delegate-name', | ||
successText: '.success-description', | ||
goToDashboardAfterDelegateReg: '.registration-success', | ||
confirmDelegateRegBtn: '.confirm-delegate-registration', | ||
spinner: '.spinner', | ||
transactionReference: '.transaction-reference', | ||
transactionAmount: '.transactionAmount span', | ||
transactionAmountPlaceholder: '.transactionAmount', | ||
delegateDuplicateNameError: '.error-name-duplicate', | ||
headerBalance: '.balance span', | ||
nextBtn: '.next', | ||
txHeader: '.tx-header', | ||
txSenderAddress: '.sender-address', | ||
txRecipientAddress: '.receiver-address', | ||
txDatePlaceholder: '.tx-date', | ||
txDate: '.tx-date .date', | ||
txTime: '.tx-time .time', | ||
txAddedVotes: '.tx-added-votes .voter-address', | ||
txRemovedVotes: '.tx-removed-votes .voter-address', | ||
txAmount: '.tx-amount .transactionAmount', | ||
txFee: '.tx-fee span', | ||
txConfirmations: '.tx-confirmation', | ||
txId: '.tx-id .copy-title', | ||
txReference: '.tx-reference', | ||
delegateResults: '.delegates-result', | ||
transactionResults: '.transactions-result', | ||
recentSearches: '.addresses-result', | ||
idResults: '.addresses-result', | ||
closeSearchBtn: '.autosuggest-btn-close', | ||
accountBalance: '.balance span', | ||
transactionId: '.transaction-id .copy-title', | ||
logoutBtn: '.logout', | ||
dialogButtons: '.ok-button', | ||
emptyResultsMessage: '.empty-message', | ||
revealCheckbox: '.reveal-checkbox', | ||
passphraseTextarea: 'textarea.passphrase', | ||
itsSafeBtn: '.yes-its-safe-button', | ||
passphraseWordHolder: '.passphrase-holder label', | ||
getToDashboardBtn: '.get-to-your-dashboard-button', | ||
confirmCheckbox: '.confirm-checkbox', | ||
sidebarMenuSettingsBtn: '#settings', | ||
registerSecondPassphraseBtn: '.register-second-passphrase', | ||
secondPassphraseIsRegisteredLabel: '.second-passphrase-registered', | ||
currencyUSDBtn: '.currency-USD', | ||
currencyEURBtn: '.currency-EUR', | ||
autoLogoutTrigger: '.autoLog', | ||
switchNetworksTrigger: '.showNetwork', | ||
delegateFeaturesTrigger: '.advancedMode', | ||
messageInput: 'textarea', | ||
resulteBtn: '.result', | ||
sidebarMenuWalletBtn: '#transactions', | ||
referenceInput: '.reference input', | ||
convertorElement: '.convertor', | ||
convertedPrice: '.converted-price', | ||
secondPassphraseInput: '.second-passphrase input', | ||
secondPassphraseNextBtn: '.second-passphrase-next', | ||
resultMessage: '.result-box-message', | ||
okayBtn: '.okay-button', | ||
accountInitializationMsg: '.account-initialization', | ||
accountInitializationBtn: '.account-init-button', | ||
sidebarMenuDelegatesBtn: '#delegates', | ||
becomeDelegateLink: '.register-delegate', | ||
votesConfirmSidebar: '.confirm-votes', | ||
confirmBtn: '.confirm', | ||
delegateRow: '.delegate-row', | ||
delegateList: '.delegate-list', | ||
delegateRank: '.delegate-rank', | ||
delegateId: '.delegate-id', | ||
delegateProductivity: '.delegate-productivity', | ||
searchDelegateInput: 'input.search', | ||
voteCheckbox: '.vote-checkbox', | ||
voteResultHeader: '.result-box-header', | ||
clearSearchBtn: '.clean-icon', | ||
votesPreselection: '.upvotes-message', | ||
unvotesPreselection: '.unvotes-message', | ||
alreadyVotedPreselection: '.alreadyVoted-message', | ||
addFollowerAccountButton: '.add-account-button', | ||
addressInput: '.address input', | ||
followedAccountItem: '.followed-account', | ||
titleInput: '.account-title input', | ||
followedAccountBalance: '.followed-account-balance', | ||
sidebarMenuHelpBtn: '#help', | ||
startOnBoardingLink: '.help-onboarding', | ||
onBoardingTooltipPrimaryBtn: '.joyride-tooltip__button--primary', | ||
onBoardingSkipBtn: '.joyride-tooltip__button--skip', | ||
onBoardingHeader: '.joyride-tooltip__header', | ||
createLiskIdBtn: '.new-account-button', | ||
passphraseInput: '.passphrase input', | ||
loginBtn: '.login-button', | ||
networkDropdown: '.network', | ||
headerAddress: '.copy-title', | ||
nodeAddress: '.peer', | ||
networkStatus: '.network-status', | ||
errorPopup: '.toast', | ||
newsBlock: '.news-item', | ||
editNewsFeed: '.settingsButton', | ||
settingsNewsFeedBlock: '.settingsNewsFeed', | ||
getPassphraseButton: '.get-passphrase-button', | ||
iUnderstandCheckbox: '.i-understand-checkbox', | ||
editFollowingAccounts: '.edit-accounts', | ||
removeFollowingAccount: '.remove-account', | ||
followedAccount: '.followed-account', | ||
followedAccountTitle: '.account-title input', | ||
takeTutorial: '.help-onboarding', | ||
tutorialTooltip: '.joyride-tooltip__header', | ||
}; | ||
|
||
export default ss; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,8 @@ | ||
import accounts from '../../constants/accounts'; | ||
import networks from '../../constants/networks'; | ||
import ss from '../../constants/selectors'; | ||
import urls from '../../constants/urls'; | ||
|
||
const ss = { | ||
transactoinsTable: '.transaction-results', | ||
transactionRow: '.transactions-row', | ||
seeAllBtn: '.seeAllLink', | ||
transactionDetailBackButton: '.transaction-details-back-button', | ||
recipientInput: '.recipient input', | ||
accountInfoTab: '.account-info', | ||
delegateStatisticsTab: '.delegate-statistics ', | ||
votedAdress: '.votes .voter-address', | ||
voterAdress: '.voters .voter-address', | ||
delegateName: '.delegate-name', | ||
accountAddress: '.copy-title', | ||
searchInput: '#autosuggest-input', | ||
showMoreVotesBtn: '.show-votes', | ||
explorerAccountLeftBlock: '.explorer-account-left-block', | ||
}; | ||
|
||
/** | ||
* To remove the effect of activating the All tab back after full load | ||
|
@@ -29,22 +14,36 @@ describe('Dashboard Activity', () => { | |
beforeEach(() => { | ||
cy.autologin(accounts.genesis.passphrase, networks.devnet.node); | ||
}); | ||
/** | ||
* 5 transaction are shown in the latest activity component | ||
* @expect 5 transactions | ||
*/ | ||
it('5 tx are shown', () => { | ||
cy.visit(urls.dashboard); | ||
cy.get(ss.transactionRow).should('have.length', 5); | ||
}); | ||
|
||
/** | ||
* Click on transaction row leads to tx details page | ||
* @expect url | ||
* @expect some specific to page element is present on it | ||
*/ | ||
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 here, like go to details page when a row is being click in this page or component 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 think both descriptions (Andrei's and Osvaldo's) are the same clear. |
||
it('Click leads to tx details', () => { | ||
cy.visit(urls.dashboard); | ||
cy.get(ss.transactionRow).eq(0).click(); | ||
cy.url().should('contain', 'wallet?id='); | ||
cy.get(ss.transactionDetailBackButton); | ||
cy.url().should('contain', `${urls.wallet}?id=`); | ||
cy.get(ss.txDetailsBackButton); | ||
}); | ||
|
||
/** | ||
* 'See all transactions' link leads to wallet page | ||
* @expect url | ||
* @expect some specific to page element is present on it | ||
*/ | ||
it('See all leads to wallet activity', () => { | ||
cy.visit(urls.dashboard); | ||
cy.get(ss.seeAllBtn).click(); | ||
cy.url().should('contain', 'wallet'); | ||
cy.get(ss.seeAllTxsBtn).click(); | ||
cy.url().should('contain', `${urls.wallet}`); | ||
cy.get(ss.recipientInput); | ||
}); | ||
}); | ||
|
@@ -65,44 +64,58 @@ describe('Dashboard Activity', () => { | |
beforeEach(() => { | ||
cy.autologin(accounts.genesis.passphrase, networks.devnet.node); | ||
}); | ||
/** | ||
* Scrolling down triggers loading another portion of txs | ||
* @expect more txs are present | ||
*/ | ||
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 here like, load more transactions when scroll is placed in the bottom of the page. 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 here, same amount of clearness to me. |
||
it('25 tx are shown, scrolling loads another 25', () => { | ||
testSet.open(); | ||
cy.get(ss.transactionRow).should('have.length', 25); | ||
cy.get('.transaction-results').scrollTo('bottom'); | ||
cy.get('.transactions-row').should('have.length', 50); | ||
cy.get(ss.transactoinsTable).scrollTo('bottom'); | ||
cy.get(ss.transactionRow).should('have.length', 50); | ||
}); | ||
|
||
/** | ||
* Click on transaction row leads to tx details page | ||
* @expect url | ||
* @expect some specific to page element is present on it | ||
*/ | ||
it('Click leads to tx details', () => { | ||
testSet.open(); | ||
cy.get(ss.transactionRow).eq(0).click(); | ||
cy.url().should('contain', '?id='); | ||
cy.get(ss.transactionDetailBackButton); | ||
cy.get(ss.txDetailsBackButton); | ||
}); | ||
|
||
describe('Account info tabs', () => { | ||
beforeEach(() => { | ||
cy.autologin(accounts.genesis.passphrase, networks.devnet.node); | ||
}); | ||
it('Shows 101 votes', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.accountInfoTab).click(); | ||
}); | ||
/** | ||
* Maximum possible number of voted accounts is shown | ||
* @expect 101 are shown | ||
*/ | ||
it('Shows 101 votes', () => { | ||
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. here too, like Display the maximum amount of voted delegates (101) 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. here too :-) Andrei's passive tense is fine. |
||
cy.get(ss.showMoreVotesBtn).click(); | ||
cy.get(ss.votedAdress).should('have.length', 101); | ||
cy.get(ss.votedAddress).should('have.length', 101); | ||
}); | ||
|
||
/** | ||
* Shows voted delegate's nickname, not address | ||
* @expect delegate's nickname shown | ||
*/ | ||
it('Shows voted delegate nickname ', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.accountInfoTab).click(); | ||
cy.get(ss.votedAdress).eq(0).should('have.text', 'genesis_1 '); | ||
cy.get(ss.votedAddress).eq(0).should('have.text', 'genesis_1 '); | ||
}); | ||
|
||
/** | ||
* Click on voted delegate leads to account page | ||
* @expect corresponding delegate name is shown on account's page | ||
*/ | ||
it('Click on voted delegate leads to account page', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.accountInfoTab).click(); | ||
cy.get(ss.votedAdress).eq(0).click(); | ||
cy.get(ss.votedAddress).eq(0).click(); | ||
cy.get(ss.delegateName).should('have.text', 'genesis_1'); | ||
}); | ||
}); | ||
|
@@ -124,44 +137,55 @@ describe('Dashboard Activity', () => { | |
describe(testSet.name, () => { | ||
beforeEach(() => { | ||
cy.autologin(accounts.delegate.passphrase, networks.devnet.node); | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
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. The testing talk at React Day was talking about not doing this - each |
||
}); | ||
describe('Delegate statistics tab', () => { | ||
/** | ||
* Shows voted delegate's nickname not addresses | ||
* @expect delegate's nickname shown | ||
*/ | ||
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. Please change this too, for be honest I think I know what you meant to say but dont understand for be honest so, I dont know how should be display 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 can be better English. What about |
||
it('Shows voted delegate nickname ', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
cy.get(ss.votedAdress).eq(0).should('have.text', 'genesis_17 '); | ||
cy.get(ss.votedAddress).eq(0).should('have.text', 'genesis_17 '); | ||
}); | ||
|
||
/** | ||
* Click on voted delegate leads to account page | ||
* @expect corresponding delegate name is shown on account's page | ||
*/ | ||
it('Click on voted delegate leads to account page', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
cy.get(ss.votedAdress).eq(0).click(); | ||
cy.get(ss.votedAddress).eq(0).click(); | ||
cy.get(ss.delegateName).should('have.text', 'genesis_17'); | ||
}); | ||
|
||
|
||
// TODO Fix after corresponding bugfix | ||
/** | ||
* Shows nickname of account on "Who voted for this delegate?" | ||
* list if the account is a delegate | ||
* @expect voters nickname shown | ||
*/ | ||
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 comment is hard to understand can you please change it 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 understand what is meant by |
||
xit('Shows voters nickname if it is delegate', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
cy.get(ss.voterAdress).eq(0).should('have.text', 'genesis_1 '); | ||
}); | ||
|
||
/** | ||
* Shows address of account on "Who voted for this delegate?" | ||
* list if the account is not a delegate | ||
* @expect voters address shown | ||
*/ | ||
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. as this is a comment you can remove the dash, and maybe if possible put something more descriptive |
||
it('Shows voters address if it is not delegate', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
cy.get(ss.voterAdress).eq(1).should('have.text', '16313739661670634666L '); | ||
}); | ||
|
||
/** | ||
* Click on voter leads to account page | ||
* @expect according delegate name is shown on account's page | ||
*/ | ||
it('Click on voter leads to account page', () => { | ||
testSet.open(); | ||
waitBeforeChangeTabAfterLoading(); | ||
cy.get(ss.delegateStatisticsTab).click(); | ||
cy.get(ss.voterAdress).eq(1).click(); | ||
cy.get(ss.explorerAccountLeftBlock).find(ss.accountAddress).should('have.text', '16313739661670634666L'); | ||
cy.get(ss.leftBlockAccountExplorer).find(ss.accountAddress).should('have.text', '16313739661670634666L'); | ||
}); | ||
}); | ||
}); | ||
|
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.
Plase try write something more easy to understand like display 5 transaction in the last activity page or component, it is ok but something easy to understand will be better
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.
I like Andrei's description form, but agree it could say
latest activity component/module