Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/helpers.cjs')
-rw-r--r--test/integration/helpers.cjs5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/integration/helpers.cjs b/test/integration/helpers.cjs
index 5643bfd..7e3e0fd 100644
--- a/test/integration/helpers.cjs
+++ b/test/integration/helpers.cjs
@@ -9,3 +9,8 @@ global.takeScreenshot = async (driver) => {
await mkdir(dir, { recursive: true });
await writeFile(`${dir}/${fileName.replaceAll('/', '-')}`, image, 'base64');
};
+
+global.url = (relativeOrAbsolute) => {
+ const location = new URL(relativeOrAbsolute, global.testServerUrl);
+ return location.href;
+}