Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tonidero committed Jan 18, 2024
1 parent b42061b commit 072994f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/rcbilling-demo/src/tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ beforeAll(() => {
test(
"Can purchase a product",
async () => {
console.log("TEST 1");
const { browser, page } = await setupTest();
const userId = `rc_billing_demo_test_${Date.now()}`;
await changeUserId(page, userId);
console.log("TEST 2");

// Perform purchase
const weeklyPackageCard = (await getPackageCards(page))[1];
Expand All @@ -34,22 +36,28 @@ test(
await waitMilliseconds(2000);
await enterCreditCardDetailsAndContinue(page);
await waitMilliseconds(2000);
console.log("TEST 3");

// Go back to main page
const rcbRoot = await page.$(".rcb-ui-root");
expect(rcbRoot).not.toBeNull();
console.log("TEST 4");
await page.screenshot({ path: "artifacts/screenshot.png" });
console.log("TEST 5");
// await expectElementContainsText(rcbRoot!, "Purchase Successful");
const returnHomeButton = await rcbRoot?.$(".intent-secondary");
expect(returnHomeButton).not.toBeNull();
console.log("TEST 6");
await returnHomeButton?.click();
await page.waitForNavigation();
console.log("TEST 7");

// Needed since there is an animation after tapping on the button
// to go back to main page.
await waitMilliseconds(5000);
expect(await page.$(`::-p-text(Success!)`)).not.toBeNull();
await browser.close();
console.log("TEST 8");
},
{ timeout: 30000, retry: 3 },
);
Expand Down

0 comments on commit 072994f

Please sign in to comment.