Skip to content

Commit

Permalink
Tests: Update tx builder and add tx history tests to smoke suite (#3020)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca authored Dec 15, 2023
1 parent 17f6261 commit 4a87e96
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 52 deletions.
37 changes: 0 additions & 37 deletions cypress/e2e/regression/tx_history.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,41 +54,13 @@ describe('Tx history tests 1', () => {
})

// Token receipt
it('Verify summary for token receipt', () => {
createTx.verifySummaryByName(
typeReceive.summaryTitle,
typeReceive.summaryTxInfo,
[typeReceive.summaryTxInfo, typeGeneral.statusOk],
typeReceive.altTmage,
)
})

it('Verify exapanded details for token receipt', () => {
createTx.clickOnTransactionItemByName(typeReceive.summaryTitle, typeReceive.summaryTxInfo)
createTx.verifyExpandedDetails([
typeReceive.title,
typeReceive.receivedFrom,
typeReceive.senderAddress,
typeReceive.transactionHash,
])
})

it('Verify copy button copies tx hash', () => {
createTx.clickOnTransactionItemByName(typeReceive.summaryTitle, typeReceive.summaryTxInfo)
createTx.verifyNumberOfCopyIcons(2)
createTx.verifyCopyIconWorks(1, typeReceive.transactionHashCopied)
})

// Token send
it('Verify summary for token send', () => {
createTx.verifySummaryByName(
typeSend.title,
[typeSend.summaryTxInfo, typeGeneral.statusOk],
typeSend.altImage,
typeSend.altToken,
)
})

it('Verify exapanded details for token send', () => {
createTx.clickOnTransactionItemByName(typeSend.title, typeSend.summaryTxInfo)
createTx.verifyExpandedDetails([typeSend.sentTo, typeSend.recipientAddress, typeSend.transactionHash])
Expand Down Expand Up @@ -153,15 +125,6 @@ describe('Tx history tests 1', () => {
})

// Spending limit deletion
it('Verify summary for allowance deletion', () => {
createTx.verifySummaryByName(
typeDeleteAllowance.title,
typeDeleteAllowance.summaryTxInfo,
[typeDeleteAllowance.summaryTxInfo, typeGeneral.statusOk],
typeDeleteAllowance.altImage,
)
})

it('Verify exapanded details for allowance deletion', () => {
createTx.clickOnTransactionItemByName(typeDeleteAllowance.title, typeDeleteAllowance.summaryTxInfo)
createTx.verifyExpandedDetails([
Expand Down
13 changes: 0 additions & 13 deletions cypress/e2e/regression/tx_history_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ describe('Tx history tests 2', () => {
})

// On-chain rejection
it('Verify summary for on-chain rejection', () => {
createTx.verifySummaryByName(typeOnchainRejection.title, [typeGeneral.statusOk], typeOnchainRejection.altImage)
})

it('Verify exapanded details for on-chain rejection', () => {
createTx.clickOnTransactionItemByName(typeOnchainRejection.title)
createTx.verifyExpandedDetails([
Expand All @@ -44,15 +40,6 @@ describe('Tx history tests 2', () => {
})

// Batch transaction
it('Verify summary for batch', () => {
createTx.verifySummaryByName(
typeBatch.title,
typeBatch.summaryTxInfo,
[typeBatch.summaryTxInfo, typeGeneral.statusOk],
typeBatch.altImage,
)
})

it('Verify exapanded details for batch', () => {
createTx.clickOnTransactionItemByName(typeBatch.title, typeBatch.summaryTxInfo)
createTx.verifyExpandedDetails(
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/safe-apps/tx-builder.spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => {
getBody().findByText(safeapps.sendBatchStr).click()
})
cy.get('h4').contains(safeapps.transactionBuilderStr).should('be.visible')
cy.findAllByText(safeapps.testNativeTransfer).should('have.length', 3)
cy.findAllByText(safeapps.testBooleanValue).should('have.length', 3)
navigation.clickOnModalCloseBtn()
cy.enter(iframeSelector).then((getBody) => {
getBody().findAllByText(constants.SEPOLIA_CONTRACT_SHORT).should('have.length', 3)
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('Transaction Builder tests', { defaultCommandTimeout: 20000 }, () => {
getBody().findByText(safeapps.sendBatchStr).click()
})
cy.get('h4').contains(safeapps.transactionBuilderStr).should('be.visible')
cy.findAllByText(safeapps.testNativeTransfer).should('have.length', 2)
cy.findAllByText(safeapps.testAddressValueStr).should('have.length', 2)
navigation.clickOnModalCloseBtn()
cy.enter(iframeSelector).then((getBody) => {
getBody().findAllByText(constants.SEPOLIA_CONTRACT_SHORT).should('have.length', 2)
Expand Down
70 changes: 70 additions & 0 deletions cypress/e2e/smoke/tx_history.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as createTx from '../pages/create_tx.pages'
import * as data from '../../fixtures/txhistory_data_data.json'

const typeOnchainRejection = data.type.onchainRejection
const typeBatch = data.type.batchNativeTransfer
const typeReceive = data.type.receive
const typeSend = data.type.send
const typeDeleteAllowance = data.type.deleteSpendingLimit
const typeGeneral = data.type.general

describe('[SMOKE] Tx history tests', () => {
beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.transactionsHistoryUrl + constants.SEPOLIA_TEST_SAFE_8)
main.acceptCookies()
})

// Token receipt
it('[SMOKE] Verify summary for token receipt', () => {
createTx.verifySummaryByName(
typeReceive.summaryTitle,
typeReceive.summaryTxInfo,
[typeReceive.summaryTxInfo, typeGeneral.statusOk],
typeReceive.altTmage,
)
})

it('[SMOKE] Verify exapanded details for token receipt', () => {
createTx.clickOnTransactionItemByName(typeReceive.summaryTitle, typeReceive.summaryTxInfo)
createTx.verifyExpandedDetails([
typeReceive.title,
typeReceive.receivedFrom,
typeReceive.senderAddress,
typeReceive.transactionHash,
])
})

it('[SMOKE] Verify summary for token send', () => {
createTx.verifySummaryByName(
typeSend.title,
[typeSend.summaryTxInfo, typeGeneral.statusOk],
typeSend.altImage,
typeSend.altToken,
)
})

it('[SMOKE] Verify summary for on-chain rejection', () => {
createTx.verifySummaryByName(typeOnchainRejection.title, [typeGeneral.statusOk], typeOnchainRejection.altImage)
})

it('[SMOKE] Verify summary for batch', () => {
createTx.verifySummaryByName(
typeBatch.title,
typeBatch.summaryTxInfo,
[typeBatch.summaryTxInfo, typeGeneral.statusOk],
typeBatch.altImage,
)
})

it('[SMOKE] Verify summary for allowance deletion', () => {
createTx.verifySummaryByName(
typeDeleteAllowance.title,
typeDeleteAllowance.summaryTxInfo,
[typeDeleteAllowance.summaryTxInfo, typeGeneral.statusOk],
typeDeleteAllowance.altImage,
)
})
})

0 comments on commit 4a87e96

Please sign in to comment.