Currently, I am experiencing some troubles with tabs while using Playwright.
My goal is to open a new tab within the same browser window using Playwright. However, all my attempts so far have only led me to ways of opening a new window instead of a tab. Here is the code snippet that I have been working on:
let page: Page;
test.beforeEach(async ({ browser }) => {
page = await browser.newPage();
await page.goto(url);
await page.fill(sso.inputEmailField, email);
await page.click(sso.submitButton);
await page.fill(sso.inputPasswdField, password);
await page.click(sso.submitButton);
await page.click(sso.submitButton)
});
test.afterAll(async () => {
await page.close();
});
test('1001 users', async () => {
await page.click("a[data-testid='import-quiz-button']");
await page.click('"Submit"');
await page.click("a[data-testid='start-quiz-button']");
const url = await (page.locator("button[data-testid='copy-link-button']")).innerText()
})
I am eager to figure out how to open the specified url
in another tab within the browser similar to this image