question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Component testing and page.goto

See original GitHub issue

Context:

  • Playwright Version: 1.24.0
  • Operating System: All
  • Node.js version: v17.3.0
  • Browser: Chromium
  • Extra: Vue component testing

I’ve been playing with the Vue component testing feature and it seems like the page.goto() is not working properly.

For example i have a failing test that should be passing.

It should navigate to the 404 page because i have a catch all specified /:pathMatch(.*)* inside Vue router see the code here.

The Vue router plugin is registered here.

Here you can see another example that also uses the page.goto function that i can’t get to work.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sand4rtcommented, Jul 26, 2022

Thanks for explaining! Yes, makes sense. Yeah i believe it’s either history mode or hash mode.

The first use case/test is works!

Navigating before mount doesn’t work yet. I need to debug it a little further.

Don’t you think that the API for navigating in SPA’s is a bit too verbose? I think the config.use.baseURL setting is not respected when using page.evaluate(() => window.history.....) as well right?

Why not something like?:

page.goto('/route-not-exsist', { mode: 'history' })
0reactions
sand4rtcommented, Oct 6, 2022

I don’t think a link is the only contract. Users are able to type the url in the browsers address bar as well (aka page.goto). imo we should be able to mimic the user’s behaviour even if this reloads the JS state.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Testing Tutorial: A Comprehensive Guide With ...
This Component testing tutorial delves deeper into its importance, techniques, phases, and how to perform Component testing with examples.
Read more >
What is Component Testing Or Module Testing (Learn With ...
What is Component Testing also called Module Testing in Software Testing: A component is the lowest unit of any application.
Read more >
Basics of testing components - Angular
But in many cases, testing the component class alone, without DOM ... To write these kinds of test, you'll use additional features of...
Read more >
Functional browser testing with Puppeteer - CircleCI
Learn how to write functional browser tests for your CI pipeline with Puppeteer.
Read more >
React end-to-end testing with Jest and Puppeteer
Like the previous test we wrote, the beforeAll function is used to create new instances of Puppeteer and a new page. Then, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found