Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-05-28 17:46:32 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-05-28 18:44:28 -0700
commit7e5aedeb0a1ffa727005c98d80044429bf20ff45 (patch)
treee50e71d53cf77f6cb850d3fab01d24e91c9551ae /test/integration/select.test.js
parent2df718998a89cb622bb9a76655abdeafc33d9aa5 (diff)
Move takeScreenshot() function into a test helper file
Diffstat (limited to 'test/integration/select.test.js')
-rw-r--r--test/integration/select.test.js11
1 files changed, 1 insertions, 10 deletions
diff --git a/test/integration/select.test.js b/test/integration/select.test.js
index 69eea00..2594179 100644
--- a/test/integration/select.test.js
+++ b/test/integration/select.test.js
@@ -2,8 +2,7 @@ const { Builder, By, until } = require('selenium-webdriver'),
chrome = require('selenium-webdriver/chrome.js'),
chromeOptions = new chrome.Options(),
{ expect, it } = require('@jest/globals'),
- { mkdir, writeFile, readFile } = require('node:fs/promises'),
- path = require('path'),
+ { readFile } = require('node:fs/promises'),
{ HttpResponse } = require('selenium-webdriver/devtools/networkinterceptor');
chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox');
@@ -182,11 +181,3 @@ it('selects a trooper by clicking on its record and deselects it by clicking on
afterEach(async () => {
await driver.quit();
});
-
-async function takeScreenshot(driver) {
- const dir = './test/screenshots';
- const fileName = path.relative(process.cwd(), __filename) + ' "' + expect.getState().currentTestName + `" ${new Date().toISOString()}.png`;
- const image = await driver.takeScreenshot();
- await mkdir(dir, { recursive: true });
- await writeFile(`${dir}/${fileName.replaceAll('/', '-')}`, image, 'base64');
-}