Skip to content

Commit b3d22ea

Browse files
committed
test: fix wallet service
1 parent 3a24f52 commit b3d22ea

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

walletservices/utils/index.ts

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -555,29 +555,26 @@ async function signInWithEmailWithTestEmailAppInCoreWalletServicesApp(
555555
browser: Browser,
556556
tag: string,
557557
timestamp: number
558-
): Promise<boolean> {
559-
try {
560-
console.log(`Email:${email}`);
561-
await page.locator(`[placeholder="name@domain.com"]`).waitFor({ state: "visible" });
562-
await page.locator('[placeholder="name@domain.com"]').fill(email);
563-
await page.locator('button:has-text("Login with Email")').click();
564-
await delay(10000);
565-
const pages = await browser.contexts()[0].pages();
566-
// pages[0] is the first page, and pages[1] is the new page
567-
await pages[1].bringToFront(); // Bring the new page to the front
568-
// Setup our JSON API endpoint
569-
const ENDPOINT = `https://api.testmail.app/api/json?apikey=${testEmailAppApiKey}&namespace=kelg8`;
570-
const res = await axios.get(`${ENDPOINT}&tag=${tag}&livequery=true&timestamp_from=${timestamp}`);
571-
const inbox = await res.data;
572-
const href = inbox.emails[0].subject.match(/\d+/)[0];
573-
console.error(href);
574-
await pages[1].locator(`xpath=.//input[@type='text']`).first().type(href);
575-
// useAutoCancel2FASetup(pages[1]);
576-
return true;
577-
} catch (err) {
578-
console.error(err);
579-
return false;
580-
}
558+
): Promise<void> {
559+
console.log(`Email:${email}`);
560+
await delay(2000);
561+
await page.locator(`button:has-text("Continue with Email/Phone")`).click();
562+
await page.locator(`[placeholder="name@domain.com"]`).waitFor({ state: "visible" });
563+
await page.locator('[placeholder="name@domain.com"]').fill(email);
564+
// Click on the blue arrow button next to the email input field
565+
await page.locator('input[type="email"] + div > svg.cursor-pointer').click();
566+
567+
await delay(10000);
568+
const pages = await browser.contexts()[0].pages();
569+
// pages[0] is the first page, and pages[1] is the new page
570+
await pages[1].bringToFront(); // Bring the new page to the front
571+
// Setup our JSON API endpoint
572+
const ENDPOINT = `https://api.testmail.app/api/json?apikey=${testEmailAppApiKey}&namespace=kelg8`;
573+
const res = await axios.get(`${ENDPOINT}&tag=${tag}&livequery=true&timestamp_from=${timestamp}`);
574+
const inbox = await res.data;
575+
const href = inbox.emails[0].subject.match(/\d+/)[0];
576+
console.error(href);
577+
await pages[1].locator(`xpath=.//input[@type='text']`).first().type(href);
581578
}
582579
async function signInWithMobileNumber({
583580
page,

walletservices/wallet-service/index.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ test.describe.serial("Core Wallet Services Scenarios @smoke", () => {
8989
await accountsPage.clickHome();
9090
await accountsPage.clickLink(" Activity");
9191
expect(page.url()).toContain("wallet/activity");
92-
await accountsPage.verifyTransactionActivity("Sent POL|to 0x9904bf11c69233454162b72d7289ccbb295ade6a|20:12:48 | 19 Sept 2024");
93-
await accountsPage.verifyTransactionActivity("Received POL|to 0xed2130dd79960a00be8abe75962c75678af4c0a7|19:57:52 | 19 Sept 2024");
9492
});
9593

9694
test(`Verify user is able to switch currency`, async () => {
@@ -114,7 +112,8 @@ test.describe.serial("Core Wallet Services Scenarios @smoke", () => {
114112
expect(await element.isVisible()).toBeTruthy();
115113
});
116114

117-
test(`Verify user is able to buy tokens`, async () => {
115+
// No longer supported
116+
test.skip(`Verify user is able to buy tokens`, async () => {
118117
const accountsPage = new WalletServicesPage(page);
119118
await accountsPage.clickHome();
120119
await accountsPage.clickOption("Buy");

0 commit comments

Comments
 (0)