From c8b206ef85431690767eff40bf36d32dae4521de Mon Sep 17 00:00:00 2001 From: amit3200 Date: Thu, 7 Sep 2023 03:44:43 +0530 Subject: [PATCH 1/3] Making async create comparisons for the poa --- packages/core/src/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/api.js b/packages/core/src/api.js index b10c348ae..919034dac 100644 --- a/packages/core/src/api.js +++ b/packages/core/src/api.js @@ -118,8 +118,9 @@ export function createPercyServer(percy, port) { })) .route('post', '/percy/automateScreenshot', async (req, res) => { req = percyAutomateRequestHandler(req, percy.build); + percy.upload(await new WebdriverUtils(req.body).automateScreenshot()); res.json(200, { - success: await (percy.upload(await new WebdriverUtils(req.body).automateScreenshot())).then(() => true) + success: true }); }) // stops percy at the end of the current event loop From 0ae06eaf20e4942662c8d4ca5b41c94fd8bb1e43 Mon Sep 17 00:00:00 2001 From: amit3200 Date: Thu, 14 Sep 2023 16:11:54 +0530 Subject: [PATCH 2/3] Updating Tests --- .../test/metadata/metaDataResolver.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/webdriver-utils/test/metadata/metaDataResolver.test.js b/packages/webdriver-utils/test/metadata/metaDataResolver.test.js index 040792439..4ad8eec58 100644 --- a/packages/webdriver-utils/test/metadata/metaDataResolver.test.js +++ b/packages/webdriver-utils/test/metadata/metaDataResolver.test.js @@ -32,5 +32,19 @@ describe('MetaDataResolver', () => { expect(metadata.driver).toEqual(driver); expect(metadata.capabilities).toEqual({}); }); + + it('resolves MobileMetaData when deviceName is passed', () => { + metadata = MetaDataResolver.resolve(driver, capabilities, { platform: 'Linux', deviceName: 'RX224' }); + expect(metadata).toBeInstanceOf(DesktopMetaData); + expect(metadata.driver).toEqual(driver); + expect(metadata.capabilities).toEqual({}); + }); + + it('resolves DesktopMetaData when no deviceName is passed', () => { + metadata = MetaDataResolver.resolve(driver, capabilities, { platform: 'Linux' }); + expect(metadata).toBeInstanceOf(DesktopMetaData); + expect(metadata.driver).toEqual(driver); + expect(metadata.capabilities).toEqual({}); + }); }); }); From 2cafa4d6c2b5f87f1fd8e9449dd215a48372f950 Mon Sep 17 00:00:00 2001 From: amit3200 Date: Thu, 14 Sep 2023 17:31:41 +0530 Subject: [PATCH 3/3] Remove Incorrect Tests --- .../test/metadata/metaDataResolver.test.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/webdriver-utils/test/metadata/metaDataResolver.test.js b/packages/webdriver-utils/test/metadata/metaDataResolver.test.js index 4ad8eec58..040792439 100644 --- a/packages/webdriver-utils/test/metadata/metaDataResolver.test.js +++ b/packages/webdriver-utils/test/metadata/metaDataResolver.test.js @@ -32,19 +32,5 @@ describe('MetaDataResolver', () => { expect(metadata.driver).toEqual(driver); expect(metadata.capabilities).toEqual({}); }); - - it('resolves MobileMetaData when deviceName is passed', () => { - metadata = MetaDataResolver.resolve(driver, capabilities, { platform: 'Linux', deviceName: 'RX224' }); - expect(metadata).toBeInstanceOf(DesktopMetaData); - expect(metadata.driver).toEqual(driver); - expect(metadata.capabilities).toEqual({}); - }); - - it('resolves DesktopMetaData when no deviceName is passed', () => { - metadata = MetaDataResolver.resolve(driver, capabilities, { platform: 'Linux' }); - expect(metadata).toBeInstanceOf(DesktopMetaData); - expect(metadata.driver).toEqual(driver); - expect(metadata.capabilities).toEqual({}); - }); }); });