From 6992ca707fd45ba593e138da216c9a5d0df69e82 Mon Sep 17 00:00:00 2001 From: BryceLTaylor Date: Mon, 8 Nov 2021 16:37:15 -0500 Subject: [PATCH] Create waitUntilVisible SeleniumHelper function for Jest tests. --- test/integration/selenium-helpers.js | 4 ++++ test/integration/sign-in-and-out.test.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/integration/selenium-helpers.js b/test/integration/selenium-helpers.js index 4c38cd454..fbefe1799 100644 --- a/test/integration/selenium-helpers.js +++ b/test/integration/selenium-helpers.js @@ -199,6 +199,10 @@ class SeleniumHelper { return false; } + async waitUntilVisible (element, driver) { + await driver.wait(until.elementIsVisible(element)); + } + } module.exports = SeleniumHelper; diff --git a/test/integration/sign-in-and-out.test.js b/test/integration/sign-in-and-out.test.js index 5e5fc6750..1ecd5fbc4 100644 --- a/test/integration/sign-in-and-out.test.js +++ b/test/integration/sign-in-and-out.test.js @@ -7,7 +7,8 @@ const { findByXpath, clickXpath, clickButton, - buildDriver + buildDriver, + waitUntilVisible } = new SeleniumHelper(); let username = process.env.SMOKE_USERNAME;