Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-dubinin committed Aug 12, 2024
1 parent a5fe8d5 commit 4fc73b2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 39 deletions.
8 changes: 5 additions & 3 deletions packages/web/e2e/pages/trade-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ export class TradePage extends BasePage {
// we expect that after 1 second token filter is displayed.
await this.page.waitForTimeout(1000);
await this.page.getByPlaceholder("Search").fill(to);
const toLocator = this.page.locator(
`//div/button[@data-testid='token-select-asset']//span[.='${to}']`
);
const toLocator = this.page
.locator(
`//div/button[@data-testid='token-select-asset']//span[.='${to}']`
)
.first();
await toLocator.click();
// we expect that after 2 seconds exchange rate is populated.
await this.page.waitForTimeout(2000);
Expand Down
60 changes: 24 additions & 36 deletions packages/web/e2e/tests/swap.wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("token_out_denom: " + ATOM);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("denom: uosmo");
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap ATOM to OSMO", async () => {
Expand All @@ -79,9 +78,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + ATOM);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: uosmo");
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap OSMO to USDC", async () => {
Expand All @@ -94,9 +92,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("token_out_denom: " + USDC);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("denom: uosmo");
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap USDC to OSMO", async () => {
Expand All @@ -109,9 +106,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("token_out_denom: uosmo");
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("denom: " + USDC);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap ATOM to USDC", async () => {
Expand All @@ -124,9 +120,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + ATOM);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + USDC);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap USDC to ATOM", async () => {
Expand All @@ -139,9 +134,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + USDC);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + ATOM);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap USDC to TIA", async () => {
Expand All @@ -154,9 +148,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + USDC);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + TIA);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap TIA to USDC", async () => {
Expand All @@ -169,9 +162,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + TIA);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + USDC);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap USDC to INJ", async () => {
Expand All @@ -184,9 +176,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + USDC);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + INJ);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap INJ to USDC", async () => {
Expand All @@ -199,9 +190,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + INJ);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + USDC);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap USDC to AKT", async () => {
Expand All @@ -214,9 +204,8 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + USDC);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + AKT);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});

test("User should be able to swap AKT to USDC", async () => {
Expand All @@ -229,8 +218,7 @@ test.describe("Test Swap feature", () => {
expect(msgContentAmount).toContain("denom: " + AKT);
expect(msgContentAmount).toContain("sender: " + walletId);
expect(msgContentAmount).toContain("token_out_denom: " + USDC);
expect(swapPage.isTransactionBroadcasted(10));
expect(swapPage.isTransactionSuccesful(10));
expect(swapPage.getTransactionUrl()).toBeTruthy();
await swapPage.isTransactionSuccesful();
await swapPage.getTransactionUrl();
});
});

0 comments on commit 4fc73b2

Please sign in to comment.