import { test, expect } from '@playwright/test';
test('test', async ({ page }) => {
await page.goto('https://www.exploretock.com/whisperingvine4thstreet/');
await expect(page.getByText('guests')).toBeVisible();
const guests = await page.getByText('guests');
const text = guests.innerText;
console.log(text);
});
I am trying to output the contents of the page.getByText('guests')
so I can see perform actions depending on what number it is. How do I do this? I’ve never used typescript before
I was expecting the console to output the text inside which is ‘2 guests’, but it outputs [AsyncFunction: innerText]
. I searched for some possible solutions but nothing I tried worked.