Skip to content

Commit

Permalink
Address comments in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca committed Sep 22, 2023
1 parent 6f07fe8 commit 3c49bc1
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/pages/create_tx.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const editBtnStr = 'Edit'
const executionParamsStr = 'Execution parameters'
const noLaterStr = 'No, later'
const signBtnStr = 'Sign'
const expandallbtnStr = 'Expand all'
const expandAllBtnStr = 'Expand all'
const collapseAllBtnStr = 'Collapse all'

export function clickOnNewtransactionBtn() {
Expand Down Expand Up @@ -133,7 +133,7 @@ export function clickOnSignTransactionBtn() {
}

export function waitForProposeRequest() {
cy.intercept('POST', constants.proposeEndPoint).as('ProposeTx')
cy.intercept('POST', constants.proposeEndpoint).as('ProposeTx')
cy.wait('@ProposeTx')
}

Expand Down Expand Up @@ -186,6 +186,6 @@ export function clickOnExpandAllBtn() {
cy.contains(expandallbtnStr).click()
}

export function lickOnCollapseAllBtn() {
export function clickOnCollapseAllBtn() {
cy.contains(collapseAllBtnStr).click()
}
6 changes: 3 additions & 3 deletions cypress/e2e/pages/safeapps.pages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as constants from '../../support/constants'

const searchappInput = 'input[id="search-by-name"]'
const searchAppInput = 'input[id="search-by-name"]'
const appUrlInput = 'input[name="appUrl"]'
const closePreviewWindowBtn = 'button[aria-label*="Close"][aria-label*="preview"]'

Expand Down Expand Up @@ -51,11 +51,11 @@ export const permissionCheckboxNames = {
fullscreen: 'Fullscreen',
}
export function typeAppName(name) {
cy.get(searchappInput).clear().type(name)
cy.get(searchAppInput).clear().type(name)
}

export function clearSearchAppInput() {
cy.get(searchappInput).clear()
cy.get(searchAppInput).clear()
}

export function verifyLinkName(name) {
Expand Down
16 changes: 8 additions & 8 deletions cypress/e2e/safe-apps/apps_list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ describe('The Safe Apps list', () => {
describe('When searching apps', () => {
it('should filter the list by app name', () => {
// Wait for /safe-apps response
cy.intercept('GET', constants.appsEndPoint).then(() => {
safeapps.typeAppName(constants.appNames.walletconnect)
cy.intercept('GET', constants.appsEndpoint).then(() => {
safeapps.typeAppName(constants.appNames.walletConnect)
safeapps.verifyLinkName(safeapps.linkNames.logo)
})
})

it('should filter the list by app description', () => {
safeapps.typeAppName(constants.appNames.customcontract)
safeapps.typeAppName(constants.appNames.customContract)
safeapps.verifyLinkName(safeapps.linkNames.logo)
})

it('should show a not found text when no match', () => {
safeapps.typeAppName(constants.appNames.noresults)
safeapps.typeAppName(constants.appNames.noResults)
safeapps.verifyNoAppsTextPresent()
})
})
Expand All @@ -50,23 +50,23 @@ describe('The Safe Apps list', () => {

describe('When adding a custom app', () => {
it('should show an error when the app manifest is invalid', () => {
cy.intercept('GET', constants.invalidappUrl, {
cy.intercept('GET', constants.invalidAppUrl, {
name: constants.testAppData.name,
})
safeapps.clickOnCustomAppsTab()
safeapps.clickOnAddCustomApp()
safeapps.typeCustomAppUrl(constants.invalidappUrl)
safeapps.typeCustomAppUrl(constants.invalidAppUrl)
safeapps.verifyAppNotSupportedMsg()
})

it('should be added to the list within the custom apps section', () => {
cy.intercept('GET', constants.validappUrlJson, {
cy.intercept('GET', constants.validAppUrlJson, {
name: constants.testAppData.name,
description: constants.testAppData.descr,
icons: [{ src: 'logo.svg', sizes: 'any', type: 'image/svg+xml' }],
})

safeapps.typeCustomAppUrl(constants.validappUrl)
safeapps.typeCustomAppUrl(constants.validAppUrl)
safeapps.verifyAppTitle(myCustomAppTitle)
safeapps.acceptTC()
safeapps.clickOnAddBtn()
Expand Down
86 changes: 43 additions & 43 deletions cypress/e2e/smoke/tx_history.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as constants from '../../support/constants'
import * as main from '../pages/main.page'
import * as createtx from '../pages/create_tx.pages'
import * as createTx from '../pages/create_tx.pages'

const INCOMING = 'Received'
const OUTGOING = 'Sent'
Expand Down Expand Up @@ -30,8 +30,8 @@ describe('Transaction history', () => {
const time4 = '5:01 PM'
const success = 'Success'

createtx.verifyDateExists(DATE)
createtx.verifyDateExists(NEXT_DATE_LABEL)
createTx.verifyDateExists(DATE)
createTx.verifyDateExists(NEXT_DATE_LABEL)

// Transaction summaries from October 9th
const rows = cy.contains('div', DATE).nextUntil(`div:contains(${NEXT_DATE_LABEL})`)
Expand All @@ -43,77 +43,77 @@ describe('Transaction history', () => {
.last()
.within(() => {
// Type
createtx.verifyImageAlttxt(0, INCOMING)
createtx.verifyStatus(constants.transactionStatus.received)
createTx.verifyImageAlttxt(0, INCOMING)
createTx.verifyStatus(constants.transactionStatus.received)

// Info
createtx.verifyImageAlttxt(1, constants.tokenAbbreviation.gor)
createtx.verifyTransactionStrExists(amount)
createtx.verifyTransactionStrExists(time)
createtx.verifyTransactionStrExists(success)
createTx.verifyImageAlttxt(1, constants.tokenAbbreviation.gor)
createTx.verifyTransactionStrExists(amount)
createTx.verifyTransactionStrExists(time)
createTx.verifyTransactionStrExists(success)
})
// CowSwap deposit of Wrapped Ether
.prev()
.within(() => {
createtx.verifyTransactionStrExists('0')
createTx.verifyTransactionStrExists('0')
// TODO: update next line after fixing the logo
// cy.find('img').should('have.attr', 'src').should('include', WRAPPED_ETH)
createtx.verifyTransactionStrExists(constants.tokenNames.wrapped_ether)
createtx.verifyTransactionStrExists(constants.transactionStatus.deposit)
createtx.verifyTransactionStrExists(time2)
createtx.verifyTransactionStrExists(constants.transactionStatus.success)
createTx.verifyTransactionStrExists(constants.tokenNames.wrappedEther)
createTx.verifyTransactionStrExists(constants.transactionStatus.deposit)
createTx.verifyTransactionStrExists(time2)
createTx.verifyTransactionStrExists(constants.transactionStatus.success)
})
// CowSwap approval of Wrapped Ether
.prev()
.within(() => {
createtx.verifyTransactionStrExists('1')
createTx.verifyTransactionStrExists('1')
// Type
// TODO: update next line after fixing the logo
// cy.find('img').should('have.attr', 'src').should('include', WRAPPED_ETH)
createtx.verifyTransactionStrExists(constants.transactionStatus.approve)
createtx.verifyTransactionStrExists(time3)
createtx.verifyTransactionStrExists(constants.transactionStatus.success)
createTx.verifyTransactionStrExists(constants.transactionStatus.approve)
createTx.verifyTransactionStrExists(time3)
createTx.verifyTransactionStrExists(constants.transactionStatus.success)
})
// Contract interaction
.prev()
.within(() => {
createtx.verifyTransactionStrExists('2')
createtx.verifyTransactionStrExists(constants.transactionStatus.interaction)
createtx.verifyTransactionStrExists(time4)
createtx.verifyTransactionStrExists(constants.transactionStatus.success)
createTx.verifyTransactionStrExists('2')
createTx.verifyTransactionStrExists(constants.transactionStatus.interaction)
createTx.verifyTransactionStrExists(time4)
createTx.verifyTransactionStrExists(constants.transactionStatus.success)
})
// Send 0.11 WETH
.prev()
.within(() => {
createtx.verifyImageAlttxt(0, OUTGOING)
createtx.verifyTransactionStrExists(constants.transactionStatus.sent)
createtx.verifyTransactionStrExists(amount2)
createtx.verifyTransactionStrExists(time4)
createtx.verifyTransactionStrExists(constants.transactionStatus.success)
createTx.verifyImageAlttxt(0, OUTGOING)
createTx.verifyTransactionStrExists(constants.transactionStatus.sent)
createTx.verifyTransactionStrExists(amount2)
createTx.verifyTransactionStrExists(time4)
createTx.verifyTransactionStrExists(constants.transactionStatus.success)
})
// Receive 120 DAI
.prev()
.within(() => {
createtx.verifyTransactionStrExists(constants.transactionStatus.received)
createtx.verifyTransactionStrExists(amount3)
createtx.verifyTransactionStrExists(time4)
createtx.verifyTransactionStrExists(constants.transactionStatus.success)
createTx.verifyTransactionStrExists(constants.transactionStatus.received)
createTx.verifyTransactionStrExists(amount3)
createTx.verifyTransactionStrExists(time4)
createTx.verifyTransactionStrExists(constants.transactionStatus.success)
})
})

it('should expand/collapse all actions', () => {
createtx.clickOnTransactionExpandableItem('Mar 24, 2023', () => {
createtx.verifyTransactionStrNotVible(str1)
createtx.verifyTransactionStrNotVible(str2)
createtx.verifyTransactionStrNotVible(str3)
createtx.lickOnExpandAllBtn()
createtx.verifyTransactionStrExists(str1)
createtx.verifyTransactionStrExists(str2)
createtx.verifyTransactionStrExists(str3)
createtx.lickOnCollapseAllBtn()
createtx.verifyTransactionStrNotVible(str1)
createtx.verifyTransactionStrNotVible(str2)
createtx.verifyTransactionStrNotVible(str3)
createTx.clickOnTransactionExpandableItem('Mar 24, 2023', () => {
createTx.verifyTransactionStrNotVible(str1)
createTx.verifyTransactionStrNotVible(str2)
createTx.verifyTransactionStrNotVible(str3)
createTx.clickOnExpandAllBtn()
createTx.verifyTransactionStrExists(str1)
createTx.verifyTransactionStrExists(str2)
createTx.verifyTransactionStrExists(str3)
createTx.clickOnCollapseAllBtn()
createTx.verifyTransactionStrNotVible(str1)
createTx.verifyTransactionStrNotVible(str2)
createTx.verifyTransactionStrNotVible(str3)
})
})
})
18 changes: 9 additions & 9 deletions cypress/support/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export const appsUrl = '/apps'
export const requestPermissionsUrl = '/request-permissions'
export const getPermissionsUrl = '/get-permissions'
export const appSettingsUrl = '/settings/safe-apps'
export const invalidappUrl = 'https://my-invalid-custom-app.com/manifest.json'
export const validappUrlJson = 'https://my-valid-custom-app.com/manifest.json'
export const validappUrl = 'https://my-valid-custom-app.com'
export const invalidAppUrl = 'https://my-invalid-custom-app.com/manifest.json'
export const validAppUrlJson = 'https://my-valid-custom-app.com/manifest.json'
export const validAppUrl = 'https://my-valid-custom-app.com'

export const proposeEndPoint = '/**/propose'
export const appsEndPoint = '/**/safe-apps'
export const proposeEndpoint = '/**/propose'
export const appsEndpoint = '/**/safe-apps'

export const GOERLI_CSV_ENTRY = {
name: 'goerli user 1',
Expand All @@ -59,9 +59,9 @@ export const tokenAbbreviation = {
}

export const appNames = {
walletconnect: 'walletconnect',
customcontract: 'compose custom contract',
noresults: 'atextwithoutresults',
walletConnect: 'walletconnect',
customContract: 'compose custom contract',
noResults: 'atextwithoutresults',
}

export const testAppData = {
Expand All @@ -84,5 +84,5 @@ export const transactionStatus = {
}

export const tokenNames = {
wrapped_ether: 'Wrapped Ether',
wrappedEther: 'Wrapped Ether',
}

0 comments on commit 3c49bc1

Please sign in to comment.