Spaces:
Runtime error
Runtime error
T1ckbase
commited on
Commit
Β·
e152268
0
Parent(s):
first commit
Browse files- .gitignore +127 -0
- .vscode/settings.json +4 -0
- Dockerfile +18 -0
- deno.json +14 -0
- deno.lock +37 -0
- main.ts +28 -0
- readme.md +10 -0
.gitignore
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Logs
|
2 |
+
logs
|
3 |
+
*.log
|
4 |
+
npm-debug.log*
|
5 |
+
yarn-debug.log*
|
6 |
+
yarn-error.log*
|
7 |
+
lerna-debug.log*
|
8 |
+
|
9 |
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
10 |
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
11 |
+
|
12 |
+
# Runtime data
|
13 |
+
pids
|
14 |
+
*.pid
|
15 |
+
*.seed
|
16 |
+
*.pid.lock
|
17 |
+
|
18 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
19 |
+
lib-cov
|
20 |
+
|
21 |
+
# Coverage directory used by tools like istanbul
|
22 |
+
coverage
|
23 |
+
*.lcov
|
24 |
+
|
25 |
+
# nyc test coverage
|
26 |
+
.nyc_output
|
27 |
+
|
28 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
29 |
+
.grunt
|
30 |
+
|
31 |
+
# Bower dependency directory (https://bower.io/)
|
32 |
+
bower_components
|
33 |
+
|
34 |
+
# node-waf configuration
|
35 |
+
.lock-wscript
|
36 |
+
|
37 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
38 |
+
build/Release
|
39 |
+
|
40 |
+
# Dependency directories
|
41 |
+
node_modules/
|
42 |
+
jspm_packages/
|
43 |
+
|
44 |
+
# Snowpack dependency directory (https://snowpack.dev/)
|
45 |
+
web_modules/
|
46 |
+
|
47 |
+
# TypeScript cache
|
48 |
+
*.tsbuildinfo
|
49 |
+
|
50 |
+
# Optional npm cache directory
|
51 |
+
.npm
|
52 |
+
|
53 |
+
# Optional eslint cache
|
54 |
+
.eslintcache
|
55 |
+
|
56 |
+
# Optional stylelint cache
|
57 |
+
.stylelintcache
|
58 |
+
|
59 |
+
# Optional REPL history
|
60 |
+
.node_repl_history
|
61 |
+
|
62 |
+
# Output of 'npm pack'
|
63 |
+
*.tgz
|
64 |
+
|
65 |
+
# Yarn Integrity file
|
66 |
+
.yarn-integrity
|
67 |
+
|
68 |
+
# dotenv environment variable files
|
69 |
+
.env
|
70 |
+
.env.*
|
71 |
+
!.env.example
|
72 |
+
|
73 |
+
# parcel-bundler cache (https://parceljs.org/)
|
74 |
+
.cache
|
75 |
+
.parcel-cache
|
76 |
+
|
77 |
+
# Next.js build output
|
78 |
+
.next
|
79 |
+
out
|
80 |
+
|
81 |
+
# Nuxt.js build / generate output
|
82 |
+
.nuxt
|
83 |
+
dist
|
84 |
+
|
85 |
+
# Gatsby files
|
86 |
+
.cache/
|
87 |
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
88 |
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
89 |
+
# public
|
90 |
+
|
91 |
+
# vuepress build output
|
92 |
+
.vuepress/dist
|
93 |
+
|
94 |
+
# vuepress v2.x temp and cache directory
|
95 |
+
.temp
|
96 |
+
.cache
|
97 |
+
|
98 |
+
# vitepress build output
|
99 |
+
**/.vitepress/dist
|
100 |
+
|
101 |
+
# vitepress cache directory
|
102 |
+
**/.vitepress/cache
|
103 |
+
|
104 |
+
# Docusaurus cache and generated files
|
105 |
+
.docusaurus
|
106 |
+
|
107 |
+
# Serverless directories
|
108 |
+
.serverless/
|
109 |
+
|
110 |
+
# FuseBox cache
|
111 |
+
.fusebox/
|
112 |
+
|
113 |
+
# DynamoDB Local files
|
114 |
+
.dynamodb/
|
115 |
+
|
116 |
+
# TernJS port file
|
117 |
+
.tern-port
|
118 |
+
|
119 |
+
# Stores VSCode versions used for testing VSCode extensions
|
120 |
+
.vscode-test
|
121 |
+
|
122 |
+
# yarn v2
|
123 |
+
.yarn/cache
|
124 |
+
.yarn/unplugged
|
125 |
+
.yarn/build-state.yml
|
126 |
+
.yarn/install-state.gz
|
127 |
+
.pnp.*
|
.vscode/settings.json
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"editor.formatOnSave": true,
|
3 |
+
"editor.defaultFormatter": "denoland.vscode-deno"
|
4 |
+
}
|
Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM denoland/deno:latest
|
2 |
+
|
3 |
+
|
4 |
+
# Create working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
ENV PLAYWRIGHT_BROWSERS_PATH=/app/node_modules/playwright/.local-browsers
|
8 |
+
|
9 |
+
# Copy source
|
10 |
+
COPY . .
|
11 |
+
|
12 |
+
RUN deno -A npm:playwright install --with-deps chromium
|
13 |
+
|
14 |
+
# Compile the main app
|
15 |
+
RUN deno cache main.ts
|
16 |
+
|
17 |
+
# Run the app
|
18 |
+
CMD ["deno", "run", "-A", "main.ts"]
|
deno.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"imports": {
|
3 |
+
"playwright-core": "npm:playwright-core@^1.53.0"
|
4 |
+
},
|
5 |
+
"fmt": {
|
6 |
+
"indentWidth": 2,
|
7 |
+
"lineWidth": 69420,
|
8 |
+
"proseWrap": "preserve",
|
9 |
+
"semiColons": true,
|
10 |
+
"singleQuote": true,
|
11 |
+
"useTabs": false
|
12 |
+
},
|
13 |
+
"nodeModulesDir": "auto"
|
14 |
+
}
|
deno.lock
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"version": "5",
|
3 |
+
"specifiers": {
|
4 |
+
"npm:playwright-core@^1.53.0": "1.53.0",
|
5 |
+
"npm:playwright@*": "1.51.0"
|
6 |
+
},
|
7 |
+
"npm": {
|
8 |
+
"[email protected]": {
|
9 |
+
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
10 |
+
"os": ["darwin"],
|
11 |
+
"scripts": true
|
12 |
+
},
|
13 |
+
"[email protected]": {
|
14 |
+
"integrity": "sha512-x47yPE3Zwhlil7wlNU/iktF7t2r/URR3VLbH6EknJd/04Qc/PSJ0EY3CMXipmglLG+zyRxW6HNo2EGbKLHPWMg==",
|
15 |
+
"bin": true
|
16 |
+
},
|
17 |
+
"[email protected]": {
|
18 |
+
"integrity": "sha512-mGLg8m0pm4+mmtB7M89Xw/GSqoNC+twivl8ITteqvAndachozYe2ZA7srU6uleV1vEdAHYqjq+SV8SNxRRFYBw==",
|
19 |
+
"bin": true
|
20 |
+
},
|
21 |
+
"[email protected]": {
|
22 |
+
"integrity": "sha512-442pTfGM0xxfCYxuBa/Pu6B2OqxqqaYq39JS8QDMGThUvIOCd6s0ANDog3uwA0cHavVlnTQzGCN7Id2YekDSXA==",
|
23 |
+
"dependencies": [
|
24 | |
25 |
+
],
|
26 |
+
"optionalDependencies": [
|
27 |
+
"fsevents"
|
28 |
+
],
|
29 |
+
"bin": true
|
30 |
+
}
|
31 |
+
},
|
32 |
+
"workspace": {
|
33 |
+
"dependencies": [
|
34 |
+
"npm:playwright-core@^1.53.0"
|
35 |
+
]
|
36 |
+
}
|
37 |
+
}
|
main.ts
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { chromium, devices } from 'playwright-core';
|
2 |
+
|
3 |
+
const browser = await chromium.launch({
|
4 |
+
headless: false,
|
5 |
+
args: ['--disable-blink-features=AutomationControlled'],
|
6 |
+
});
|
7 |
+
const context = await browser.newContext({
|
8 |
+
// ...devices['Desktop Chrome'],
|
9 |
+
...devices['Galaxy S24'],
|
10 |
+
colorScheme: 'dark',
|
11 |
+
// deviceScaleFactor: undefined,
|
12 |
+
// viewport: null,
|
13 |
+
// viewport: {
|
14 |
+
// width: 1920,
|
15 |
+
// height: 1080,
|
16 |
+
// },
|
17 |
+
});
|
18 |
+
const page = await context.newPage();
|
19 |
+
|
20 |
+
// await page.goto('https://bot.sannysoft.com/');
|
21 |
+
await page.goto('https://translate.google.com/?hl=en&sl=en&tl=es&op=images');
|
22 |
+
|
23 |
+
// await page.pause();
|
24 |
+
|
25 |
+
await page.waitForEvent('close', { timeout: 0 });
|
26 |
+
|
27 |
+
await context.close();
|
28 |
+
await browser.close();
|
readme.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
title: deno playwright test 1
|
3 |
+
emoji: π¦
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: green
|
6 |
+
sdk: docker
|
7 |
+
pinned: false
|
8 |
+
short_description: a
|
9 |
+
app_port: 3000
|
10 |
+
---
|