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.

All options have been expanded in call sites?

See original GitHub issue

Hi there, just a quick question for you, I just updated the PlaywrightSharp nuget package to latest version and read the September report in which I saw there were breaking changes to the way we initialize the browser.

In the text after, it is said the the rest of the code should not have to be updated to work with the newer package, but in my case it breaks in multiple places… I would like to know if it’s normal or if I did something wrong here…

For example, I was usually calling page.GoToAsync in the following way:

await page.GoToAsync(url, new GoToOptions
{
    WaitUntil = new WaitUntilNavigation[] { WaitUntilNavigation.Load }
});

but that doesn’t seem to work anymore, it seems like the GoToOptions have been expanded so that we need to put them directly at call site like so:

await page.GoToAsync(url, LifecycleEvent.Load);

In this specific case, the call site is clearer and more concise which is really nice, but in other cases(for example when calling GetPdfAsync, the call has to explicitely specify each option while before I could simply pass the options object.

In my use case, I usually passed the PdfOptions around in my own api and only passed this object to the final function performing the actual conversion, which made it cleaner compared to now where I need to pass each option individually to each call. For now I copied the previous PdfOptions in my local code and I expand it to the final call but I was wondering if I did something wrong or not due to the note on the blog post saying that no other code would need to be updated…

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lvmajorcommented, Oct 1, 2020

Sure sorry I should have done it yesterday

1reaction
kblokcommented, Sep 30, 2020

First, thank you for being an early user @lvmajor. As you may know, being in the v0 stage gives us the liberty to shape the API before reaching v1. Sorry to break your code 🤓

This is a product decision coming from the Playwright team. The idea is having the same philosophy across bindings. We don’t see the use of getting these options in the long term (except for the launch options for settings). As you saw, it looks prettier.

On the other hand, we have extensions methods in C#. That gives the user the extensibility to create an extension method with an option class if they want to.

That being said, if you have a use case scenario where you say that an option class would be helpful, please don’t hesitate to share it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Options Strategies Every Investor Should Know
From the covered call to the iron butterfly, here are 10 of the most common options strategies that you should know.
Read more >
What Is a Bear Call Spread? Definition, Examples, Formula
A bear call spread is an option strategy that involves the sale of a call option and simultaneous purchase of a call option...
Read more >
What Is A Bull Call Spread? - Fidelity
A bull call spread rises in price as the stock price rises and declines as the stock price falls. This means that the...
Read more >
Option Strategy Spotlight: Long Call vs. Bull Call Spread
With so many bullish options strategies to choose from, how do you know which is right for your next trade? In this article,...
Read more >
Long Butterfly Spread with Calls
Learn about the long butterfly spread with calls options strategy here. ... All calls have the same expiration date, and the strike prices...
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