init commit
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1 @@
|
||||
import{M as E,r as a,c as x,j as c,a as t,T as M,t as C,W as j,b as F,d as O}from"./assets/wsPort-23488fec.js";const I=()=>{const[l,P]=a.useState(!1),[d,h]=a.useState([]),[p,W]=a.useState([]),[f,N]=a.useState(L),[m,v]=a.useState({done:0,total:0}),[b,u]=a.useState(!1),[S,w]=a.useState(null),[y,U]=a.useState(null),g=a.useCallback(e=>{const o=[],s=[],r=new URL(window.location.href);for(let i=0;i<e.length;i++){const n=e.item(i);if(!n)continue;const k=URL.createObjectURL(n);o.push(k),s.push(n.name),r.searchParams.append("trace",k),r.searchParams.append("traceFileName",n.name)}const T=r.toString();window.history.pushState({},"",T),h(o),W(s),u(!1),w(null)},[]),D=a.useCallback(e=>{e.preventDefault(),g(e.dataTransfer.files)},[g]),R=a.useCallback(e=>{e.preventDefault(),e.target.files&&g(e.target.files)},[g]);return a.useEffect(()=>{const e=new URL(window.location.href).searchParams,o=e.getAll("trace");P(e.has("isServer"));for(const s of o)if(s.startsWith("file:")){U(s||null);return}e.has("isServer")?x({onEvent(s,r){s==="loadTrace"&&(h(r.url?[r.url]:[]),u(!1),w(null))},onClose(){}}).then(s=>{s("ready")}):o.some(s=>s.startsWith("blob:"))||h(o)},[]),a.useEffect(()=>{(async()=>{if(d.length){const e=r=>{r.data.method==="progress"&&v(r.data.params)};navigator.serviceWorker.addEventListener("message",e),v({done:0,total:1});const o=[];for(let r=0;r<d.length;r++){const T=d[r],i=new URLSearchParams;i.set("trace",T),p.length&&i.set("traceFileName",p[r]);const n=await fetch(`contexts?${i.toString()}`);if(!n.ok){l||h([]),w((await n.json()).error);return}o.push(...await n.json())}navigator.serviceWorker.removeEventListener("message",e);const s=new E(o);v({done:0,total:0}),N(s)}else N(L)})()},[l,d,p]),c("div",{className:"vbox workbench",onDragOver:e=>{e.preventDefault(),u(!0)},children:[c("div",{className:"hbox header",children:[t("div",{className:"logo",children:"🎭"}),t("div",{className:"product",children:"Playwright"}),f.title&&t("div",{className:"title",children:f.title}),t("div",{className:"spacer"}),t(M,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>C()})]}),t("div",{className:"progress",children:t("div",{className:"inner-progress",style:{width:m.total?100*m.done/m.total+"%":0}})}),t(j,{model:f}),y&&c("div",{className:"drop-target",children:[t("div",{children:"Trace Viewer uses Service Workers to show traces. To view trace:"}),c("div",{style:{paddingTop:20},children:[c("div",{children:["1. Click ",t("a",{href:y,children:"here"})," to put your trace into the download shelf"]}),c("div",{children:["2. Go to ",t("a",{href:"https://trace.playwright.dev",children:"trace.playwright.dev"})]}),t("div",{children:"3. Drop the trace from the download shelf into the page"})]})]}),!l&&!b&&!y&&(!d.length||S)&&c("div",{className:"drop-target",children:[t("div",{className:"processing-error",children:S}),t("div",{className:"title",children:"Drop Playwright Trace to load"}),t("div",{children:"or"}),t("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.multiple=!0,e.click(),e.addEventListener("change",o=>R(o))},children:"Select file(s)"}),t("div",{style:{maxWidth:400},children:"Playwright Trace Viewer is a Progressive Web App, it does not send your trace anywhere, it opens it locally."})]}),l&&!d.length&&t("div",{className:"drop-target",children:t("div",{className:"title",children:"Select test to see the trace"})}),b&&t("div",{className:"drop-target",onDragLeave:()=>{u(!1)},onDrop:e=>D(e),children:t("div",{className:"title",children:"Release to analyse the Playwright Trace"})})]})},L=new E([]);(async()=>(F(),window.location.protocol!=="file:"&&(window.location.href.includes("isUnderTest=true")&&await new Promise(l=>setTimeout(l,1e3)),navigator.serviceWorker.register("sw.bundle.js"),navigator.serviceWorker.controller||await new Promise(l=>{navigator.serviceWorker.oncontrollerchange=()=>l()}),setInterval(function(){fetch("ping")},1e4)),O.render(t(I,{}),document.querySelector("#root"))))();
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="./icon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="./icon-16x16.png">
|
||||
<link rel="manifest" href="./manifest.webmanifest">
|
||||
<title>Playwright Trace Viewer</title>
|
||||
<script type="module" crossorigin src="./index.85329f14.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/wsPort-23488fec.js">
|
||||
<link rel="stylesheet" href="./wsPort.9e506779.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
<dialog id="fallback-error">
|
||||
<p>The Playwright Trace Viewer must be loaded over the <code>http://</code> or <code>https://</code> protocols.</p>
|
||||
<p>For more information, please see the <a href="https://aka.ms/playwright/trace-viewer-file-protocol">docs</a>.</p>
|
||||
</dialog>
|
||||
<script>
|
||||
if (!/^https?:/.test(window.location.protocol))
|
||||
document.getElementById("fallback-error").show();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<body>
|
||||
<script>
|
||||
(async () => {
|
||||
navigator.serviceWorker.register('sw.bundle.js');
|
||||
if (!navigator.serviceWorker.controller)
|
||||
await new Promise(f => navigator.serviceWorker.oncontrollerchange = f);
|
||||
const traceUrl = new URL(location.href).searchParams.get('trace');
|
||||
const params = new URLSearchParams();
|
||||
params.set('trace', traceUrl);
|
||||
await fetch('context?' + params.toString()).then(r => r.json());
|
||||
await location.reload();
|
||||
})();
|
||||
</script>
|
||||
<script src="stall.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,20 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="./icon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="./icon-16x16.png">
|
||||
<link rel="manifest" href="./uiMode.webmanifest">
|
||||
<title>Playwright Test</title>
|
||||
<script type="module" crossorigin src="./uiMode.8b34c49e.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/wsPort-23488fec.js">
|
||||
<link rel="stylesheet" href="./wsPort.9e506779.css">
|
||||
<link rel="stylesheet" href="./uiMode.922a7b48.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
||||
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
||||
* https://github.com/chjj/term.js
|
||||
* @license MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
* Originally forked from (with the author's permission):
|
||||
* Fabrice Bellard's javascript vt100 for jslinux:
|
||||
* http://bellard.org/jslinux/
|
||||
* Copyright (c) 2011 Fabrice Bellard
|
||||
* The original design remains. The terminal itself
|
||||
* has been extended to include xterm CSI codes, among
|
||||
* other features.
|
||||
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;z-index:10;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:.5}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-decoration-overview-ruler{z-index:7;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}
|
||||
Reference in New Issue
Block a user