0

I have created some Playwright tests in our NextJS project to run E2E tests. I want these tests to run automatically as part of the Azure DevOps Pipeline.

We have a pipeline that triggers as soon as someone merge to main. The artifact is built using microsoft-hosted agents. The artifact is then released to dev.customer.com. This domain has IP restrictions.

Now, the agent does not have static IP. Azure just assigns it a random IP from a huge range. So it's impossible for us to whitelist it to access dev.customer.com.

How should Playwright be able to access the site with its headless browser? Am I missing something obvious? I guess the main problem is that we have access restrictions to our QA site, but this have to be a pretty common setup I guess?

1 Answer 1

4

You can use the self-hosted agent with a static IP instead the Microsoft-hosted agents.

If you can modify the whitelist of your dev.customer.com in your pipeline with some bash/powershell command, then you can use Microsoft-hosted agents with the following steps:

  • obtain the IP of the current Microsoft-hosted agent.
  • add the IP to the target's whitelist
  • run your test.
  • delete this IP from the whitelist.

You can refer this question and the example.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.