Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

1.3 KB
Raw Blame
<html>
  <head>
    <link rel='stylesheet' href='style.css'>
    <style>
      @font-face {
        font-family: 'font';
        src: url('font.woff2') format('woff2');
      }

      body {
        font-family: 'font';
      }
    </style>
    <script src='script.js'></script>
    <script>
      const body = JSON.stringify({
        data: {
          key: 'value',
          array: ['value-1', 'value-2'],
        },
      });
      const fetches = [
        fetch('/api/endpoint'),
        fetch('/call-with-query-params?param1=value1&param1=value2&param2=value2'),
        fetch('/post-data-1', {
          method: 'POST',
          headers: { 'content-type': 'application/json' },
          body,
        }),
        fetch('/post-data-2', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body,
        }),
        fetch('/post-xml-data', {
          method: 'POST',
          headers: { 'Content-Type': 'application/xml' },
          body: `<?xml version="1.0"?><note to="Alice" from="Bob"><body>Hello &amp; welcome!</body></note>`,
        }),
      ];
      window.donePromise = Promise.all(fetches.map(f => f.then(r => r.body()).then(() => null).catch(e => {})));
    </script>
    <script></script>
    <script>

    </script>
  </head>
  <body>
    <h1>Network Tab Test</h1>
    <img src="image.png" >
  </body>
</html>