From a405cc65125989b040ab3f7de14621403084061b Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Wed, 6 Mar 2024 16:17:05 +0500 Subject: [PATCH] test --- commands/playwright-keplr.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commands/playwright-keplr.js b/commands/playwright-keplr.js index ba2ec17eb..ad195cdd5 100644 --- a/commands/playwright-keplr.js +++ b/commands/playwright-keplr.js @@ -2,6 +2,7 @@ const log = require('debug')('synpress:playwright'); const fetch = require('node-fetch'); const _ = require('underscore'); const sleep = require('util').promisify(setTimeout); +const { expect } = require('@playwright/test'); let browser; let mainWindow; @@ -237,6 +238,7 @@ module.exports = { page, args.number || 0, ); + if (args.numberOfClicks && !args.waitForEvent) { await element.click({ clickCount: args.numberOfClicks, @@ -259,7 +261,12 @@ module.exports = { element.click({ force: args.force }), ]); } + } else if (args.waitForVisibility) { + await expect(element).toBeInViewport(); + await element.click({ force: args.force }); } else { + await expect(element).toBeInViewport(); + await element.click({ force: args.force }); } await module.exports.waitUntilStable();