Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions packages/modules/selenium/src/selenium-container.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
import path from "path";
import { Browser, Builder } from "selenium-webdriver";
import { GenericContainer, StartedTestContainer } from "testcontainers";
import { GenericContainer } from "testcontainers";
import tmp from "tmp";
import { SeleniumContainer, SELENIUM_VIDEO_IMAGE } from "./selenium-container";

describe("SeleniumContainer", { timeout: 180_000 }, () => {
let ffmpegContainer: StartedTestContainer;

beforeAll(async () => {
ffmpegContainer = await new GenericContainer(SELENIUM_VIDEO_IMAGE).withCommand(["sleep", "infinity"]).start();
});

afterAll(async () => {
await ffmpegContainer.stop();
});

const browsers = [
["CHROME", process.arch === "arm64" ? `seleniarm/standalone-chromium:112.0` : `selenium/standalone-chrome:112.0`],
["FIREFOX", process.arch === "arm64" ? `seleniarm/standalone-firefox:112.0` : `selenium/standalone-firefox:112.0`],
Expand Down Expand Up @@ -43,9 +33,13 @@ describe("SeleniumContainer", { timeout: 180_000 }, () => {
const videoFileName = path.basename(videoFilePath);
await stoppedContainer.saveRecording(videoFilePath);

const ffmpegContainer = await new GenericContainer(SELENIUM_VIDEO_IMAGE)
.withCommand(["sleep", "infinity"])
.start();
await ffmpegContainer.copyFilesToContainer([{ source: videoFilePath, target: `/tmp/${videoFileName}` }]);
const { exitCode } = await ffmpegContainer.exec(["ffprobe", `/tmp/${videoFileName}`]);
expect(exitCode).toBe(0);
await ffmpegContainer.stop();
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Dockerode from "dockerode";
import { afterEach } from "vitest";
import { ImageName } from "../image-name";

const mockImageInspect = vi.fn();
Expand Down