Skip to content

Task solution #93

Open
denys2 wants to merge 2 commits into
mate-academy:mainfrom
denys2:task_solution
Open

Task solution #93
denys2 wants to merge 2 commits into
mate-academy:mainfrom
denys2:task_solution

Conversation

@denys2

@denys2 denys2 commented Jul 5, 2026

Copy link
Copy Markdown

🤼

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am requesting changes because there are still critical runtime issues that will prevent the test suite from passing, which is a core requirement of this task. In tests/signIn/signInPositive.spec.js, beforeEach currently calls signInPage = new SignInPage(); and homePage = new HomePage(); without receiving the Playwright page fixture; since SignInPage (and likely HomePage) expects a page argument in the constructor, this will cause this.page to be undefined and lead to runtime errors when tests run. Similarly, in tests/signUp/signUpPositive.spec.js, signUpPage = new SignUpPage(); and homePage = new HomePage(); are also missing the required page argument, which will break those tests as soon as the page objects try to interact with the browser. These are critical blockers because they violate the requirement that all Playwright tests must run and pass after setting up ESLint/Prettier/Husky.

To fix this, update each affected test.beforeEach to accept the page fixture, for example test.beforeEach(async ({ page }) => { ... }), and then instantiate your page objects as signInPage = new SignInPage(page);, signUpPage = new SignUpPage(page); and homePage = new HomePage(page);, mirroring what you already did correctly in tests/signIn/signInNegative.spec.js. Once you make these changes, rerun the full Playwright test suite and ensure everything passes end-to-end. Aside from these wiring issues, your ESLint flat configuration and general page object structure look solid, so you’re very close—fixing the page injection in the positive tests will align your solution with the task requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread eslint.config.mjs
Comment on lines +10 to +11
globals: {
...globals.browser,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignInPage expects a page argument in its constructor, but here it's instantiated without any arguments, which will cause runtime errors when tests run and prevent a clean test suite required by the task. Consider updating beforeEach to receive { page } and pass it into new SignInPage(page) (similar to the negative tests).

Comment thread src/pages/SignInPage.js
@@ -1,16 +1,16 @@
import { expect, test } from "@playwright/test";
import { expect } from '@playwright/test';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import import tseslint from "typescript-eslint"; is unlikely to work as expected; the theory instructions for ESLint with TypeScript usually rely on @typescript-eslint packages and their configs helpers. This impacts ESLint configuration correctness and may cause npx eslint to fail.

Comment thread src/pages/SignInPage.js
this.passwordField = page.getByPlaceholder('Password');
this.signInButton = page.getByRole('button', { name: 'Sign in' });
this.errorMessage = page.getByRole('list').nth(1);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In beforeEach, you are not receiving the Playwright page fixture, so new SignInPage() is called without a page. Since SignInPage expects a page argument, this will break your tests and prevent you from achieving the "all tests pass" requirement.

Comment thread src/pages/SignInPage.js
this.signInButton = page.getByRole('button', { name: 'Sign in' });
this.errorMessage = page.getByRole('list').nth(1);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new SignInPage(); is missing the required page argument that the SignInPage constructor uses. This will cause runtime errors when the tests run, so you should pass the Playwright page fixture here.

Comment thread src/pages/SignInPage.js
this.errorMessage = page.getByRole('list').nth(1);
}

async open() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new HomePage(); mirrors the same pattern as SignInPage; if HomePage also expects a page (as is typical in this project), you should construct it with page to keep tests working under the configured tooling.

signInPage = new SignInPage(page);
homePage = new HomePage(page);
test.beforeEach(async () => {
signInPage = new SignInPage();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignInPage requires a page argument in its constructor (as used in the negative tests), so calling new SignInPage() without page will lead to this.page being undefined and runtime errors when methods use it. Update beforeEach to accept { page } and pass it into the constructor.

homePage = new HomePage(page);
test.beforeEach(async () => {
signInPage = new SignInPage();
homePage = new HomePage();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HomePage is also likely a page object that needs the Playwright page instance; instantiating it without page can cause similar runtime issues. Consider passing page here as well, consistent with how other page objects are used in the suite.

signUpPage = new SignUpPage(page);
homePage = new HomePage(page);

test.beforeEach(async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test.beforeEach does not receive the Playwright page fixture, so SignUpPage and HomePage are constructed without a page instance. If these page objects are like SignInPage and expect page in the constructor, this will cause runtime failures and block a clean test run.

homePage = new HomePage(page);

test.beforeEach(async () => {
signUpPage = new SignUpPage();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

signUpPage = new SignUpPage(); is likely missing the required page argument (as with SignInPage in other tests). You should pass the page fixture here so the page object can interact with the browser context.


test.beforeEach(async () => {
signUpPage = new SignUpPage();
homePage = new HomePage();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

homePage = new HomePage(); mirrors the same issue as signUpPage; if HomePage expects a page, instantiate it with page to avoid runtime errors during the automated test run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants