Bypass 2FA with Playwright .NET

playwright with 2fa

Playwright is a tool for end-to-end (e2e) browser testing. Most business logic usually requires a logged-in user, so we need to authenticate the test user from our code programmatically.

One of the challenges of automatic login in e2e testing is 2-factor authentication or 2FA. Even though it doesn’t make much sense to have 2FA enabled for test users, being able to log in with a 2FA user can be very handy sometimes.

In this article, we explore how we can utilize an authenticated browser state and manual login to bypass 2-factor authentication in our playwright tests.


>>> Continue reading <<<

My take on Moq and SponsorLink situation

moq library integration with SupportLink with 'I find it wrong' phrase

Moq is a popular .NET library primarily used for unit testing. Distributed as a NuGet package, its main purpose is to help with mocking dependencies, a technique heavily used to test small blocks of code in isolation.

To many developers’ surprise, there is a new proprietary dll included in the latest 4.20 package version. The dll contains the code of SponsorLink, a new tool developed by the Moq’s author that tries to facilitate Open Source Projects support. It does it by reading email addresses from local git configs, and although it is claimed users’ privacy is respected, many people still find this practice wrong, dubious or even borderline illegal.


>>> Continue reading <<<

Publish images to Azure Container Registry from Bitbucket Pipelines

bitbucket pipelines pushing to azure container registry with dotnet publish

Today is part 3 of our miniseries on dotnet publish and Docker images. In the first one we reviewed how we can generate docker images locally, in the second one we pushed our image to Azure Container Registry with Service Principal authentication from our local environment, and today we will publish our image to Azure Container Registry from our CI build, namely Bitbucket Pipelines.


>>> Continue reading <<<