Skip to content

Commit

Permalink
[#28, #33] Mobile menu backgrounds and spacing (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronan authored Jan 27, 2025
1 parent 26b07a3 commit 92ae93c
Show file tree
Hide file tree
Showing 29 changed files with 1,360 additions and 774 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/capture.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Capture Theme Changes
run-name: Capturing visual reference 👓
on: [push]
on: []
permissions:
contents: write
jobs:
Expand Down
54 changes: 25 additions & 29 deletions .ops/backstop.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
},
"report": ["browser","json"],
"engine": "playwright",
"onReadyScript": "onReady.js",
"engineOptions": {
"browser": "chromium"
},
Expand All @@ -34,39 +33,36 @@ module.exports = {
"debugWindow": false,
"scenarioLogsInReports": true,
"fileNameTemplate": '{scenarioLabel}--{viewportLabel}',
"scenarios": [
{
"label": "Mobile Menu",
"url": "http://app/",
"viewports": [
{
"label": "mobile",
"width": 360,
"height": 800
}
],
// "clickSelector": ".menu-toggle-button",
"postInteractionWait": 1000,
"clickSelectors": [
".l-header .menu-toggle-button",
".l-header .has-children"
]
}
],
"onReadyScript": "",
"scenarios": [],
readyTimeout: 3,
}

try {
require('fs')
.readFileSync('/urls.txt', 'utf-8')
.split(/\n/)
.forEach((url) => {
module.exports.scenarios.push(
{
"label": url.split(/\s+/).pop().trim(),
"url": `http://app${url.split(/\s+/)[0]}`,
}
);
});
.forEach((line) => {
parts = line.split(',').map(str => str.trim());
if (!parts || parts[0]?.startsWith('#') || !parts?.[1])
return;

scenario = {
"label": parts[0],
"url": `http://app${parts[1]}`,
"onReadyScript": parts[2] || "onReady.js"
};
module.exports.scenarios.push(scenario);
});
} catch (err) {
console.log(err);
}
}

// // module.exports.scenarios.push(scenario);

// module.exports.scenarios.push(
// {
// "label": parts[0].trim(),
// "url": `http://app${parts[1]}`,
// }
// );
Binary file removed .ops/output/vrt/approved/Breadcrumb--desktop.png
Binary file not shown.
Binary file removed .ops/output/vrt/approved/Breadcrumb--mobile.png
Binary file not shown.
Binary file removed .ops/output/vrt/approved/Events--desktop.png
Binary file not shown.
Binary file removed .ops/output/vrt/approved/Events--mobile.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .ops/output/vrt/approved/Header_Menus--mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .ops/output/vrt/approved/Home--desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .ops/output/vrt/approved/Home--mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .ops/output/vrt/approved/Long_Menus--desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .ops/output/vrt/approved/Long_Menus--mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .ops/output/vrt/approved/Menus--desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .ops/output/vrt/approved/Menus--mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .ops/output/vrt/approved/Mobile_Menu--mobile.png
Binary file not shown.
10 changes: 5 additions & 5 deletions .ops/urls.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/ Home
/menus Menus
/events Events
/events/past-events Past Events
/menus/b Secondary Page with Breadcrumb
# Title Path
Header Menus, /, clickMenu.js
Home, /
Menus, /menus
Long Menus, /menus/long
21 changes: 21 additions & 0 deletions .ops/vrt-scripts/clickMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = async (page, scenario) => {

// Desktop: Top Level menu link is visible
// const menu = await page.waitForSelector('a[href*="menus"]', {state: 'attached', timeout: 3000});
// if (menu && await menu.isVisible()) {
// await menu.hover();
// await menu.dispatchEvent('mousemove')
// // #TODO: The playwrite hover does not trigger the menu js.
// // await page.hover('a[href*="menus/long"]');
// await page.waitForTimeout(10000);
// }

// Mobile: Menu toggle is visible
const toggle = await page.waitForSelector('.menu-toggle-button', {state: 'attached', timeout: 3000});
if (toggle && await toggle.isVisible()) {
await toggle.click();
await page.click('a[href="/menus"]');
await page.click('a[href="/menus/long"]');
await page.waitForTimeout(1000);
}
};
16 changes: 8 additions & 8 deletions containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ RUN apt-get update \
# Create some helper utilities
RUN\
util() { echo "#!/bin/sh\n\n$2" > "/usr/local/bin/$1" && chmod a+x "/usr/local/bin/$1"; }\
&& util "bd" "php /bee/bee.php --root=/var/www/html --base-url=http://localhost:8888/ \$@" \
&& util "cr" "bd cc all;" \
&& util "uli" "bd uli;" \
&& util "si" "bd si --auto --db-name=app --db-user=root --db-pass=root --db-host=db --profile=decanter_profile" \
&& util "reset-db" "mariadb -h db --user=root --password=root -e 'DROP DATABASE IF EXISTS app; CREATE DATABASE app'" \
&& util "reset-app" "rm -rf /var/www/html/files/config*;" \
&& util "fix-perms" "chown --quiet -R www-data:www-data /var/www/html;" \
&& util "install-app" "reset-db && reset-app && si && fix-perms && uli;"
&& util "bd" "php /bee/bee.php --root=/var/www/html --base-url=http://localhost:8888/ \$@" \
&& util "cr" "bd cc all;" \
&& util "uli" "bd uli;" \
&& util "si" "bd si --auto --db-name=app --db-user=root --db-pass=root --db-host=db --profile=decanter_profile" \
&& util "reset-db" "mariadb -h db --user=root --password=root -e 'DROP DATABASE IF EXISTS app; CREATE DATABASE app'" \
&& util "reset-app" "rm -rf /var/www/html/files/config*;" \
&& util "fix-perms" "chown --quiet -R www-data:www-data /var/www/html;" \
&& util "install-app" "reset-db && reset-app && si && bd -y cim && fix-perms && uli;"


# Download backdrop and bee
Expand Down
Loading

0 comments on commit 92ae93c

Please sign in to comment.