Issue 1:
System info

Playwright Version: 1.32.3

Operating System: macOS 12.6.2

Browser: Chromium

Other info:

Error:

Test timeout of 50000ms exceeded.

Error: locator.scrollIntoViewIfNeeded: Target closed
=========================== logs ===========================
waiting for locator('xpath=//div[@type=\'objective\']//span[text()=\'l02Eo5\']/../..')
============================================================

at ../pages/okr/homePage.js:45

43 | export async function verifyObjPresentOnHomePage(testAttributes, objName) {
44 | console.log("###########", objName)
> 45 | await testAttributes.page.locator(`//div[@type='objective']//span[text()='${objName}']/../..`).scrollIntoViewIfNeeded();
| ^
46 | // const elem = await testAttributes.page.locator(`//div[@type='objective']//span[text()='${objName}']/../..`);
47 | // await elem.evaluate("arguments[0].scrollIntoView(true);");
48 | await expect.soft(testAttributes.page.locator(`//div[@type='objective']//span[text()='${objName}']`),

Issue 2:
System info

Playwright Version: v1.31.2

Operating System: Windows 11

Browser: Chromium

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

https://github.com/Marcin3/challenge

or

Config file

// playwright.config.ts
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
import dotenv from "dotenv";

dotenv.config();

const config: PlaywrightTestConfig = {
testDir: "./tests",
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 10000,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 2,
reporter: "html",

use: {
actionTimeout: 0,
baseURL: process.env.BASE_URL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
},
},
],
};

export default config;

Test file (self-contained)

test("Search wrong word", async ({ page }) => {
const wrongWord = "sythetic";
const mainMenuPage = new MainMenuPage(page);

await test.step(`Given User is on page https://mostly.ai/`, async () => {
await page.goto("");
expect(page).toHaveURL("");
});

await test.step(`When User click the “Search” button`, async () => {
await mainMenuPage.clickOnSearchButton();
});

await test.step(`And type “sythetic” (wrong spelling of synthetic) in search field`, async () => {
await mainMenuPage.fillSearchFiled(wrongWord);
});

await test.step(`And press Enter`, async () => {
await mainMenuPage.pressEnterButtonOnSearchFiled();
});

await test.step(`Then User can see following information: “Sorry, no results for: sythetic”`, async () => {
const firstPart = `Sorry, no results for:`;
await mainMenuPage.checkSearchResult(firstPart, wrongWord);
});
});

Steps

Clone the repo

First install project using command npm install

To run tests please run from root using command npx playwright test

Open report npx playwright show-report

Expected

For test Search wrong word you should see step When User click the “Search” button

Actual

Now this step is missing

Here is also link to playwright report https://github.com/Marcin3/challenge/tree/main/playwright-report