Skip to content

2d 3d#4

Open
mountler wants to merge 5 commits intomainfrom
2d_3d
Open

2d 3d#4
mountler wants to merge 5 commits intomainfrom
2d_3d

Conversation

@mountler
Copy link
Member

@mountler mountler commented Sep 8, 2025

No description provided.

Copy link
Member

@SoraMakes SoraMakes left a comment

Choose a reason for hiding this comment

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

Schaut insgesamt gut aus

Comment on lines +11 to +17
const uploadedWorld = await uploadWorld('testwelt');
await enrollInMoodleCourse(
request,
process.env._PLAYWRIGHT_USER_STUDENT_USERNAME!,
process.env._USER_STUDENT_PW!,
uploadedWorld.worldNameInLms
);
Copy link
Member

Choose a reason for hiding this comment

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

unnötig hier?!

Comment on lines +11 to +17
const uploadedWorld = await uploadWorld('testwelt');
await enrollInMoodleCourse(
request,
process.env._PLAYWRIGHT_USER_STUDENT_USERNAME!,
process.env._USER_STUDENT_PW!,
uploadedWorld.worldNameInLms
);
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +3 to +14
export async function userLogin(
page: Page,
username: string = process.env._PLAYWRIGHT_USER_STUDENT_USERNAME!,
password: string = process.env._USER_STUDENT_PW!,
) {
await page.goto('/');
await page.getByTestId('userName').click();
await page.getByTestId('userName').fill(username);
await page.getByTestId('userName').press('Tab');
await page.getByTestId('password').fill(password);
await page.getByTestId('loginButton').click();
}
Copy link
Member

Choose a reason for hiding this comment

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

wenn öfters benötigt wäre der besser in der enhanced_test.ts untergebracht. der wäre dann so erreichbar

test(`user navigates from avatar editor to welcome screen (${width}x${height})`, async ({page, userlogin}) => {..}

und das naming der methode sollte eine klarere differenzierung von den in dieser datei bereits bestehenden methoden haben (generell, unabhängig davon ob du es dort rein packst oder nicht)

@SoraMakes SoraMakes requested a review from Copilot October 12, 2025 22:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR restructures the test suite by refactoring login functionality and creating comprehensive test coverage for the welcome screen and avatar editor across multiple viewport sizes. The changes extract reusable helper functions and replace a basic login test with more comprehensive screen navigation tests.

  • Refactored login functionality into reusable helper functions
  • Added comprehensive welcome screen tests covering login, logout, and navigation scenarios
  • Implemented avatar editor tests for navigation and category selection
  • Introduced viewport testing across multiple screen sizes

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
game/tests/welcomeScreen.spec.ts New comprehensive test suite for welcome screen functionality across multiple viewports
game/tests/login.spec.ts Removed basic login test (functionality moved to helper)
game/tests/libs/welcomeScreen_helper.ts New helper functions for user login, logout, and navigation operations
game/tests/libs/viewPorts.ts New configuration file defining viewport dimensions for responsive testing
game/tests/avatarEditor.spec.ts New test suite for avatar editor functionality and navigation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +23 to +24
//TODO: Replace with getByTestId-Query when button has testid
await page.getByRole('button').filter({ hasText: /^$/ }).nth(1).click();
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

The selector uses an empty text filter with nth(1) which is fragile and could break if button order changes. Consider using a more specific selector or add test IDs to the buttons as suggested in the TODO comment.

Suggested change
//TODO: Replace with getByTestId-Query when button has testid
await page.getByRole('button').filter({ hasText: /^$/ }).nth(1).click();
// Requires: Add data-testid="learningWorldMenuButton" to the target button in the application code.
await page.getByTestId('learningWorldMenuButton').click();

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
//TODO: Replace with getByTestId-Query when button has testid
await page.getByRole('button').filter({ hasText: /^$/ }).nth(2).click();
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

Similar to the previous selector, this uses an empty text filter with nth(2) which is brittle. The reliance on button position makes tests fragile to UI changes.

Suggested change
//TODO: Replace with getByTestId-Query when button has testid
await page.getByRole('button').filter({ hasText: /^$/ }).nth(2).click();
// TODO: The button for navigating to the Avatar Editor must have data-testid="avatarEditorButton" in the application code.
await page.getByTestId('avatarEditorButton').click();

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +28
const welcomScreenURL = page.url();
await navigateToAvatarEditor(page);
await page.getByRole('button', { name: 'Home Icon' }).click();
await expect(page.url()).toEqual(welcomScreenURL);
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'welcomScreenURL' to 'welcomeScreenURL'.

Suggested change
const welcomScreenURL = page.url();
await navigateToAvatarEditor(page);
await page.getByRole('button', { name: 'Home Icon' }).click();
await expect(page.url()).toEqual(welcomScreenURL);
const welcomeScreenURL = page.url();
await navigateToAvatarEditor(page);
await page.getByRole('button', { name: 'Home Icon' }).click();
await expect(page.url()).toEqual(welcomeScreenURL);

Copilot uses AI. Check for mistakes.
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.

3 participants