Skip to content

Commit

Permalink
Merge pull request #51 from ez-aem/develop-regression-external-img
Browse files Browse the repository at this point in the history
Regression testing: google drive reference image storage support
  • Loading branch information
jzeltman authored Mar 8, 2022
2 parents ae1538e + fcc6afc commit 4a5e266
Show file tree
Hide file tree
Showing 17 changed files with 264 additions and 108 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ site-template
theme/.env

### BackstopJS Files ###
theme/test_data/bitmaps_reference/
theme/test_data/bitmaps_test/
theme/test_data/html_report/

Expand Down
10 changes: 10 additions & 0 deletions theme/env_template
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ AEM_SITE=<site name>

# AEM proxy port
AEM_PROXY_PORT=7000

# AEM username
AEM_USERNAME=admin


# AEM password
AEM_PASSWORD=admin

# (OPTIONAL) Path to google drive regression test images
GOOGLE_DRIVE_TEST_IMAGES_PATH=G:/.shortcut-targets-by-id/{id of shared drive}/regresstiontestimages
105 changes: 51 additions & 54 deletions theme/live.test.config.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
const config = require("./test.config");

const baseURL = `http://localhost:4502/content/${config.aemSite}/`;
const queryParams = "?wcmmode=disabled";

// add pages you want tested here:
const pagesToTest = ["en/home.html", "guide.html"];

// add advanced tests here:
const scenarios = [
// {
// label: "",
// url: ``,
// cookiePath: "",
// referenceUrl: "",
// readyEvent: "",
// readySelector: "",
// delay: 0,
// hideSelectors: [],
// removeSelectors: [],
// hoverSelector: "",
// clickSelector: "",
// postInteractionWait: 0,
// selectors: [],
// selectorExpansion: true,
// expect: 0,
// },
{
label: "mobile-menu",
login: config.aemLogin,
url: baseURL + "en/home.html",
viewports: [
{
label: "phone",
width: 320,
height: 480,
},
],
clickSelector: "#mobile-header-button",
},
];

pagesToTest.forEach((url) => {
const name = url.slice(url.lastIndexOf("/") + 1, url.indexOf(".html"));

scenarios.push({
label: name,
login: config.aemLogin,
url: baseURL + url + queryParams,
});
});

module.exports = {
...config,
scenarios: [
// {
// label: "",
// url: ``,
// cookiePath: "",
// referenceUrl: "",
// readyEvent: "",
// readySelector: "",
// delay: 0,
// hideSelectors: [],
// removeSelectors: [],
// hoverSelector: "",
// clickSelector: "",
// postInteractionWait: 0,
// selectors: [],
// selectorExpansion: true,
// expect: 0,
// },
{
label: "Home",
login: config.aemLogin,
url: `http://localhost:${config.aemPort + 1}/content/${
config.aemSite
}/en/home.html`,
cookiePath: "",
referenceUrl: "",
readyEvent: "",
readySelector: "",
delay: 0,
hideSelectors: [],
removeSelectors: [],
hoverSelector: "",
clickSelector: "",
postInteractionWait: 0,
selectors: [],
selectorExpansion: true,
expect: 0,
},
{
label: "mobile-menu",
login: config.aemLogin,
url: `http://localhost:${config.aemPort + 1}/content/${
config.aemSite
}/en/home.html`,
viewports: [
{
label: "phone",
width: 320,
height: 480,
},
],
clickSelector: "#mobile-header-button",
},
],
scenarios,
// set to one, so browser sync doesn't mess with click/inputs/scrolling during screenshots
asyncCaptureLimit: 1,
};
60 changes: 49 additions & 11 deletions theme/local.test.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
const config = require("./test.config");

const url =
"http://localhost:4502/content/aem-site-template-tailwind/en/home.html";
const baseURL = `http://localhost:4502/content/${config.aemSite}/`;
const queryParams = "?wcmmode=disabled";

// add pages you want tested here:
const pagesToTest = [
"en/home.html",
"guide.html",
"guide/manage.html",
"guide/manage/assets.html",
"guide/manage/site-elements.html",
"guide/manage/authoring.html",
"guide/manage/create-a-page.html",
"guide/manage/publish.html",
"guide/customize.html",
"en/article.html",
"en/article/donec-tristique-efficitur.html",
"en/article/fusce-at-efficitur-mi.html",
"en/article/morbi-dapibus-libero-velit.html",
"en/article/duis-bibendum-vitae.html",
"en/contact-us.html",
];

// add advanced tests here:
const scenarios = [
{
label: "mobile-menu",
login: config.aemLogin,
url: baseURL + "en/home.html",
viewports: [
{
label: "phone",
width: 320,
height: 480,
},
],
clickSelector: "#mobile-header-button",
},
];

pagesToTest.forEach((url) => {
const name = url.slice(url.lastIndexOf("/") + 1, url.indexOf(".html"));

scenarios.push({
label: name,
login: config.aemLogin,
url: baseURL + url + queryParams,
});
});

module.exports = {
...config,
scenarios: [
{
label: "Home",
login: config.aemLogin,
// cookiePath: "",
url: url,
// referenceUrl: "",
},
],
scenarios,
};
Loading

0 comments on commit 4a5e266

Please sign in to comment.