-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
As you can see in the below snippet, I am trying to find the text Success.
in the DOM, but asserting it always returns me an error.
let assert = require("assert");
const { chromium } = require("playwright");
(async () => {
const browser = await chromium.launch({ headless: false });
const browserContext = await browser.newContext();
const browserPage = await browserContext.newPage();
await createAccount(browserPage);
})();
const createAccount = async (page) => {
await page.goto("https://coindcx.com/signup");
await page.fill('input[name="firstName"]', "Test");
await page.fill('input[name="lastName"]', "test");
await page.fill('input[name="email"]', "[email protected]");
await page.fill('input[name="password"]', "Qwerty@123");
await page.fill('input[placeholder="Select Country"]', "India");
await page.click('span[class="country__name -o-6"]');
await page.fill(
'input[name="phone"]',
Math.floor(1000000000 + Math.random() * 900000).toString()
);
await page.click('button[type="submit"]');
assert(await page.$(`text="Success"`));
};
Any tips would be really helpful
Metadata
Metadata
Assignees
Labels
No labels