-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmain.js
33 lines (25 loc) · 1.21 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// This file will be replaced by the content of the Act2.sourceCode field,
// we keep this one here just for testing and clarification.
console.log(
`If you're seeing this text, it means the actor started the default "main.js" file instead
of your own source code file. You have two options how to fix this:
1) Rename your source code file to "main.js"
2) Define custom "package.json" and/or "Dockerfile" that will run your code your way
For more information, see https://docs.apify.com/actors/development/source-code#custom-dockerfile
`);
console.log('Testing Docker image...');
const { Actor } = require('apify');
const { getMemoryInfo } = require('crawlee');
const testFirefox = require('./firefox_test');
Actor.main(async () => {
// Sanity test browsers.
// Try to use full Firefox headless
await testFirefox({ headless: true });
// Try to use full Firefox with XVFB
await testFirefox({ headless: false });
// Try to use playwright default
await testFirefox({ executablePath: undefined });
await testFirefox({ executablePath: process.env.APIFY_DEFAULT_BROWSER_PATH });
// Test that "ps" command is available, sometimes it was missing in official Node builds
await getMemoryInfo();
});