diff --git a/test/helpers/selenium-helper.js b/test/helpers/selenium-helper.js index ca0b8cfee2ec23c2c59f385b4c686896a009fee9..12549e93301389f4efedf47ff01791996868a69c 100644 --- a/test/helpers/selenium-helper.js +++ b/test/helpers/selenium-helper.js @@ -49,9 +49,8 @@ class SeleniumHelper { args.push('--headless'); } - // Stub getUserMedia to prevent permissions access issues - args.push('--use-fake-ui-for-media-stream'); - args.push('--fake-device-for-media-stream'); + // Stub getUserMedia to always not allow access + args.push('--use-fake-ui-for-media-stream=deny'); chromeCapabilities.set('chromeOptions', {args}); chromeCapabilities.setLoggingPrefs({ diff --git a/test/integration/blocks.test.js b/test/integration/blocks.test.js index 6ca2d279cf6f36bf1cbf75edd012c35abde70d03..950d285875d2514ffcbd80402227a872d940bc56 100644 --- a/test/integration/blocks.test.js +++ b/test/integration/blocks.test.js @@ -158,7 +158,7 @@ describe('Working with the blocks', () => { await expect(logs).toEqual([]); }); - test('Record option from sound block menu opens sound recorder', async () => { + test.only('Record option from sound block menu opens sound recorder', async () => { await loadUri(uri); await clickXpath('//button[@title="Try It"]'); await clickText('Code'); @@ -166,6 +166,10 @@ describe('Working with the blocks', () => { await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for scroll animation await clickText('Meow', scope.blocksTab); // Click "play sound <Meow> until done" block await clickText('record'); // Click "record..." option in the block's sound menu + // Access has been force denied, so close the alert that comes up + await driver.sleep(1000); // getUserMedia requests are very slow to fail for some reason + await driver.switchTo().alert() + .accept(); await findByText('Record Sound'); // Sound recorder is open const logs = await getLogs(); await expect(logs).toEqual([]);