Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] Create a POC for testing Vue Components with Playwright #5199

Open
unlikelyzero opened this issue May 13, 2022 · 1 comment
Open
Assignees
Labels
type:maintenance tests, chores, or project maintenance

Comments

@unlikelyzero
Copy link
Contributor

unlikelyzero commented May 13, 2022

Summary

Component testing support was recently added in an alpha version of playwright/test. They've added support for vue2 recently. microsoft/playwright#14143

Here's the guide https://playwright.dev/docs/test-components

We did an initial attempt at a POC and have a branch here: https://github.com/nasa/openmct/tree/vue2-component-testing-poc

FAQ for getting started microsoft/playwright#14298

Findings:

  • Able to get vue2 component testing framework installed and initialized. Note: had to override vue2 packages after running the playwright init
  • Unable to mount MCT.js Component because of AMD formatting
  • Looked at mounting an individual component and ran into an issue with parsing the vue template format:
<template>
^

SyntaxError: Unexpected token '<'

Next steps:

  • Continue to read about how to mount vue2 components in vite.
  • Possible that we need to import a vite config of our vue2 files after some sort of babel transformation or webpack transformation.
  • Mount the simplest vue component.
@unlikelyzero unlikelyzero added the type:maintenance tests, chores, or project maintenance label May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

No branches or pull requests

2 participants