Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression testing: google drive reference image storage support #51

Merged
merged 3 commits into from
Mar 8, 2022
Merged
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
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