Skip to content

Commit

Permalink
QA - fix automation after etna update (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
eunjisong authored Dec 19, 2024
1 parent d89582b commit ef2f918
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
4 changes: 3 additions & 1 deletion packages/core-mobile/app/screens/bridge/Bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,9 @@ const Bridge: FC = () => {
optionsRenderItem={item =>
renderDropdownItem(item.item, targetNetwork)
}
selectionRenderItem={() => renderNetwork(targetNetwork)}
selectionRenderItem={() =>
renderNetwork(targetNetwork, 'to_blockchain')
}
style={{
top: 22
}}
Expand Down
16 changes: 8 additions & 8 deletions packages/core-mobile/e2e/pages/bridgeTab.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,35 +145,35 @@ class BridgeTabPage {

async tapBridgeBtn() {
await delay(1000)
return Actions.tap(this.bridgeBtn)
await Actions.tap(this.bridgeBtn)
}

async tapBridgeToggleBtn() {
return Actions.tap(this.bridgeToggleBtn)
await Actions.tap(this.bridgeToggleBtn)
}

async tapAvalancheNetwork() {
return Actions.tapElementAtIndex(this.avalancheNetwork, platformIndex2)
await Actions.tapElementAtIndex(this.avalancheNetwork, platformIndex2)
}

async tapBitcoinNetwork() {
return Actions.tapElementAtIndex(this.bitcoinNetwork, platformIndex)
await Actions.tapElementAtIndex(this.bitcoinNetwork, platformIndex)
}

async tapClose() {
return Actions.tap(this.closebutton)
await Actions.tap(this.closebutton)
}

async tapBtcToken() {
return Actions.tapElementAtIndex(this.btcToken, platformIndex)
await Actions.tapElementAtIndex(this.btcToken, platformIndex)
}

async tapEthereumNetwork() {
return Actions.tapElementAtIndex(this.ethereumNetwork, platformIndex)
await Actions.tapElementAtIndex(this.ethereumNetwork, platformIndex)
}

async tapEthBridgeTransaction() {
return Actions.tapElementAtIndex(this.ethBridgeTransaction, 0)
await Actions.tapElementAtIndex(this.ethBridgeTransaction, 0)
}

async tapHide() {
Expand Down
18 changes: 8 additions & 10 deletions packages/core-mobile/e2e/pages/popUpModal.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class PopUpModalPage {

// Verify base fee for C-Chain
if (isCChain) {
const tolerance = 0.15 // 15% tolerance
const tolerance = 3
const baseFeeByApi = parseFloat(await fetchCChainBaseFee())
const slowBaseFeeUI = parseFloat(
(await actions.getElementText(by.id(popUpModalLoc.slowBaseFee))) || '0'
Expand All @@ -224,23 +224,21 @@ class PopUpModalPage {
)

// Calculate percentage differences
const diffSlowPercentage =
Math.abs(baseFeeByApi - slowBaseFeeUI) / baseFeeByApi
const diffCustomPercentage =
Math.abs(baseFeeByApi - customBaseFeeUI) / baseFeeByApi
const diffSlow = Math.abs(baseFeeByApi - slowBaseFeeUI)
const diffCustom = Math.abs(baseFeeByApi - customBaseFeeUI)

console.log(
`Current base fee for C-Chain: API - ${baseFeeByApi} UI - ${slowBaseFeeUI}, DiffPergentage - ${diffSlowPercentage}`
`Current base fee for C-Chain: API - ${baseFeeByApi} UI - ${slowBaseFeeUI}, diff - ${diffSlow}`
)
// BaseFee by API should be within the tolerance of the slow and custom base fee
assert(
diffSlowPercentage <= tolerance,
`API Base Fee: ${baseFeeByApi}, Slow Base Fee: ${slowBaseFeeUI} - Percentage difference ${diffSlowPercentage} > ${tolerance})`
diffSlow <= tolerance,
`API Base Fee: ${baseFeeByApi}, Slow Base Fee: ${slowBaseFeeUI} - diff - ${diffSlow} > ${tolerance})`
)

assert(
diffCustomPercentage <= tolerance,
`API Base Fee: ${baseFeeByApi}, Custom Base Fee: ${customBaseFeeUI} - Percentage difference ${diffCustomPercentage} > ${tolerance}`
diffCustom <= tolerance,
`API Base Fee: ${baseFeeByApi}, Custom Base Fee: ${customBaseFeeUI} - diff - ${diffCustom} > ${tolerance}`
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Balance After Managing Token', () => {
await commonElsPage.goBack()
const newFullBal = await portfolioPage.getTotalBalance()
const newActiveNetworkBal = await portfolioPage.getActiveNetworkBalance()
const tolerance = 1
const tolerance = 5

// Log token balances before and after hiding token
console.log(
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('Balance After Managing Token', () => {
await commonElsPage.goBack()
const newFullBal = await portfolioPage.getTotalBalance()
const newActiveNetworkBal = await portfolioPage.getActiveNetworkBalance()
const tolerance = 1
const tolerance = 5

// Log token balances before and after hiding token
console.log(
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('Balance After Managing Token', () => {
await commonElsPage.goBack()
const newFullBal = await portfolioPage.getTotalBalance()
const newActiveNetworkBal = await portfolioPage.getActiveNetworkBalance()
const tolerance = 1
const tolerance = 5

// Log token balances before and after hiding token
console.log(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Bridge Screen', () => {
// Toggle > verify `from` and `to` networks updated
await bridgeTabPage.tapBridgeToggleBtn()
await bridgeTabPage.verifyNetworks(bridgeTabLoc.avalancheNetwork, network)

// Toggle > verify `from` and `to` networks updated
await bridgeTabPage.tapBridgeToggleBtn()
await bridgeTabPage.verifyNetworks(network, bridgeTabLoc.avalancheNetwork)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('Receive Address', () => {
await ReceivePage.tapReceiveAddress()
await Assert.isVisible(ReceivePage.copiedToastMsg)
await Assert.isVisible(ReceivePage.receiveAddress)
await actions.waitForElementNotVisible(ReceivePage.copiedToastMsg)
})

it('should show bitcoin logo', async () => {
Expand Down

0 comments on commit ef2f918

Please sign in to comment.