Skip to content

Commit

Permalink
fix: new assertion stile
Browse files Browse the repository at this point in the history
  • Loading branch information
olehbairak committed Mar 12, 2024
1 parent 9beae69 commit b182f33
Showing 1 changed file with 32 additions and 24 deletions.
56 changes: 32 additions & 24 deletions packages/integration-tests/tests/ui/transactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ let failedTxHash: string;
let contract: string;
let transaction: string;
let element: Locator;
let elementTx: Locator;
let elementFrom: Locator;
let elementTo: Locator;
let elementContract: Locator;
let selector: string;

//@id1656
Expand Down Expand Up @@ -46,26 +50,26 @@ test(" Check on BE Transfer ETH token via Portal", async ({ page }) => {
url = BlockExplorer.baseUrl + `/tx/${transaction}` + BlockExplorer.localNetwork;

await page.goto(url);
//Check tx Hash

selector = `text=${transaction}`;
element = await page.locator(selector).first();
elementTx = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
//Check address From
selector = `text=${Wallets.richWalletAddress}`;
element = await page.locator(selector).first();
elementFrom = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
//Check address To
selector = `text=${Token.ERC20AddressETH}`;
element = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
elementTo = await page.locator(selector).first();

//Check transaction Amount
selector = `text=${Values.txSumETH}`;
element = await page.locator(selector).first();

//Check tx Hash
await expect(elementTx).toBeVisible(config.extraTimeout);
//Check address From
await expect(elementFrom).toBeVisible(config.extraTimeout);
//Check address To
await expect(elementTo).toBeVisible(config.extraTimeout);
//Check transaction Amount
await expect(element).toBeVisible(config.extraTimeout);
});

Expand All @@ -76,26 +80,27 @@ test(" Check on BE Transfer custom ERC-20 token via Portal", async ({ page }) =>
url = BlockExplorer.baseUrl + `/tx/${transaction}` + BlockExplorer.localNetwork;

await page.goto(url);
//Check tx Hash

selector = `text=${transaction}`;
element = await page.locator(selector).first();
elementTx = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
//Check address From
selector = `text=${Wallets.richWalletAddress}`;
element = await page.locator(selector).first();
elementFrom = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
//Check address To
selector = `text=${adressTo}`;
element = await page.locator(selector).first();

await expect(element).toBeVisible(config.extraTimeout);
elementTo = await page.locator(selector).first();

//Check transaction amount
selector = `text= 1 `;
element = await page.locator(selector).first();

//Check tx Hash
await expect(elementTx).toBeVisible(config.extraTimeout);
//Check address From
await expect(elementFrom).toBeVisible(config.extraTimeout);
//Check address To
await expect(elementTo).toBeVisible(config.extraTimeout);
//Check transaction Amount
await expect(element).toBeVisible(config.extraTimeout);
});

Expand All @@ -108,12 +113,15 @@ test("Check on BE contract that makes multiple transfers based on stored/retriev
url = BlockExplorer.baseUrl + `/address/${contract}` + BlockExplorer.localNetwork;

await page.goto(url);
//Check contract address

selector = `text=${contract}`;
element = await page.locator(selector).first();

selector = `text=${txAddress}`;
elementContract = await page.locator(selector).first();

//Check contract address
await expect(element).toBeVisible(config.extraTimeout);
//Check tx hash
selector = `text=${txAddress}`;
element = await page.locator(selector).first();
await expect(element).toBeVisible(config.extraTimeout);
});

0 comments on commit b182f33

Please sign in to comment.