From f0b5c1a511ba794609178e5f08e7c8f8c2ec1723 Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Thu, 6 Mar 2025 15:27:27 -0800
Subject: Add Jest testing framework
---
__tests__/integration/page.spec.js | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 __tests__/integration/page.spec.js
(limited to '__tests__/integration/page.spec.js')
diff --git a/__tests__/integration/page.spec.js b/__tests__/integration/page.spec.js
new file mode 100644
index 0000000..069a222
--- /dev/null
+++ b/__tests__/integration/page.spec.js
@@ -0,0 +1,21 @@
+const { Builder } = require('selenium-webdriver');
+const chrome = require('selenium-webdriver/chrome');
+const chromeOptions = new chrome.Options();
+
+let driver;
+
+chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox');
+
+beforeEach(async () => {
+ const builder = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions);
+ driver = builder.build();
+});
+
+it('loads the page', async () => {
+ await driver.get('http://localhost:8080');
+ expect(await driver.getTitle()).toEqual('SVG Element Pan & Zoom Demo');
+});
+
+afterEach(async () => {
+ await driver.quit();
+});
--
cgit v1.2.3