Skip to content

Commit

Permalink
CIF-1938: add ui tests for catalog page status bar (#264)
Browse files Browse the repository at this point in the history
* add ui tests for catalog page status bar
* skip test that requires the addon release for now
 * enabled UI test disabled earlier
* fix tests
* fix tests
* fix: enable the test for actions only for cloud
* fix: update to latest CS release

Co-authored-by: Levente Sántha <levente@adobe.com>
  • Loading branch information
buuhuu and LSantha authored Dec 12, 2022
1 parent 67ae417 commit 75e3770
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ try {
chromedriver = chromedriver.length >= 2 ? chromedriver[1] : '';

ci.dir('ui.tests', () => {
ci.sh(`CHROMEDRIVER=${chromedriver} mvn test -U -B -Pui-tests-local-execution -DHEADLESS_BROWSER=true -DSELENIUM-BROWSER=${BROWSER} -DVENIA_ACCOUNT_EMAIL=${VENIA_ACCOUNT_EMAIL} -DVENIA_ACCOUNT_PASSWORD=${VENIA_ACCOUNT_PASSWORD}`);
ci.sh(`CHROMEDRIVER=${chromedriver} mvn test -U -B -Pui-tests-local-execution -DAEM_VERSION=${classifier} -DHEADLESS_BROWSER=true -DSELENIUM-BROWSER=${BROWSER} -DVENIA_ACCOUNT_EMAIL=${VENIA_ACCOUNT_EMAIL} -DVENIA_ACCOUNT_PASSWORD=${VENIA_ACCOUNT_PASSWORD}`);
});
}

Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ executors:
docker:
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
<<: *docker_auth
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:6582-openjdk11
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-cloudready:9398-openjdk11
<<: *docker_auth
test_executor_655:
docker:
Expand Down
3 changes: 3 additions & 0 deletions ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<AEM_PUBLISH_URL />
<AEM_PUBLISH_USERNAME>admin</AEM_PUBLISH_USERNAME>
<AEM_PUBLISH_PASSWORD>admin</AEM_PUBLISH_PASSWORD>
<AEM_VERSION>cloud</AEM_VERSION>
<SELENIUM_BROWSER>chrome</SELENIUM_BROWSER>
<VENIA_ACCOUNT_EMAIL />
<VENIA_ACCOUNT_PASSWORD />
Expand Down Expand Up @@ -151,6 +152,7 @@
<AEM_PUBLISH_URL>${AEM_PUBLISH_URL}</AEM_PUBLISH_URL>
<AEM_PUBLISH_USERNAME>${AEM_PUBLISH_USERNAME}</AEM_PUBLISH_USERNAME>
<AEM_PUBLISH_PASSWORD>${AEM_PUBLISH_PASSWORD}</AEM_PUBLISH_PASSWORD>
<AEM_VERSION>${AEM_VERSION}</AEM_VERSION>
<VENIA_ACCOUNT_EMAIL>${VENIA_ACCOUNT_EMAIL}</VENIA_ACCOUNT_EMAIL>
<VENIA_ACCOUNT_PASSWORD>${VENIA_ACCOUNT_PASSWORD}</VENIA_ACCOUNT_PASSWORD>
<SELENIUM_BROWSER>${SELENIUM_BROWSER}</SELENIUM_BROWSER>
Expand Down Expand Up @@ -241,6 +243,7 @@
<AEM_PUBLISH_URL>${AEM_PUBLISH_URL}</AEM_PUBLISH_URL>
<AEM_PUBLISH_USERNAME>${AEM_PUBLISH_USERNAME}</AEM_PUBLISH_USERNAME>
<AEM_PUBLISH_PASSWORD>${AEM_PUBLISH_PASSWORD}</AEM_PUBLISH_PASSWORD>
<AEM_VERSION>${AEM_VERSION}</AEM_VERSION>
<VENIA_ACCOUNT_EMAIL>${VENIA_ACCOUNT_EMAIL}</VENIA_ACCOUNT_EMAIL>
<VENIA_ACCOUNT_PASSWORD>${VENIA_ACCOUNT_PASSWORD}</VENIA_ACCOUNT_PASSWORD>
<SELENIUM_BROWSER>${SELENIUM_BROWSER}</SELENIUM_BROWSER>
Expand Down
88 changes: 88 additions & 0 deletions ui.tests/test-module/specs/venia/statusbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright 2021 Adobe Systems Incorporated
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const config = require('../../lib/config');
const { OnboardingDialogHandler } = require('../../lib/commons');
const isCloud = process.env.AEM_VERSION !== 'classic';

describe('Catalog Page Status', function () {
const editor_page = `${config.aem.author.base_url}/editor.html`;
const product_page = '/content/venia/us/en/products/product-page';
const specific_page_no_suffix = '/content/venia/us/en/products/category-page/shop-the-look';
const specific_page_with_suffix = '/content/venia/us/en/products/category-page/shop-the-look.html/shop-the-look';

let onboardingHdler;

this.retries(2);

before(() => {
// Set window size to desktop
browser.setWindowSize(1280, 960);

// AEM Login
browser.AEMForceLogout();
browser.url(config.aem.author.base_url);
browser.AEMLogin(config.aem.author.username, config.aem.author.password);

// Enable helper to handle onboarding dialog popup
onboardingHdler = new OnboardingDialogHandler(browser);
onboardingHdler.enable();
});

after(function () {
// Disable helper to handle onboarding dialog popup
onboardingHdler.disable();
});

it('is shown on template pages', () => {
browser.url(`${editor_page}${product_page}.html`);
browser.AEMEditorLoaded();

expect($('coral-alert-header=Venia Demo Store - Product page')).toBeDisplayed();

if (isCloud) {
// actions are not available on 6.5 in general
expect($('a[data-status-action-id="open-template-page"]')).not.toBeDisplayed();
}
});

it('is shown on specific pages', () => {
browser.url(`${editor_page}${specific_page_no_suffix}.html`);
browser.AEMEditorLoaded();

expect($('coral-alert-header=Shop the look')).toBeDisplayed();

if (isCloud) {
// actions are not available on 6.5 in general
expect($('a[data-status-action-id="open-template-page"]')).not.toBeDisplayed();
}
});

if (isCloud) {
// due to an issue in the editors getPageInfoLocation function, the status bar is not shown
// on classic at all with a suffix. This is a known issue, fixed for CS but not yet back
// ported to 6.5
it('is shown on specific pages with suffix', () => {
browser.url(`${editor_page}${specific_page_with_suffix}.html`);
browser.AEMEditorLoaded();

expect($('coral-alert-header=Shop the look')).toBeDisplayed();

const openTemplatePageButton = $('a[data-status-action-id="open-template-page"]');
expect(openTemplatePageButton).toBeClickable();
});
}
});

0 comments on commit 75e3770

Please sign in to comment.