Skip to content

Document Playwright E2E strategy and add guest PvP regression coverage in CI#712

Draft
Copilot wants to merge 9 commits into
masterfrom
copilot/enhance-selenium-test-tooling
Draft

Document Playwright E2E strategy and add guest PvP regression coverage in CI#712
Copilot wants to merge 9 commits into
masterfrom
copilot/enhance-selenium-test-tooling

Conversation

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor

This issue asked for a better page-testing tool than Selenium and guidance for testing online PvP with two independent guest identities. The PR now includes both documentation guidance and executable regression coverage.

  • Tooling recommendation

    • Added a Page tests (E2E) section in README.md.
    • Recommends Playwright as the default browser test tool for this codebase (simpler authoring, built-in wait/retry behavior, context isolation).
  • PvP multi-user test guidance

    • Documents how to run two players in separate private browser contexts so each context gets a distinct guest ID.
    • Clarifies that separate browsers are only needed when intentionally testing different browser engines.
  • Executable regression test added

    • Added guestPlayersCanPlayFullPvPGameFromUciSample() in:
      • webapp-service-layer/src/test/kotlin/io/elephantchess/servicelayer/services/PlayerVsPlayerGameServiceTest.kt
    • The test creates a guest-vs-guest PvP game, joins both guests, plays moves from uci.txt (using a sample that ends in checkmate), and verifies completion behavior.
  • GitHub build workflow updated

    • Updated .github/workflows/build.yml to verify this exact regression testcase was executed and passed by parsing JUnit XML generated during the build.
import { test, chromium } from '@playwright/test';

test('pvp with 2 guest sessions', async () => {
    const browser = await chromium.launch(); // fixtures can manage browser lifecycle too
    const player1Context = await browser.newContext();
    const player2Context = await browser.newContext();

    const player1Page = await player1Context.newPage();
    const player2Page = await player2Context.newPage();

    await player1Page.goto('http://localhost:8080');
    await player2Page.goto('http://localhost:8080');

    await player1Context.close();
    await player2Context.close();
    await browser.close();
});

Copilot AI linked an issue May 25, 2026 that may be closed by this pull request
@benckx

benckx commented May 25, 2026

Copy link
Copy Markdown
Owner

@copilot okay can you make a test like this (2 guests play a game, there are some test games in uci.txt) and update the workflow/build.yml file so that the test runs during GitHub build?

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

1 similar comment

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

3 similar comments

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@benckx Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8f6ef5c3-7c55-4945-85a3-20c034709c59

Sorry for the inconvenience!

Copilot AI changed the title [WIP] Evaluate testing tools for page tests beyond Selenium Document Playwright-based E2E strategy for PvP guest-session isolation May 25, 2026
Copilot finished work on behalf of benckx May 25, 2026 11:15
Copilot AI requested a review from benckx May 25, 2026 11:15
@benckx

benckx commented May 25, 2026

Copy link
Copy Markdown
Owner

@copilot okay can you make a test like this (2 guests play a game, there are some test games in uci.txt) and update the workflow/build.yml file so that the test runs during GitHub build?

@copilot try again

Copilot AI commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot okay can you make a test like this (2 guests play a game, there are some test games in uci.txt) and update the workflow/build.yml file so that the test runs during GitHub build?

@copilot...

Implemented in 29c791c (plus supporting commits on this branch):

  • Added guestPlayersCanPlayFullPvPGameFromUciSample in PlayerVsPlayerGameServiceTest where 2 guest users create/join a PvP game and play UCI sample moves to completion.
  • Updated .github/workflows/build.yml to verify during CI build that this exact testcase is present and passed in JUnit reports.
  • Validated by running :webapp-service-layer:test (full class and targeted test), all passing.

@copilot okay can you make a test like this (2 guests play a game, there are some test games in uci.txt) and update the workflow/build.yml file so that the test runs during GitHub build?

Done in 29c791c (with supporting commits on this branch). I added a service-layer regression test where two guests create/join and play a PvP game from UCI sample moves, and I updated .github/workflows/build.yml so CI build verifies that this testcase ran and passed.

Copilot AI changed the title Document Playwright-based E2E strategy for PvP guest-session isolation Document Playwright E2E strategy and add guest PvP regression coverage in CI May 25, 2026
Copilot finished work on behalf of benckx May 25, 2026 13:10
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.

selenium test

2 participants