Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/actions/webdriver-desktop.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ const waitForXPath = (xpath, timeout = TIMEOUT) =>

const main = async () => {
console.log('\n🧪 Beginning desktop test...');
// running on develop builds because the url is static
// running against the production alias because the url is static
// github workflow triggers on PRs to main

const testUrl =
process.env.WEBDRIVER_ENV === 'main'
? 'https://develop--docs-website-netlify.netlify.app/'
? 'https://docs-website-netlify.netlify.app/'
: 'http://localhost:8000/';

console.log('\n🔍 looking for site at', testUrl);
Expand Down
18 changes: 16 additions & 2 deletions scripts/actions/webdriver-mobile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const waitForXPath = (xpath, timeout = TIMEOUT) =>
const main = async () => {
console.log('\n🧪 Beginning mobile test...');

// running on develop builds because the url is static
// running against the production alias because the url is static
// github workflow triggers on PRs to main
const testUrl =
// TODO: search modal click breaks page on mobile localhost
process.env.WEBDRIVER_ENV === 'main'
? 'https://develop--docs-website-netlify.netlify.app/'
? 'https://docs-website-netlify.netlify.app/'
: 'http://localhost:8000/';

console.log('\n🔍 looking for site at', testUrl);
Expand Down Expand Up @@ -120,11 +120,25 @@ const searchTest = async () => {
);
};

const dismissCookieBanner = async () => {
try {
const [closeButton] = await waitForXPath(
'//*[@aria-label="Close this consent banner"]',
3000
);
await closeButton.click();
await driver.sleep(500);
} catch {
// banner didn't show up, nothing to dismiss
}
};

const tileTest = async () => {
const initialUrl = await driver.getCurrentUrl();
const [firstDocTile] = await waitForXPath(
'//main//section//h3[text()="Popular docs"]/following::a'
);
await dismissCookieBanner();
// sometimes the cookie banner covers the doc tile so we need to scroll
await driver.executeScript(
'arguments[0].scrollIntoView(false)',
Expand Down
Loading