Skip to content

Conversation

thienng-it
Copy link

@thienng-it thienng-it commented Oct 6, 2025

Description of the PR

This pull request continues the effort to modernize the testing infrastructure by converting all legacy PHP-based view forms in test/data/app/view/form into self-contained, executable JavaScript files.

By serving these test pages directly from Node.js, this change removes the dependency on a PHP server for running the acceptance tests. This simplifies the testing setup, making it easier and more efficient for contributors to run tests locally and in CI environments. This is a maintenance task aimed at improving the overall developer experience.

This PR does not resolve a specific open issue but is part of the broader test cleanup and modernization initiative.

--> Resolves the issue #5245

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

dependabot bot and others added 30 commits July 16, 2025 09:36
Bumps [playwright](https://github.com/microsoft/playwright) from 1.53.0 to 1.54.1.
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](microsoft/playwright@v1.53.0...v1.54.1)

---
updated-dependencies:
- dependency-name: playwright
  dependency-version: 1.54.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.31.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [expect](https://github.com/jestjs/jest/tree/HEAD/packages/expect) from 29.7.0 to 30.0.4.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.4/packages/expect)

---
updated-dependencies:
- dependency-name: expect
  dependency-version: 30.0.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.10.0 to 16.11.0.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.10.0...v16.11.0)

