diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d1f299f3c4..dc86b0f7ab 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,6 +20,9 @@ jobs: env: CHROMEDRIVER_SKIP_DOWNLOAD: true GECKODRIVER_SKIP_DOWNLOAD: true + - name: Install sitespeed.io + run: npm install sitespeed.io -g + shell: bash - run: choco outdated - name: Show versions run: powershell "Get-AppxPackage -Name *MicrosoftEdge.* | Foreach Version" @@ -32,6 +35,9 @@ jobs: - name: Run Edge test with scripting run: node bin/sitespeed.js -b edge --multi test/prepostscripts/multiWindows.cjs -n 1 shell: cmd + - name: Test devtools error + run: sitespeed.io -b edge --multi test/prepostscripts/windows.cjs -n 1 + shell: bash - name: Run Edge test with config run: node bin/sitespeed.js -b edge --config test/exampleConfig.json https://www.sitespeed.io/ shell: cmd diff --git a/test/prepostscripts/windows.cjs b/test/prepostscripts/windows.cjs new file mode 100644 index 0000000000..2533b729d9 --- /dev/null +++ b/test/prepostscripts/windows.cjs @@ -0,0 +1,28 @@ +module.exports = async function(context, commands) { + + // We fetch the selenium webdriver from context + const webdriver = context.selenium.webdriver; + const driver = context.selenium.driver; + + try { + + await commands.measure.start('homepage_trial'); + + // Navigate to a URL + await commands.navigate('https://www.emirates.com/ae/english/'); + + await commands.measure.stop(); + + await commands.wait.byTime(2000); + + await commands.measure.start('click_on_accept_button'); + await commands.click.byXpathAndWait('//*[@id="onetrust-accept-btn-handler"]') + await commands.measure.stop(); + + } catch (e) { + + commands.screenshot.take('error_screenshot') + + throw e; + } +}; \ No newline at end of file