Skip to content

Commit

Permalink
Fixed chart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davibroc committed Oct 29, 2024
1 parent 1a0534e commit 36acd76
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
14 changes: 0 additions & 14 deletions e2e/pages/swaps/SwapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,7 @@ class SwapView {
return title;
}

// Function to check if the button is enabled
async isButtonEnabled(element) {
const attributes = await element.getAttributes();
return attributes.enabled === true; // Check if enabled is true
}

async tapSwapButton() {
const swapButtonElement = await this.swapButton;
const delay = 500; // Delay in milliseconds

// Wait until the button is enabled before performing swipe actions
while (!(await this.isButtonEnabled(swapButtonElement))) {
await TestHelpers.delay(delay); // Wait for the specified delay
}

await Gestures.waitAndTap(this.swapButton);
}

Expand Down
3 changes: 1 addition & 2 deletions e2e/specs/swaps/swap-token-chart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ describe(Regression('Swap from Token view'), () => {
await SwapView.swapCompleteLabel('ETH', 'DAI');
await device.enableSynchronization();
await TestHelpers.delay(10000);
await TokenOverview.isVisible();
await TokenOverview.tapBackButton();
await CommonView.tapBackButton();

// Check the swap activity completed
await TabBarComponent.tapActivity();
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/swaps/token-details.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe(SmokeSwaps('Token Chart Tests'), () => {
it('should not display the chart when using Sepolia test network', async () => {
await switchToSepoliaNetwork();
await WalletView.tapOnToken(CustomNetworks.Sepolia.providerConfig.ticker);
await Assertions.checkIfNotVisible(TokenOverview.noChartData);
await Assertions.checkIfVisible(TokenOverview.noChartData);
await Assertions.checkIfElementToHaveText(TokenOverview.tokenPrice, '$0');
});
});

0 comments on commit 36acd76

Please sign in to comment.