---
updated-dependencies:
- dependency-name: graphql
  dependency-version: 16.11.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [electron](https://github.com/electron/electron) from 37.1.0 to 37.2.3.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v37.1.0...v37.2.3)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 37.2.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [axios](https://github.com/axios/axios) from 1.8.4 to 1.11.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.8.4...v1.11.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…deceptjs#5046)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/typedoc2md/typedoc-plugin-markdown/releases)
- [Changelog](https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/CHANGELOG.md)
- [Commits](https://github.com/typedoc2md/typedoc-plugin-markdown/commits/typedoc-plugin-markdown@4.7.1/packages/typedoc-plugin-markdown)

---
updated-dependencies:
- dependency-name: typedoc-plugin-markdown
  dependency-version: 4.7.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…s#5041)

Bumps [browser-actions/setup-chrome](https://github.com/browser-actions/setup-chrome) from 1 to 2.
- [Release notes](https://github.com/browser-actions/setup-chrome/releases)
- [Changelog](https://github.com/browser-actions/setup-chrome/blob/master/CHANGELOG.md)
- [Commits](browser-actions/setup-chrome@v1...v2)

---
updated-dependencies:
- dependency-name: browser-actions/setup-chrome
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.7 to 0.28.10.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](TypeStrong/typedoc@v0.28.7...v0.28.10)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-version: 0.28.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix: hook exit code

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update asyncWrapper.js

* Update asyncWrapper.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [tsd](https://github.com/tsdjs/tsd) from 0.32.0 to 0.33.0.
- [Release notes](https://github.com/tsdjs/tsd/releases)
- [Commits](tsdjs/tsd@v0.32.0...v0.33.0)

---
updated-dependencies:
- dependency-name: tsd
  dependency-version: 0.33.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…deceptjs#5067)

Bumps [typedoc-plugin-markdown](https://github.com/typedoc2md/typedoc-plugin-markdown/tree/HEAD/packages/typedoc-plugin-markdown) from 4.7.1 to 4.8.1.
- [Release notes](https://github.com/typedoc2md/typedoc-plugin-markdown/releases)
- [Changelog](https://github.com/typedoc2md/typedoc-plugin-markdown/blob/main/packages/typedoc-plugin-markdown/CHANGELOG.md)
- [Commits](https://github.com/typedoc2md/typedoc-plugin-markdown/commits/typedoc-plugin-markdown@4.8.1/packages/typedoc-plugin-markdown)

---
updated-dependencies:
- dependency-name: typedoc-plugin-markdown
  dependency-version: 4.8.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Timeout` value at the end of test suite (codeceptjs#5077)

* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
codeceptjs#5082)

* Initial plan

* Fix JUnit XML test case name inconsistency in scenario retries

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Improve edge case handling for empty suite titles in cloned tests

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* fix: TestCafe_test.js

* Fix TestCafe form submission timeout with efficient polling mechanism (codeceptjs#5080)

* Initial plan

* Fix failed TestCafe tests by skipping doubleClick test

* Update testcafe.yml

* Update testcafe.yml

* Update TestCafe_test.js

* Update TestCafe_test.js

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Fix TestCafe form submission timeout in CI environments

* Improve TestCafe form submission timeout handling with polling mechanism

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Improve TestCafe form submission timeout with efficient polling mechanism

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Update testcafe.yml

* fix: Chrome popup causes problems with TestCafe

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Co-authored-by: kobenguyent <kobenguyent@gmail.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Add TypeScript types for Feature.only method

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Fix TypeScript test expectations for hook return types

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
* Initial plan

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Samuel-StO and others added 25 commits September 24, 2025 13:01
* fix: wrong stats when running with workers

* fix: failed runner tests
…js#5192)

* feat: add support for Playwright storageState configuration and helper methods

* doc : run docs

---------

Co-authored-by: kobenguyent <kobenguyent@gmail.com>
…odeceptjs#5222)

* fixed: types: PupeteerConfig.waitForNavigation can be an array

* restore original formatting

* fix Puppeteer links

* fixed more links
* enhance workers cli log

* fix: make worker enhancements backward compatible with all test suites

- Made feature name display conditional (only in workers mode)
- Preserved run-multiple process format [X.suite:browser]
- Updated test expectations to match new enhanced format
- All test suites now passing (221 runner + 477 unit tests)

Changes:
- lib/output.js: Conditional feature names + run-multiple detection
- test/unit/output_test.js: Updated worker badge test expectation
- test/runner/run_workers_test.js: Updated 3 test expectations

Fixes codeceptjs#5234
* fixed: typings for class Result

* fix docs for getters
* mock server

* mock server

* lint fix

* fix: acceptance tests cannot access mock server

* fix: acceptance tests cannot access mock server

* fix: flaky timeout test
* address HTML reporter issues

* address HTML reporter issues

* fix UTs and lint issue
@kobenguyent kobenguyent requested a review from Copilot October 6, 2025 07:12
Copy link
Contributor

@Copilot 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 replaces many legacy PHP view fixtures in test/data/app/view/form with self-contained JavaScript files that serve equivalent test pages via a Node.js HTTP server, to remove the dependency on a PHP server for acceptance tests.

  • Convert numerous PHP-based test views to JS files that embed the HTML and spin up a local HTTP server.
  • Remove many legacy PHP view files.
  • Minor docs update in docs/plugins.md.

Reviewed Changes

Copilot reviewed 94 out of 94 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test/data/app/view/form/wait_visible.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_value.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_num_elements.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_js.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_invisible.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_for_clickable.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_enabled.php Removed legacy PHP view replaced by wait_enabled.js.
test/data/app/view/form/wait_enabled.js Added Node-served HTML page enabling elements after delay.
test/data/app/view/form/wait_element.php Removed legacy PHP view replaced by wait_element.js.
test/data/app/view/form/wait_element.js Added Node-served HTML page adding element after delay.
test/data/app/view/form/wait_disabled.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/wait_detached.php Removed legacy PHP view replaced by wait_detached.js.
test/data/app/view/form/wait_detached.js Added Node-served HTML page hiding/removing elements.
test/data/app/view/form/wait_clickable.php Removed legacy PHP view replaced by wait_clickable.js.
test/data/app/view/form/wait_clickable.js Added Node-served HTML page with deferred clickable element.
test/data/app/view/form/unchecked.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/textarea.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/submitform_multiple.php Removed legacy PHP view replaced by submitform_multiple.js.
test/data/app/view/form/submitform_multiple.js Added Node-served HTML multi-select form.
test/data/app/view/form/submitform_ampersands.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/submit_adjacentforms.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/select_two_submits.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/select_onchange.php Removed legacy PHP view replaced by select_onchange.js.
test/data/app/view/form/select_onchange.js Added Node-served HTML enabling submit on selection.
test/data/app/view/form/select_multiple.php Removed legacy PHP view replaced by select_multiple.js.
test/data/app/view/form/select_multiple.js Added Node-served HTML multi-select demo.
test/data/app/view/form/select_additional_spaces.php Removed legacy PHP view replaced by select_additional_spaces.js.
test/data/app/view/form/select_additional_spaces.js Added Node-served HTML select with spaced options.
test/data/app/view/form/select.php Removed legacy PHP view replaced by select.js.
test/data/app/view/form/select.js Added Node-served HTML select demo.
test/data/app/view/form/scroll_into_view.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/scroll.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/rightclick.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/resize.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/relative_siteroot.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/radio.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/popup.php Removed legacy PHP view replaced by popup.js.
test/data/app/view/form/popup.js Added Node-served HTML demo for alert/confirm.
test/data/app/view/form/page_slider.php Removed legacy PHP view replaced by page_slider.js.
test/data/app/view/form/page_slider.js Added Node-served HTML range slider demo.
test/data/app/view/form/names-sq-brackets.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/index.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/image.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/hover.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/hidden.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/form_with_buttons.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/focus_blur_elements.js Converted to Node-served HTML for focus/blur demo.
test/data/app/view/form/file.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/field_values.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/field.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/fetch_call.js Converted to Node-served HTML fetch demo.
test/data/app/view/form/example9.js Converted to Node-served HTML file upload form.
test/data/app/view/form/example8.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example7.php Removed legacy PHP fragment (no JS replacement present).
test/data/app/view/form/example6.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example5.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example4.php Removed legacy PHP page replaced by example4.js.
test/data/app/view/form/example4.js Added Node-served HTML registration form (bootstrap references).
test/data/app/view/form/example3.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example20.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example2.js Converted to Node-served HTML login form.
test/data/app/view/form/example17.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example16.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example15.js Converted to Node-served HTML form.
test/data/app/view/form/example14.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example13.php Removed legacy PHP view replaced by example13.js.
test/data/app/view/form/example13.js Added Node-served HTML multi-file upload form.
test/data/app/view/form/example12.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example11.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example10.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/example1.js Converted to Node-served HTML login form.
test/data/app/view/form/empty_fill.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/empty.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/download.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/doubleClick.js Converted to Node-served HTML double-click demo.
test/data/app/view/form/custom_locator.php Removed legacy PHP view replaced by customLocator.js.
test/data/app/view/form/customLocatorStrategies.js Converted to Node-served HTML for custom locator tests.
test/data/app/view/form/customLocator.js Added Node-served HTML for multi-step buttons with data-test-id.
test/data/app/view/form/css_colors.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/contenteditable.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/complex.php Removed legacy PHP view replaced by complex.js.
test/data/app/view/form/complex.js Added Node-served HTML complex form.
test/data/app/view/form/checkbox_array.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/checkbox.php Removed legacy PHP view (replaced by agreeCheckbox.js).
test/data/app/view/form/button.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/bug1637.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/bug1598.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/bug1585.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/bug1535.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/bug1467.php Removed legacy PHP view (no JS replacement present).
test/data/app/view/form/aria.php Removed legacy PHP accessibility view replaced by accessibilityForm.js.
test/data/app/view/form/agreeCheckbox.js Added Node-served HTML checkbox form.
test/data/app/view/form/accessibilityForm.js Added Node-served HTML accessibility form.
docs/plugins.md Added minimal note for “reportData” section.
Comments suppressed due to low confidence (2)

docs/plugins.md:1

  • The new 'reportData' section is too terse and ambiguous for the plugins page. Please either document what 'reportData' is (scope, usage, examples) or move this note to the appropriate section (e.g., a TypeScript tips/troubleshooting page).
---

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

Comment on lines +72 to +73
.listen(8100, () => {
console.log('✅ Complex form running at http://127.0.0.1:8100')
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Every converted page starts its own HTTP server on the hardcoded port 8100. Running more than one at a time will cause EADDRINUSE; please guard server startup and allow configurable ports (e.g., via process.env.PORT), or export a handler and register all pages under a single shared server.

Suggested change
.listen(8100, () => {
console.log('✅ Complex form running at http://127.0.0.1:8100')
.listen(process.env.PORT || 8100, () => {
const port = process.env.PORT || 8100;
console.log(`✅ Complex form running at http://127.0.0.1:${port}`);

Copilot uses AI. Check for mistakes.

Comment on lines +45 to +53
// Run a simple local server to serve this HTML
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Select Form demo view running at http://127.0.0.1:8100')
})
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The server bootstrap is duplicated across many files. Consider extracting a small helper (e.g., serveHtml(html, {port})) or, preferably, mount all pages under a single Node server with distinct routes to reduce duplication and avoid port conflicts.

Suggested change
// Run a simple local server to serve this HTML
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Select Form demo view running at http://127.0.0.1:8100')
})
// Helper to serve HTML on a given port
function serveHtml(html, { port }) {
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(html);
})
.listen(port, () => {
console.log(`✅ Select Form demo view running at http://127.0.0.1:${port}`);
});
}
// Run the server using the helper
serveHtml(html, { port: 8100 });

Copilot uses AI. Check for mistakes.

Comment on lines +17 to +21
<link href="http://127.0.0.1:8100/css/bootstrap.min.css" rel="stylesheet">
<link href="http://127.0.0.1:8100/css/default.css" rel="stylesheet">
<script src="http://127.0.0.1:8100/js/jquery.min.js"></script>
<script src="http://127.0.0.1:8100/js/bootstrap.min.js"></script>
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

These assets are referenced from the same origin/port, but this server doesn't serve /css or /js paths; they will 404. Use a CDN, serve static assets in your Node server, or remove non-essential asset references to avoid failing network requests.

Copilot uses AI. Check for mistakes.

@@ -1,4 +1,17 @@
<html>
/**
* fileUploadForm.js
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Header comment says 'fileUploadForm.js' but the file name is example9.js. Please align the header to the actual file name to avoid confusion.

Suggested change
* fileUploadForm.js
* example9.js

Copilot uses AI. Check for mistakes.

## reportData
TypeScript: Explicitly type reportData arrays as any\[] to avoid 'never' errors
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

The type annotation should be 'any[]' without escaping the square brackets.

Suggested change
TypeScript: Explicitly type reportData arrays as any\[] to avoid 'never' errors
TypeScript: Explicitly type reportData arrays as any[] to avoid 'never' errors

Copilot uses AI. Check for mistakes.

<option value="child">below 13</option>
<option value="teenage">13-21</option>
<option value="adult">21-60</option>
<option value="oldfag">60-100</option>
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Please replace non-inclusive/offensive terms in option values/text with neutral wording (e.g., value='senior' or similar) to keep fixtures appropriate and accessible.

Suggested change
<option value="oldfag">60-100</option>
<option value="senior">60-100</option>

Copilot uses AI. Check for mistakes.

Comment on lines +66 to +74
// Start simple local web server
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Complex form running at http://127.0.0.1:8100')
})
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Consider guarding startup so the module can be imported without side effects and optionally reused in a consolidated server: use if (require.main === module) around listen(), export a request handler, and allow PORT override via env.

Suggested change
// Start simple local web server
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Complex form running at http://127.0.0.1:8100')
})
// Request handler for the complex form
function handler(req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end(html);
}
module.exports = handler;
// Start server only if run directly
if (require.main === module) {
const PORT = process.env.PORT || 8100;
http.createServer(handler).listen(PORT, () => {
console.log(`✅ Complex form running at http://127.0.0.1:${PORT}`);
});
}

Copilot uses AI. Check for mistakes.

Comment on lines +56 to +62
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Select Form demo view running at http://127.0.0.1:8100')
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

All converted files bind to the same fixed port (8100). If multiple pages need to be available during a single test run, this will fail. Please parameterize the port or consolidate into a single server with routes (e.g., /form/select_additional_spaces).

Suggested change
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(8100, () => {
console.log('✅ Select Form demo view running at http://127.0.0.1:8100')
// Parameterize the port: use process.env.PORT, or first CLI arg, or default to 8100
const port = process.env.PORT
? parseInt(process.env.PORT, 10)
: (process.argv[2] ? parseInt(process.argv[2], 10) : 8100);
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/html' })
res.end(html)
})
.listen(port, () => {
console.log(`✅ Select Form demo view running at http://127.0.0.1:${port}`)

Copilot uses AI. Check for mistakes.

@kobenguyent kobenguyent changed the base branch from 3.x to 4.x October 7, 2025 08:09
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.