This was a high-priority Proof of Concept (PoC) task to create the very first component test using our new Playwright test harness. The goal was to test a simple component, Neo.component.Image, to establish a definitive, working pattern for all future component test migrations.
This PoC successfully resolved key unknowns (like module pathing and RMA usage) and now serves as the primary blueprint for other contributors.
Acceptance Criteria
- A new test file was created at
test/playwright/component/specs/image.spec.mjs.
- The
beforeEach hook first navigates to the empty-viewport harness using page.goto('test/playwright/component/apps/empty-viewport/index.html').
- The test waits for the harness to be ready using
await page.waitForSelector('#component-test-viewport').
- A
Neo.component.Image instance is created using the Neo.worker.App.createNeoInstance() RMA method.
- The component's module is loaded using the
importPath config (e.g., importPath: '../component/Image.mjs').
- The component is mounted into the test viewport using the
parentId: 'component-test-viewport' config.
- Image sources (
src) use local, relative paths to project assets (e.g., ../../../../../resources/images/logo/neo_logo_primary.svg).
- The component instance is destroyed in an
afterEach hook using the Neo.worker.App.destroyNeoInstance() RMA method.
- Test Case 1 (Initial Render): Verified that the initial
src and alt attributes were correctly rendered in the DOM.
- Test Case 2 (Reactivity): Used the
Neo.worker.App.setConfigs() RMA method to change the src and alt configs and asserted that the DOM attributes updated correctly.
- The test suite passed successfully.
This was a high-priority Proof of Concept (PoC) task to create the very first component test using our new Playwright test harness. The goal was to test a simple component,
Neo.component.Image, to establish a definitive, working pattern for all future component test migrations.This PoC successfully resolved key unknowns (like module pathing and RMA usage) and now serves as the primary blueprint for other contributors.
Acceptance Criteria
test/playwright/component/specs/image.spec.mjs.beforeEachhook first navigates to theempty-viewportharness usingpage.goto('test/playwright/component/apps/empty-viewport/index.html').await page.waitForSelector('#component-test-viewport').Neo.component.Imageinstance is created using theNeo.worker.App.createNeoInstance()RMA method.importPathconfig (e.g.,importPath: '../component/Image.mjs').parentId: 'component-test-viewport'config.src) use local, relative paths to project assets (e.g.,../../../../../resources/images/logo/neo_logo_primary.svg).afterEachhook using theNeo.worker.App.destroyNeoInstance()RMA method.srcandaltattributes were correctly rendered in the DOM.Neo.worker.App.setConfigs()RMA method to change thesrcandaltconfigs and asserted that the DOM attributes updated correctly.