From 87c093dd4d94bda79c4c42f53108f8ed12e63b86 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 14 Jun 2023 14:07:14 +0200 Subject: [PATCH 1/4] Try to replicate devtools failure. https://github.com/sitespeedio/sitespeed.io/issues/3847 --- .github/workflows/windows.yml | 3 +++ test/prepostscripts/windows.cjs | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 test/prepostscripts/windows.cjs diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2c76fe1dbd..eda7e59b41 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -29,4 +29,7 @@ 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: node bin/sitespeed.js -b edge --multi test/prepostscripts/windows.cjs -n 1 + shell: cmd \ No newline at end of file diff --git a/test/prepostscripts/windows.cjs b/test/prepostscripts/windows.cjs new file mode 100644 index 0000000000..ec9d4fb533 --- /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-btns-handlers"]') + await commands.measure.stop(); + + } catch (e) { + + commands.screenshot.take('error_screenshot') + + throw e; + } +}; \ No newline at end of file From 129fd61c9c444a014f8ece02ceb0fb2df7ddc454 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Fri, 29 Dec 2023 06:02:18 +0100 Subject: [PATCH 2/4] try replicate failure --- .github/workflows/windows.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index eda7e59b41..9e32a595d6 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: Install dependencies run: choco install microsoft-edge --force @@ -30,6 +33,6 @@ jobs: run: node bin/sitespeed.js -b edge --multi test/prepostscripts/multiWindows.cjs -n 1 shell: cmd - name: Test devtools error - run: node bin/sitespeed.js -b edge --multi test/prepostscripts/windows.cjs -n 1 - shell: cmd + run: sitespeed.io -b edge --multi test/prepostscripts/windows.cjs -n 1 + shell: bash \ No newline at end of file From 1e07f83d10f78e3aa5f96fff247291d03febf2c3 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Sun, 31 Dec 2023 10:18:39 +0100 Subject: [PATCH 3/4] try correct name --- test/prepostscripts/windows.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/prepostscripts/windows.cjs b/test/prepostscripts/windows.cjs index ec9d4fb533..c07cdccb9b 100644 --- a/test/prepostscripts/windows.cjs +++ b/test/prepostscripts/windows.cjs @@ -13,10 +13,10 @@ module.exports = async function(context, commands) { await commands.measure.stop(); - await commands.wait.byTime(2000) + await commands.wait.byTime(2000); await commands.measure.start('click_on_accept_button'); - await commands.click.byXpathAndWait('//*[@id="onetrust-accept-btns-handlers"]') + await commands.click.byXpathAndWait('//*[@id=""onetrust-accept-btn-handler"]') await commands.measure.stop(); } catch (e) { From 1ad2d61f8b9320fc4a715e12c159874cf0f709bf Mon Sep 17 00:00:00 2001 From: soulgalore Date: Mon, 1 Jan 2024 21:45:16 +0100 Subject: [PATCH 4/4] another fix --- test/prepostscripts/windows.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/prepostscripts/windows.cjs b/test/prepostscripts/windows.cjs index c07cdccb9b..2533b729d9 100644 --- a/test/prepostscripts/windows.cjs +++ b/test/prepostscripts/windows.cjs @@ -16,7 +16,7 @@ module.exports = async function(context, commands) { await commands.wait.byTime(2000); await commands.measure.start('click_on_accept_button'); - await commands.click.byXpathAndWait('//*[@id=""onetrust-accept-btn-handler"]') + await commands.click.byXpathAndWait('//*[@id="onetrust-accept-btn-handler"]') await commands.measure.stop(); } catch (e) {